raspberry pi - shell script that takes a string input by the user and outputs the number of characters in it? -
Can you show me a shell script that takes string input by the user and outputs the number of characters in it? I've tried many times but I can not get it right.
Use wc functions like this:
Echo-N ABC | Wc -c
or
echo -n abc. Wc -m
- Check the manual for the last press Newline which will be counted as an additional character
Comments
Post a Comment