LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   wget is creating file for each execution (https://www.linuxquestions.org/questions/linux-newbie-8/wget-is-creating-file-for-each-execution-847701/)

vikram.lingampalli 12-01-2010 08:55 AM

wget is creating file for each execution
 
Hi,

I am calling a service using http post through wget, the command is successfully executing but for each execution its creating a file and saving variable names n data n it.

I want to execute this command without creation of a file.

Would anyone suggest me what needs to be done in this regard.


My command:


wget --post-data 'var1=99&var2=200' \http://xyz.example.com:5555/invoke/Samples:httpInvoke


For every execution, its creating the files with names:

Samples:httpInvoke1
Samples:httpInvoke2
Samples:httpInvoke3
.
.
.
.
Result of execution:
wget --post-data 'var1=99&var2=200' \http://xyz.example.com:5555/invoke/Samples:httpInvoke
--15:56:45-- http://xyz.example.com:5555/invoke/Samples:httpInvoke
Resolving xyz.example.com... 165.12.10.91
Connecting to yz.example.com|165.12.10.91|:5555... connected.
HTTP request sent, awaiting response... 200 OK
Length: 276 [text/html]
Saving to: `Samples:httpInvoke'

100%[=======================================>] 276 --.-K/s in 0s

15:56:45 (52.6 MB/s) - `Samples:httpInvoke' saved [276/276]



Regards,
Vikram

TB0ne 12-01-2010 09:03 AM

Quote:

Originally Posted by vikram.lingampalli (Post 4177089)
Hi,

I am calling a service using http post through wget, the command is successfully executing but for each execution its creating a file and saving variable names n data n it. I want to execute this command without creation of a file. Would anyone suggest me what needs to be done in this regard.

My command:
wget --post-data 'var1=99&var2=200' \http://xyz.example.com:5555/invoke/Samples:httpInvoke

For every execution, its creating the files with names:
Samples:httpInvoke1
Samples:httpInvoke2
Samples:httpInvoke3

Result of execution:
wget --post-data 'var1=99&var2=200' \http://xyz.example.com:5555/invoke/Samples:httpInvoke
--15:56:45-- http://xyz.example.com:5555/invoke/Samples:httpInvoke
Resolving xyz.example.com... 165.12.10.91
Connecting to yz.example.com|165.12.10.91|:5555... connected.
HTTP request sent, awaiting response... 200 OK
Length: 276 [text/html]
Saving to: `Samples:httpInvoke'

100%[=======================================>] 276 --.-K/s in 0s
15:56:45 (52.6 MB/s) - `Samples:httpInvoke' saved [276/276]

Read the man page on wget. You can try to redirect the output to /dev/null with the -o option, or to a single-file with an append, so you'll get just ONE file for all the posts.


All times are GMT -5. The time now is 12:44 AM.