Friday, July 11, 2008

Find the character immediately after a word - sed



$ echo "unix:bash/scripting:12"
unix:bash/scripting:12


Purpose: find the character after the word "bash"


$ echo "unix:bash/scripting:12" | sed 's/.*bash\(.\).*/\1/'
/

.

No comments:

© Jadu Saikia www.UNIXCL.com