Pregunta

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'
¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top