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