LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-20-2009, 07:23 AM   #1
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 135

Rep: Reputation: 18
How to pipe output to another command parameter?


Hi,

How do I render the output of one command to another.

Example, calling a webservice to login:
# wget localhost/login.php --post-string="userid=1&password=SECRET1"

But now I want to change 'SECRET1' to output from another program like...
# echo "SECRET2" | wget localhost/login.php --post-string="userid=1&password=SECRET1"

Where I am trying to now call the webservice form the 'echo' commands output which is 'SECRET2' and not 'SECRET1'.
 
Old 07-20-2009, 07:32 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,136

Rep: Reputation: 230Reputation: 230Reputation: 230
Maybe:

wget localhost/login.php --post-string="userid=1&password=$(echo SECRET2)"
 
Old 07-20-2009, 07:44 AM   #3
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 135

Original Poster
Rep: Reputation: 18
Works perfect, thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass pipe output to file command nickleus Linux - General 6 06-19-2008 06:18 AM
How can I pipe output of a command into arguments of a script HGeneAnthony Linux - General 3 12-26-2007 06:24 AM
Pipe output of command to php !!! ALInux Programming 7 12-30-2006 12:36 PM
how to pipe and parse output of a command learnfast Linux - Newbie 2 06-15-2005 04:55 AM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration