I am writing a program on using
wc -c to count the amount of letters in a string. It counts the letters, but adds one extra. This is what I currently have:
echo "enter a word" read var1 echo $var1 | wc -c
When I enter the word, it successfully does something, however, for example if I enter "test" it will output 5.
Why is it doing this and is there a fix?