Unix Blog

Monday, October 25, 2010

String manipulation using UNIX commands

Extract substring based on index.

e.g.
first_name=Jayanthi
short_name=${first_name:0:3}
echo $short_name

Output: Jay


Replace all occurrences of a text
:%s/search_string/replacement_string/g

posted by Jayanthi Krishnamurthy @ 11:24 AM   0 Comments

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home

Newer›  ‹Older

About Me

Name: Jayanthi Krishnamurthy

View my complete profile

Posts

  • String manipulation using UNIX commands

Older Posts Newer Posts

Archives

Subscribe to
Posts [Atom]