Solved

unix parameters

Posted on 2009-03-31
5
234 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

757 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

18 Experts available now in Live!

Get 1:1 Help Now