LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2015, 02:40 AM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
bash script, pipe and parameters


lets say I have 'generic.sh' script like this:

Code:
#!/bin/bash
more $1
echo $2 $3 $4
exit
and start it with:

Code:
echo "testdata" | ./generic.sh 'value2' 'value3' 'value4'
but, it doesn't display:
testdata value2 value3 value4

Last edited by qrange; 09-10-2015 at 02:50 AM.
 
Old 09-10-2015, 03:43 AM   #2
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Original Poster
Rep: Reputation: 47
I think I've solved it, pipe is the last argument, not first.
 
  


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
[SOLVED] bash script parameters and logic asistant Programming 17 04-19-2012 07:39 AM
[SOLVED] bash script sed -r -i and -e parameters charu Programming 10 05-06-2011 06:28 AM
Bash script and chroot with a pipe Luminoth Programming 6 09-19-2007 01:01 PM
Passing parameters to bash script Kamikazee Programming 4 10-01-2005 06:41 AM
Passing Parameters to Bash Script mooreted Linux - Software 3 04-05-2004 09:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration