Solved

unix parameters

Posted on 2009-03-31
5
244 Views
Last Modified: 2012-05-06
my main script runs script2 whichreturns:
    typA
    typO
    typC
how can I now pipe this output so that script3 can now be called with them passed as parameters, like so:
script3 typA typO typC
0
Comment
Question by:NewtonianB
5 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 400 total points
ID: 24035703
script3 `script2`
0
 

Author Comment

by:NewtonianB
ID: 24035797
one quick clarification, my script 2 is actually a unix command that I run from within my main script, i put it this way to reduce complexity
but regardless for testing this I actually put this command in script2.sh but it seems script2 was being fed as a string and not executing (i'm running this in macosx 10.5.6 terminal)

should I concatenate each line of script2 output and the command at the front then do an eval? how else would you do it, efficiency is my priority
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 100 total points
ID: 24036144
did you use ` ` quotes as omafarid specified,
or did you instead try to type ' ' quotes when you tried it?
0
 

Author Closing Comment

by:NewtonianB
ID: 31565137
great!!!!
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24036706
That's one of the reasons why I prefer using $(cmd) instead of `cmd` !
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error while installing rpm 1 77
how to monitor remote shell execution on linux 9 97
unix scripting question 1 89
NTP Server in VMware 5 164
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now