Eternal Technology
FlipKart
FlipKart Casio Watch
Thursday, 25 April 2013
Unix Shell Script : Removing Leading and Trailing spaces from a string
Leading spaces from value of a variable can be removed as follows:
$ echo $var | sed 's/^ *//g'
Trailing spaces from value of a variable can be removed as follows:
$ echo $var | sed 's/ *$//g'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment