Cut Text from Webpage - Weather
Howdy
I have a script that works well with retreiving weather information from a webpage. If then tailors it to how I want it then spits it out as email. I have the script working under CentOS, however I have just converted it over to Debian The script works all the way up until it is required to "cut" information obtained and place it into a file for editing. ************************* FROM SCRIPT ****************** echo "Location supplied = "$place echo "------------------------------------" interest=0 while read line; do # loop to step through pages pagenumber=`echo $line | cut -b 0-8` pagename=`echo $line | cut -b 11-` echo "Scanning -----> "$pagenumber" <----- " ************************************************************** It gets to the "cut" section and spits out" cut: fields and positions are numbers from 1 Try `cut --help' for more information I am sure there is a simple answer for this, however I am puzzled as to why it falters on this "cut" command - when it was working so well under CentOS Many thanks for reading this. |
Hi
This line is buggy: Quote:
http://linux.die.net/man/1/cut It doesn't say what should happen if the numbers are incorrect. My guess is that some other versions of cut simply ignores it, and uses 1 instead, while others give an error message. Try changing the line to this: Quote:
|
Thanks for the short and swift answer! Funny how some of these things you keep looking at and it is staring you right in the face!
Appreciated |
All times are GMT -5. The time now is 03:06 AM. |