aspire
1
Hi
I have some problems with "FOR"...
I have a text file in this format:
name1
www.link1/random_number
name2
www.link2/random_number
name3
www.link3/random_number
...
(Names and info changes)
Now, I need:
For each link found download the related page.
So:
- For each link
- execute command wget -options www.link/url_variable | (sed commands to find info)
- for each result insert the result under the right name.
I made a sed command for obtain info that I need from the page.
So this is not a problem.
The result should be like this:
name1
some info found in www.link1/random_number
name2
other info find in www.link2/random_number
name2
other info find in www.link3/random_number
thanks in advance
That's not surprising. The shell does not have a command named "FOR". It does have "for".
Why would you use "for" to read a file?
while read name; read line
do
printf "%s\n" "$name"
wget -O - [other options] "$line" | sed ...
echo
done < "$FILE"
aspire
3
You are right @cfajohnson!!!
"WHILE" time!
Thank you!
Best Regards!
aspire
4
So... a little help...
while read name; read line
do
printf "%s\n" "$name"
wget -O - [other options] "$line" | sed ...
echo
done < "$FILE"
How can view this output inside zenity?