Heyas
I am trying to remove a tailing space, with substitution.
Already tried some multiple escapes with no luck, is that even possible?
And all i get is:
The 2nd printed output, would be expected to be:
Thank you
EDIT:
I can check if the last string is a slash or not, but i thought a subs would work just fine?
I am trying to remove a tailing space, with substitution.
Already tried some multiple escapes with no luck, is that even possible?
Code:
echo $CHROOT
[ -z "$CHROOT" ] || \
CHROOT="${CHROOT/\/$}"
echo $CHROOT
return
Code:
:) paths $ CHROOT=/usr/local/
+ paths $ . *
/usr/local/
/usr/local/
Code:
$SHELL -version
GNU bash, version 4.3.33(1)-release (x86_64-redhat-linux-gnu)
Code:
/usr/local
EDIT:
I can check if the last string is a slash or not, but i thought a subs would work just fine?