In my humble opinion ....
sed 's/^//g'
echo "bar" | sed 's/^/foo-/g'
Than you for saving me some time ;)
If the data is already in a variable, do this which is much faster:MYVAR="prefix-${MYVAR}"
If you want to *append* a string "foo" to a string "-bar" do the following:echo "foo" | sed 's/$/-bar/g'
Post a Comment
3 comments:
Than you for saving me some time ;)
If the data is already in a variable, do this which is much faster:
MYVAR="prefix-${MYVAR}"
If you want to *append* a string "foo" to a string "-bar" do the following:
echo "foo" | sed 's/$/-bar/g'
Post a Comment