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

Popular posts from this blog

sql - Find last match with latest inserted name in table -

c# - XML serialize base class without knowing derived class -

Send innerHTML text in URL in JSP -