Monday, May 23, 2011

Remove Character From Bash Variable


 Sometimes, it is the little things that take an extra few minutes to find on the Internet that really slow you down...

Remove the first character from a bash variable:
VAR=${VAR#?}

Remove the last character from a bash variable
VAR=${VAR%?}

No comments:

Post a Comment