Wednesday, December 23, 2009

shell command substring

The below command will print the string which is taken from the 9th index to 4 characters from 9th index.
echo | awk '{ print substr("'"$STRING"'",9,4) }'

No comments:

Post a Comment