help with sed
Hello, I'm having difficulty removing text enclosed in brackets from lines with sed.
For example, if I echo the following line: Jun 2 08:28:37 host kernel: word1 word2 [word3] word4 [word5] word6 to sed "s/\[.*\]//g", sed removes words 3-5. The desired effect is that I want to only remove words 3 and 5. I know sed is doing exactly what I am telling it to. How to I tell it to do what I want? Thanks for the help! |
got it, thanks anyway
sed -e 's/\[[^]]*]//g' |
All times are GMT -5. The time now is 10:58 AM. |