Domanda

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'
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top