curl --silent "http://rss.news.yahoo.com/rss/topstories" | grep -E '(title>)' | \
sed -n '4,$p' |
sed -e 's/<title>//' -e 's/<\/title>//' |
sed -e 's/<!\[CDATA\[//g' |
sed -e 's/\]\]>//g' |
sed -e 's/<[^>]*>//g' |
sed -e '/^[ ]*$/d' |
head $headarg
curl --silent "http://www.mupromo.com" | grep "div class=\"head1\"" | sed -e 's/<div class=\"head1\">//' | sed -e 's/<.*//'
curl --silent "http://www.mupromo.com" | grep "div class=\"body1-content\">" | sed -e 's/<[^>]*>//g'
curl http://www.google.com/finance?q=mgm | sed -n '/chg/{x;1!p;g;p;n;p;};h' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | tail -3 | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed '$!N;s/\n/ /' | sed 's/^/MGM /g'
Does anybody have the script for a horizontal calendar?
My monthly calendar changed to august days and dates but now it wraps because of not enough days along the top. Any help on the code would be appreciated.
![]()
cal | sed -e '1d' -e '2p;2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/././g') /"
Perfect. Thanks.i had the same problem from july to august...
Code:cal | sed -e '1d' -e '2p;2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/././g') /"
All that was needed was an extra 2p and then another -e '$!N;s/\n/
im a complete noob at this. i cant get any of those codes to work. any one know the problem?
im a complete noob at this. i cant get any of those codes to work. any one know the problem?
Perfect. Thanks.
Will I have to do this for each month to calculate the start day of week and date?
Stupid me. Had the text set to right instead of centered. Duh!cal | sed -e '1d' -e '2p;2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/././g') /"
Most of the scripts came from this thread. Still a few bugs, but it's pretty much complete.
If anyone has any suggestions or questions, feel free.
Or if anyone could help me get the quote of the day simply, that would be great, this doesn't seem to be working:
Code:curl encarta.msn.com/encnet/feeds/rssfeed.aspx?typ e=quote | grep description | sed -e 's/\(.*\)//' -e 's/.*//'
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | cut -d - -f 1
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/.*\(-\)/-/'
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'
curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/chg/{x;1!p;g;p;n;p;};h' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | tail -3 | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed '$!N;s/\n/ /' | sed 's/^/DOW /g'
curl http://www.google.ca/finance?q=INDEXSP:.INX | sed -n '/chg/{x;1!p;g;p;n;p;};h' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '$!N;s/\n/ /' | sed '$!N;s/\n/ /' | sed 's/^/S\&P 500 /g' | sed '$!d'
curl http://www.google.ca/finance?q=INDEXNASDAQ:.IXIC | sed -n '/chg/{x;1!p;g;p;n;p;};h' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '$!N;s/\n/ /' | sed '$!N;s/\n/ /' | sed 's/^/NASDAQ /g' | sed '$!d'
with some experimenting i came up with this
Quote by itself:
Code:curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | cut -d - -f 1
Author by itself:
Code:curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/.*\(-\)/-/'
If anyone can figure out how to keep the quote and author together that would be nice but this method has it's formatting advantages too.
![]()
EDIT:
Here is the code for the quote all on one line but I can't figure out how to add a line break for the "-author's name"
Code:curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'
So, what exactly would be the shell command to retrieve the information displayed here:
![]()
Either as one command or four separate ones. (Prefer one command with line breaks if possible or no line breaks.)
That's the only command I want. I don't need to know the top info like current app using the most processor, or even the processor usage. Just RAM usage. Free, Wired, Active and Inactive.
I would only be calling it every 5-10 minutes or so just to keep processor usage down. (I only call my weather scripts every 900 seconds -- 15 minutes)
top -ocpu -l1 | grep 'PhysMem' | sed 's/PhysMem: *//'
Attempt # 2
Thanks for the codes everyone![]()
nice setup! can i get your horizontal calendar script. mine seem to all be messed up since it turned august.
There you go. Also at post 730.cal | sed -e '1d' -e '2p;2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/././g') /"
There you go. Also at post 730.