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: 1365826" data-attributes="member: 236934"><p>thanks guys.. im stupid.. it was indeed the tr and sed.. i copied and pasted the code. and the ^I(tabs) got transformed to single spaces. </p><p></p><p>Silly of me. Sorry to waste you guys time..</p><p></p><p>its working perfectly now.</p><p></p><p>However i was thinking of refining it some more. i was thinking of making the output of the txt scrollable ie. print lines 0-10, then 11-21 ,.. and so on .. until end of file is reached. </p><p>the code is working on command line (see below) but when i call the script in the geektool, it doesnt show anything. any recommendations?</p><p></p><p>CODE</p><p></p><p>localhost:geeklets root# cat scroll.sh</p><p>#!/bin/ksh</p><p></p><p>typeset -i start=1</p><p>end=`wc -l test.txt|awk -F" " '{print $1}'`</p><p>typeset -i end1=$start+10</p><p>echo $start $end $end1</p><p></p><p>while [[ $start -lt $end ]]; do</p><p>clear</p><p>str="'${start},${end1}p' test.txt"</p><p>echo "sed -n $str"|/bin/ksh</p><p>start=${start}+1</p><p>end1=${end1}+1</p><p>sleep 1</p><p>done</p></blockquote><p></p>
[QUOTE="spankincubus, post: 1365826, member: 236934"] thanks guys.. im stupid.. it was indeed the tr and sed.. i copied and pasted the code. and the ^I(tabs) got transformed to single spaces. Silly of me. Sorry to waste you guys time.. its working perfectly now. However i was thinking of refining it some more. i was thinking of making the output of the txt scrollable ie. print lines 0-10, then 11-21 ,.. and so on .. until end of file is reached. the code is working on command line (see below) but when i call the script in the geektool, it doesnt show anything. any recommendations? CODE localhost:geeklets root# cat scroll.sh #!/bin/ksh typeset -i start=1 end=`wc -l test.txt|awk -F" " '{print $1}'` typeset -i end1=$start+10 echo $start $end $end1 while [[ $start -lt $end ]]; do clear str="'${start},${end1}p' test.txt" echo "sed -n $str"|/bin/ksh start=${start}+1 end1=${end1}+1 sleep 1 done [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
HELP!crontab script displays output differently than command line
Top