Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
HELP!crontab script displays output differently than command line
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="spankincubus" data-source="post: 1365761" data-attributes="member: 236934"><p>hey guys, I was working on setting up a geeklet for my facebook news feeds.</p><p></p><p>heres what i am doing</p><p></p><p><strong>1. I am running a script from crontab every five min.</strong></p><p><strong>heres the script. all im doing is removing html tags and tabs from the output of curl.</strong></p><p></p><p>localhost:geeklets root# cat extrct_fb.sh</p><p>#!/bin/ksh</p><p></p><p>GEEKHOME=/Users/spankincubus/Documents/geeklets</p><p>FBLOG=${GEEKHOME}/sajal.txt</p><p></p><p><strong>curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c6472419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/^I//g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s > ${FBLOG}</strong></p><p><strong></strong></p><p>if [[ $? -eq 0 ]]; then</p><p>echo "FB logs written!"</p><p>else</p><p>exit 1</p><p>fi</p><p></p><p><strong>The output of this script has no spaces between words:</strong></p><p>localhost:geeklets root# cat sajal.txt</p><p></p><p>1RajeshKumar</p><p>AgneepathEffect♥</p><p></p><p></p><p>Beta:Mandwa<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big grin :D" loading="lazy" data-shortname=":D" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick out tongue :p" loading="lazy" data-shortname=":p" /></p><p></p><p>AlexisMcDaniel</p><p>Howaboutbeforewegetwastedtonight,wegetwastedtonight?Pregame.</p><p></p><p>AshwathGowdaDanihalli</p><p>PartyingWithMadhu,Harish,pavaninMalleswaram,Banglore</p><p></p><p>Mashable</p><p>WhichChromepluginswouldyourecommend?</p><p></p><p>Domino'sPizza</p><p>Here’sasecrettoawinningpartyonSunday<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick out tongue :p" loading="lazy" data-shortname=":p" />laceaDomino’spre-orderTODAY!</p><p></p><p></p><p></p><p><strong>BUT</strong></p><p><strong></strong></p><p><strong>when i run the curl command from the command line the output(in italics) is flawless (spaces betn words are intact):</strong></p><p></p><p>localhost:geeklets root# curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c647612419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/ //g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s </p><p><em><strong></strong></em></p><p><em><strong>1Ashwath Gowda Danihalli</strong></em></p><p><em><strong>Partying With Madhu , Harish , pavan in Malleswaram,Banglore</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Mashable</strong></em></p><p><em><strong>Which Chrome plugins would you recommend?</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Domino's Pizza</strong></em></p><p><em><strong>Here’s a secret to a winning party on Sunday: place a Domino’s pre-order TODAY!</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Best Buy</strong></em></p><p><em><strong>Take the hassle out of moving your data from your old PC to that shiny new lapto</strong></em></p><p><em><strong>p.</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Mashable</strong></em></p><p><em><strong>Will you be watching the streaming version of Super Bowl XLVI online?</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Sierra Mist</strong></em></p><p><em><strong>Superbowl party tomorrow? Try out these festive cocktails for a perfect way to w</strong></em></p><p><em><strong>ash down those game day snacks!</strong></em></p><p><em><strong></strong></em></p><p><em><strong>Best Buy</strong></em></p><p><em><strong>Thank You to Dreams Come True for choosing Best Buy to fulfill Zowanda's wish fo</strong></em></p><p><em><strong>r electronics!</strong></em></p><p><em><strong></strong></em></p><p></p><p><strong>How can i get the same output from cronning script !</strong></p></blockquote><p></p>
[QUOTE="spankincubus, post: 1365761, member: 236934"] hey guys, I was working on setting up a geeklet for my facebook news feeds. heres what i am doing [B]1. I am running a script from crontab every five min. heres the script. all im doing is removing html tags and tabs from the output of curl.[/B] localhost:geeklets root# cat extrct_fb.sh #!/bin/ksh GEEKHOME=/Users/spankincubus/Documents/geeklets FBLOG=${GEEKHOME}/sajal.txt [B]curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c6472419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/^I//g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s > ${FBLOG} [/B] if [[ $? -eq 0 ]]; then echo "FB logs written!" else exit 1 fi [B]The output of this script has no spaces between words:[/B] localhost:geeklets root# cat sajal.txt 1RajeshKumar AgneepathEffect♥ Beta:Mandwa:D:P AlexisMcDaniel Howaboutbeforewegetwastedtonight,wegetwastedtonight?Pregame. AshwathGowdaDanihalli PartyingWithMadhu,Harish,pavaninMalleswaram,Banglore Mashable WhichChromepluginswouldyourecommend? Domino'sPizza Here’sasecrettoawinningpartyonSunday:placeaDomino’spre-orderTODAY! [B]BUT when i run the curl command from the command line the output(in italics) is flawless (spaces betn words are intact):[/B] localhost:geeklets root# curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c647612419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/ //g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s [I][B] 1Ashwath Gowda Danihalli Partying With Madhu , Harish , pavan in Malleswaram,Banglore Mashable Which Chrome plugins would you recommend? Domino's Pizza Here’s a secret to a winning party on Sunday: place a Domino’s pre-order TODAY! Best Buy Take the hassle out of moving your data from your old PC to that shiny new lapto p. Mashable Will you be watching the streaming version of Super Bowl XLVI online? Sierra Mist Superbowl party tomorrow? Try out these festive cocktails for a perfect way to w ash down those game day snacks! Best Buy Thank You to Dreams Come True for choosing Best Buy to fulfill Zowanda's wish fo r electronics! [/B][/I] [B]How can i get the same output from cronning script ![/B] [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
HELP!crontab script displays output differently than command line
Top