I am on ubuntu 12.04. Following expression:
echo abcd123 | sed 's/\([a-z]*\).*/\1/'
is supposed to get result as "abcd". But I am getting "abcd123". WHY??
Using following site as SED tutorial: SED tutorial by Bruce Barnett
I am on ubuntu 12.04. Following expression:
echo abcd123 | sed 's/\([a-z]*\).*/\1/'
is supposed to get result as "abcd". But I am getting "abcd123". WHY??
Using following site as SED tutorial: SED tutorial by Bruce Barnett
Your sed command looks fine. I just checked your posted snippet on my own Ubuntu 12.04.1 LTS box and it worked perfectly. Sed is one of those tools that has been around forever, so it is unlikely (though certainly not impossible) that 12.04 has a broken sed. Very strange...
/bin/sed
instead of justsed
(in casesed
is aliased to something weird on your system)?sed
is pointing to on your machine! Could you runtype sed
and paste what it returns?