Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
$ inxi -xxxW 60610
Weather: Conditions: 31 F (-1 C) - Overcast Wind: From the WSW at 15 MPH Humidity: 57%
Pressure: 30.31 in (1026 mb) Wind Chill: 20 F (-6 C)
Location: Chicago IL (US) Altitude: 178 ft
Time: November 12, 3:22 PM CST Observation Time: November 12, 2:53 PM CST
I need to develop a sed line break before each text word with a colon for conky
to look like this. Manuals I looked at don't do it exactly right. Command would
be placed in conky to display weather info. The last line or three could be omitted
but that's not the main problem. An easy sed one-liner I hope.
$ inxi -xxxW 60610 | sed ?
Weather:
Conditions: 31 F (-1 C) - Overcast
Wind: From the WSW at 15 MPH
Humidity: 57%
Pressure: 30.31 in (1026 mb)
Wind Chill: 20 F (-6 C)
Location: Chicago IL (US) Altitude: 178 ft
Time: November 12, 3:22 PM CST
Observation Time: November 12, 2:53 PM CST
Well: you've probably been that far alread ... sorry
I searched a bit, i fooled a bit, i didn't get it sorted, but then thought: why not post my result.
$ inxi -xxxW 60610|sed 's/Co/\nCo/;s/Wind:/\nWind:/;s/Hu/\nHu/;s/Pr/\nPr/;s/Wind Chill/\nWind Chill/;s/Loc/\nLoc/;s/Al/\nAl/;s/Time:/\nTime:/;s/Ob/\nOb/'
Weather:
Conditions: 29 F (-2 C) - Overcast
Wind: From the West at 14 MPH
Humidity: 56%
Pressure: 30.32 in (1027 mb)
Wind Chill: 18 F (-8 C)
Location: Chicago IL (US)
Altitude: 178 ft
Time: November 12, 5:29 PM CST
Observation Time: November 12, 4:53 PM CST
To get rid of the blank lines the (the 3rd sed command), I first needed to remove the ansi color codes (the 2nd sed cmd)
$ inxi -xxxW 60610|sed 's/Co/\nCo/;s/Wind:/\nWind:/;s/Hu/\nHu/;s/Pr/\nPr/;s/Wind Chill/\nWind Chill/;s/Loc/\nLoc/;s/Al/\nAl/;s/Time:/\nTime:/;s/Ob/\nOb/'|sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'|sed '/^[ \t]/d'
Weather:
Conditions: 29 F (-2 C) - Overcast
Wind: From the West at 14 MPH
Humidity: 56%
Pressure: 30.32 in (1027 mb)
Wind Chill: 18 F (-8 C)
Location: Chicago IL (US)
Altitude: 178 ft
Time: November 12, 5:30 PM CST
Observation Time: November 12, 4:53 PM CST
kmathern wrote:To get rid of the blank lines the (the 3rd sed command), I first needed to remove the ansi color codes (the 2nd sed cmd)
Brilliant ! When I throw it into conky it's full of non-text visible items.
Do you have conky to take a look ? They need to be filtered out
somehow. In the terminal it looks great. THX.
I think with a certain pattern, say word+colon, one will want to use regular expressions, instead of typing them in a list.
Stuff like this too: \b\b\b\b\b\b\b\b\b\b\b
In fact i think that is the main point of tools like sed, awk, perl and others (editors come to mind too. Well, sed is the streaming editor, right? ).
You might wanna give it a try at linuxquestions.org, and if that doesn't help (i highly doubt that) at unix.com and if that doesn't work at stackoverflow (where i am quite sure you will get the answer).
Good luck.