bhupixb

length in bash string

Jun 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. read x
  2.  
  3. # Whithout spaces count else gives error
  4. #expr length $x
  5.  
  6. #counts character with endl also if used -c
  7. echo $x | wc -w
Add Comment
Please, Sign In to add comment