 Okay, you've probably used the command wc before it will give you line counts on on words characters and Lines yes, so if I was to say cat out a file. We'll say Etc services we get a big old file here if we were curious on how many words characters and lines are in that we could pipe That into wc, so we can see here. There's 680 lines There's two thousand six hundred and forty seven words and we got nineteen thousand four hundred thirty six characters individual characters in that file We can also cat out something like Linux and pipe it into wc and hit enter. Oh, sorry not cat Let's echo that line and you can see that we've get a file with one line one word and six characters Problem with this Linux only has five characters in it. Why is it saying six you might go Chris? You have a space at the end. Well, let's try it without the space. We still get six We can also tell wc to Dash see only shows character so we can ignore the lines and words. Let's just look at the number of characters Still getting six there. Let's put quotations So we make sure there's nothing else in there we're still getting six why is word count giving me an inaccurate Number of characters. Well, wc. It's not wc. It's messing up It's echo that is messing you up here because by default when you echo out a line It automatically gives you a new line character So you can see there's a new line there if I was to give echo the dash end command saying no new line You'll see that it does not give me that new line at the end That's why Linux here is on the same line as my new prompt Hit enter again to get off that So that is the problem. It's the new line character even though you're not physically seeing it with your eyes. It is Still there and word count is counting that new line character as a character But if we say no new line we do wc dash see we get five which is an accurate number So that's one option. Another option is instead of using echo. You can always use printf printf Linux Gives us Linux as an output with no new line because by default printf does not give a new line So it's like in this case using echo with the no new line character So we printf Linux into wc dash see We get five So if you're going to try to count the number of letters in a string using this technique And it's not the only technique and they're probably better techniques out there But if you are using this technique and you're using echo be sure to add the new line or just use printf That I'm sorry the no new line and printf that way you don't get an inaccurate number Which could completely throw off your script if that's vital to your script So I thank you for watching. Please visit my website. That's filmsbychrist.com That's Chris with a K there should be a link in the description and I hope that you have a great day