bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing variables to and from custom programs


From: DennisW
Subject: Re: Passing variables to and from custom programs
Date: Sat, 6 Feb 2010 17:35:21 -0800 (PST)
User-agent: G2/1.0

On Feb 6, 5:37 pm, djackn <address@hidden> wrote:
> May I used the following in a bash script to pass variables to myIpExec?
>
>     Result = myIpExec(${IPaddr1} ${IPaddr2} ${IPaddr3} ${IPaddr4})
>
> myIpExec is a c program that normally uses scanf to prompt the user
> for the IP addresses and returns 0 or 1.
> I plan to use the script to test the program for various inputs.
> --
> View this message in 
> context:http://old.nabble.com/Passing-variables-to-and-from-custom-programs-t...
> Sent from the Gnu - Bash mailing list archive at Nabble.com.

It is more likely that this would work:

Result=$(echo "{IPaddr1} ${IPaddr2} ${IPaddr3} ${IPaddr4}" | myIpExec)

Note that there are no spaces around the equal sign.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]