Documentation → Sed to remove first or last character in a string.
July 1st, 2009 by Jgz
To remove the first character in a string:
echo $STRING |sed ‘s/.\(.*\)/\1/’
To remove the last character in a string:
echo $STRING | sed ‘s/\(.*\)./\1/’
To remove the last five characters in a string:
echo $STRING | sed ‘s/\(.*\)…../\1/’