Sorry, I'm pretty new to coding. I'm just trying to remove the CST that follows the end of the string. The final output that I'm trying to get says "Sunset: 4:38 PM CST". Exclude the quotation marks.

Here is the code that I'm using within the shell.

curl http://m.wund.com/US/MN/Winona.html | grep 'Sunset' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed -e 's/Sunset/Sunset: /g' | sed -e 's/PST//g'
有帮助吗?

解决方案

Just change:

... | sed -e 's/PST//g'

to

... | sed -e 's/CST//g'

You might also want to invoke curl -s instead of just curl to omit all the downloading stuff.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top