Hi,
How can I remove trialing digits from a string ?
this 5
test 556
test5
thank you.
SOLVED : Bash remove trailing digits
Re: Bash remove trailing digits
You can use
But this will remove all digits not only at the end.
Better is to use sed
Code: Select all
VARIABLE="test 556";
VARIABLE=${VARIABLE//[0-9]/};
Better is to use sed
Code: Select all
VARIABLE=`echo $VARIABLE | sed -e 's/[0-9]*$//g'`;
Re: Bash remove trailing digits
Thanks that is what I was looking for