Solved

unix parameters

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

810 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