RosettaCodeData/Task/Substring-Top-and-tail/UNIX-Shell/substring-top-and-tail-1.sh

4 lines
89 B
Bash

str='abcdefg'
echo "${str#?}" # Remove first char
echo "${str%?}" # Remove last char