I've got a very simple bash script which I'm passing values to
I want to strip the prefix from the value passed to the script.
The works and strips test- from the passed value..
IN=$1
arrIN=(${IN//test-/})
echo $arrIN
So test-12345 returns 12345
Is there anyway to amend this so it will remove either test- or local- ?
I've tried :
arrIN=(${IN//test-|local-/})
But that didn't work..
Thanks
${var##*-}gets the portion from last-to the end of the string. But you are using array notation, so it is not clear if this is enough/