Monday 21 May 2018

pipe - How to concatenate two lines with `sed`?

I am trying to concatenate two lines of iwlist output. My grep and sed commands to remove leading and trailing spaces work fine but I can't get the last sed statement to remove the \n to work. What am I missing?


sudo iwlist wlan0 scanning |
grep -e ESSID -e Signal |
sed -e 's/^[ \t]*//;s/[ \t]*$//' |
sed -e 's/dBm\n/dBm /'

The regex works fine in vim.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...