Hi ,
This is a pretty simple sed command i found when i was checking out one of the codes of my colleague .
sed -e 's/\[A-Za-z]*.*\) \(\ <1[a-z]*e\ >\) \([a-zA-Z]*.*\)/\2/'
When i tried this on a few text files it was displaying the entire line. If this was to display entire line why sweat out on a sed . Does this has more than just that.
Hi, the first sed is missing a forward parenthesis, so it will not work. Anyway a sed command with those options only changes a line when it makes a match. Otherwise it will just display the unchanged line. More grep-like behavior requires the -n option. E.g:
sed -n 's/\([A-Za-z]*.*\) \(\ <1[a-z]*e\ >\) \([a-zA-Z]*.*\)/\2/p'
will most likely not display anything since no match was found. If you feed it e.g.:
echo "blabla <1yadeyade > blabla " | sed ...
then it will return
<1yadeyade >
The second expression is missing a forward slash. If you feed it