문제

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