Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Run shell scripts from the Script Menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Run shell scripts from the Script Menu
Authored by: bluehz on Apr 24, '03 01:45:00PM
You can also use pbcopy to place the fortune directly on the clipboard - ready to paste.
curl -s http://
www.thinkgeek.com/fortune.shtml | awk '/#F1F5FB/,/\/p/'| sed 
's/<.*>//g' | pbcopy
can any of you sed pros tell me why this won't work to remove the blank lines too?
curl -s http://www.thinkgeek.com/
fortune.shtml | awk '/#F1F5FB/,/\/p/'| sed 's/<.*>//g' | 
sed '/./,$!d'\ | pbcopy
BTW - there is a great resource of sed one-liners here:
http://www-h.eng.cam.ac.uk/help/tpl/unix/ sed.html

[ Reply to This | # ]
Run shell scripts from the Script Menu
Authored by: Impatient1 on Apr 25, '03 05:17:53PM

url_fortune=http://www.thinkgeek.com/fortune.shtml

curl -s $url_fortune |
awk '/#F1F5FB/,/\/p/' |
sed 's/<.*>//g' |
sed 's/.$//' |
sed '/./!d' |
pbcopy



[ Reply to This | # ]