Results 1 to 7 of 7
Hi friends,
I am new to linux and shell scripting. I need some help from you guys.
Daily i need to check group of URLs and there https requests from ...
- 05-29-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 5
How to iterate the content of a file in the shell script
Hi friends,
I am new to linux and shell scripting. I need some help from you guys.
Daily i need to check group of URLs and there https requests from browser. Recently i got some command line web browsers to know the HTTPS status of the URL like curl, wget etc... Now all of i need to do is write a shell script. I will put all my URLs in a text file and my shell script should read each URL one by one and log the status along with the corresponding URL.
Sample output:
./myscript.sh url.txt
1. site - 200 OK
Thanks in advance.
- 05-29-2010 #2Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 452
this will do the iteration
for i in `cat URL.txt`
do
foo $i
done
now all you have to do is write foothe sun is new every day (heraclitus)
- 05-29-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 5
How about to log the output into a file instead of standard output. How to name that log file with date and time stamp and also can i give the location where to save the log file? if so can you gimme the sample script? it would be verify helpful.
- 05-29-2010 #4
srikanth007m - I hope you are interested in learning shell script.Google "bash shell redirection" -- should give you tons of links.
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-31-2010 #5Just Joined!
- Join Date
- May 2010
- Posts
- 5
Thanks Lakshmipathi for your suggestion.
- 05-31-2010 #6
Excellent resource to learn bash , Advanced Bash-Scripting Guide
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-31-2010 #7Just Joined!
- Join Date
- May 2010
- Posts
- 5
Yesm i too found the same one while googline and at last i am able to wirte the script what i need exactly.
Thanks one and all for great suggestions


Reply With Quote