Ok, i current have:
#!/bin/sh
news_path=/home/sites/home/users/admin/web/news
# Get IT reseller XML news feed
(lynx -source http://www.cw360asp.com/News_Feeds/Extraction.asp?feed=Reseller_B\
reaking_and_Daily_News_xml&site=Midwich) > ${news_path}/resellernews.tmp
# Get User XML news feed
(lynx -source http://www.cw360asp.com/News_Feeds/Extraction.asp?feed=User_Break\
ing_and_Daily_News_xml&site=Midwich) > ${news_path}/breakingnews.tmp
sed -e 's/&/&/g' < ${news_path}/resellernews.tmp > ${news_path}/resellernew\
s.xml
sed -e 's/&/&/g' < ${news_path}/breakingnews.tmp > ${news_path}/breakingnew\
s.xml
rm ${news_path}/*.tmp
any help, greatly appreciate, cheers,
Nick
> >Thanks for your help guys. I've tried the sed command and it works
> >fine - from the command prompt... When i place it into a script the
> >'new' file is created, but with no data.
> Without seeing exect (cut and paste, not retyped) copies of the your
> scripts it is somewhat difficult to determine what you have.
> >To get my head around where the problem is, i now have 2 scripts, one
> >retrieves the xml data (via lynx) and simply dumps the output to file.
> >a second script then runs the sed/awk command. when i run these
> >scripts independently of each other, i.e. from the command prompt with
> >a pause of ~10 seconds, i have no problems, when i call the second
> >script form the first (in a feeble attempt at automation...) the .xml
> >files have 0 bytes of data...
> >Is there a 'sleep' method that i can call to halt the processing for
> >2-3 seconds before running the sed/awk command??
> >Note: The script will run on a Sun Cobalt Linux 2.2 box (i believe its
> >a sun tailored distro...)
> >thanks for your help on this matter, Nick
> >> I've developed the following script which is meant to retrieve xml
> >> data from a webpage, but i need any '&' to be changed to '&'. I'm
> >> running this through an awk command but the output either never gets
> >> written to the file (i.e. the file is created and is blank) or the
> >> file never gets created.
> >> any help would be greatly appreciated (for starters, is the awk
> >> command correct??)
> >> Thanks, Nick
> >> ************************************************************************
> >> #!/bin/sh
> >> # Get IT reseller XML news feed
> >> (lynx -source http://www.cw360asp.com/News_Feeds/Extraction.asp?feed=Reseller_Break...)
> >> > resellernews.tmp
> >> # Change all of the & characters to read as &, this will stop the
> >> XML parsing routines from falling over
> >> awk '{ gsub(/&/, "&"); print $0 > "resellernews.xml"}'
> >> resellernews.tmp
> >> # destroy .tmp and .new files (we only need the .xml and .old files)
> >> rm resellernews.tmp