Re: Need refinement to minimal-bash-script
- From: "s. keeling" <keeling@xxxxxxxxxxx>
- Date: Sun, 30 Dec 2007 15:04:20 +0100 (CET)
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.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
.
- Follow-Ups:
- Re: Need refinement to minimal-bash-script
- From: Allodoxaphobia
- Re: Need refinement to minimal-bash-script
- References:
- Need refinement to minimal-bash-script
- From: problems
- Need refinement to minimal-bash-script
- Prev by Date: Need refinement to minimal-bash-script
- Next by Date: 2008 new year, 2008 Good news www.clothserver-yhnetstore.cn
- Previous by thread: Need refinement to minimal-bash-script
- Next by thread: Re: Need refinement to minimal-bash-script
- Index(es):
Relevant Pages
|