Hit multiple URL from a text file and store result in other test file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Hit multiple URL from a text file and store result in other test file
# 1  
Old 05-21-2013
Hit multiple URL from a text file and store result in other test file

Hi,

I have a problem where i have to hit multiple URL that are stored in a text file (input.txt) and save their output in different text file (output.txt) somewhat like :
cat input.txt
Code:
http://192.168.21.20:8080/PPUPS/international?NUmber=917875446856
http://192.168.21.20:8080/PPUPS/international?NUmber=918952342513
http://192.168.21.20:8080/PPUPS/international?NUmber=919898766231

Now output.txt should have the response of these URL like :
cat output.txt
Code:
SUCCESS
FAIL
SUCCESS


Last edited by Scott; 05-21-2013 at 04:29 AM.. Reason: Changed URL IP
# 2  
Old 05-21-2013
How are you hitting these URL individually via command line?
# 3  
Old 05-21-2013
Mukul,

You can go for curl or wget commands in order to open the URL and save the content.

Regards,
J
# 4  
Old 05-21-2013
@vidyadhar85 : I m using curl to hit the URL manually eg.
Code:
curl 'http://192.168.21.20:8080/PPUPS/international?NUmber=917875446856'

@scriptscript : Yes i can use any of the command but the problem is that i have more then 64000 url and hitting those one by one is not feasible, is there any way to automate the same.?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (3 Replies)
Discussion started by: csim_mohan
3 Replies

2. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (0 Replies)
Discussion started by: csim_mohan
0 Replies

3. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (0 Replies)
Discussion started by: csim_mohan
0 Replies

4. Shell Programming and Scripting

Text substitution & getting file name from url

hi, sorry if this seems trivial. i have a file url.txt which consists of a list of urls (it was supposed to be my wget -i file). however, since the server from which i am trying to download uses redirect, wget dows not remeber the filename of ther original url will save to a file name which is... (3 Replies)
Discussion started by: texttoolong
3 Replies

5. Shell Programming and Scripting

Search file for string and store last result to variable

Hi, I'm trying to search a text file for a string: "energy(sigma->0)=". To do so, I executed the grep command, which returned many matches, for example: energy without entropy = -112.16486170 energy(sigma->0) = -112.16520778 energy without entropy = -112.16488936 ... (5 Replies)
Discussion started by: gwr
5 Replies

6. Shell Programming and Scripting

Find diff bet 2 files and store result in another file

Hi I want to compare 2 files. The files have the same amount of rows and columns. So each line must be compare against the other and if one differs from the other, the result of both must be stored in a seperate file. I am doing this in awk. Here is my file1: Blocks... (2 Replies)
Discussion started by: ladyAnne
2 Replies

7. Shell Programming and Scripting

Shell Script to hit a url

Hi all, I have a php file that grabs xml, parses it and updates my db accordingly. I want to automate the execution of this process, rather than having to hit the url manually. I have been looking into using cron to execute a script to do this, however i'm not exactly sure what command i would... (1 Reply)
Discussion started by: restivz77
1 Replies

8. Shell Programming and Scripting

Prase a file and store and result to an array

Dear all, I have a file having the following formats: ThreadFail=Web1=1234 ThreadFail=Web2=2345 ThreadFail=Web3=12 ConnectionFail=DB1=11 ConnectionFail=DB2=22 The number of lines will be different from every time . How can I parse the file and store the result to an a array inside... (6 Replies)
Discussion started by: youareapkman
6 Replies

9. Shell Programming and Scripting

How to store query multiple result in shell script variable(Array)

:) Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable. like #!/bin/ksh v_shell_var=Hi here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array). Regards, Div (4 Replies)
Discussion started by: div_Neev
4 Replies

10. UNIX for Dummies Questions & Answers

Redirect the Time result to a test file

I need to store process runtime into a file, currently the command i use was: time ls >> abc.txt however, this command store the executed result of ls into the txt file but not the time command result. Anyone know how to store the "time ls" result? Please advise me! Thanks in advance :) (5 Replies)
Discussion started by: mistella
5 Replies
Login or Register to Ask a Question