Tips and Tricks
Keep all tips and tricks learned in one place.
Monday, December 5, 2011
String length
ubuntu1004@ubuntu1004:~$ str=abcdef
ubuntu1004@ubuntu1004:~$ echo ${#str}
6
ubuntu1004@ubuntu1004:~$ echo `expr length $str`
6
ubuntu1004@ubuntu1004:~$ echo `expr "$str" : '.*'`
6
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment