Re: Need refinement to minimal-bash-script
- From: Allodoxaphobia <bit-bucket@xxxxxxxxxx>
- Date: 30 Dec 2007 18:36:20 GMT
On Sun, 30 Dec 2007 15:04:20 +0100 (CET), s. keeling wrote:
problems@gmail <problems@gmail>:
With previous help from contributors to this group, I've got#
a script which reads the URLs from a file and dumps/appends
the [lynx] contents to a file, for reading off-line.
Here's the script-line which has been working well:
#!/bin/bash
for url in `cat NewsLst`; do lynx -dump "$url" >> accumNewsLst; done
So now I want to avoid having to add the URL as a header and
a "<><><>..." as a end-marker for each fetch which is appended to
the accumulating-file. Here's my failed attempt:
for url in `cat urls.txt`; do
echo "<><><><><>" >> accumulation;
"$url" >> accumulation;
echo " == blank line ==" >> accumulation;
lynx -dump "$url" >> accumulation; done
for url in `cat urls.txt`; do
echo >> accumulation # bare echo == newline
echo "$url" >> accumulation # added "echo"
echo >> accumulation
lynx -dump "$url" >> accumulation
echo >> accumulation
echo '<><><><><>' >> accumulation # single ticks.
done
BTW, bash also has printf, which may help consolidate the mess.
printf '\n%s\n' $url >> accumulation
replaces the first three echos.
Allow me to suggest adding "-nolist" to the lynx command.
Would seem to be applicable in the OP's case.
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>
.
- References:
- Need refinement to minimal-bash-script
- From: problems
- Re: Need refinement to minimal-bash-script
- From: s. keeling
- Need refinement to minimal-bash-script
- Prev by Date: new products
- Next by Date: hot sell nike jordan adidas puma prada dunk and so on
- Previous by thread: Re: Need refinement to minimal-bash-script
- Next by thread: 2008 new year, 2008 Good news www.clothserver-yhnetstore.cn
- Index(es):
Relevant Pages
|