Operating System - HP-UX
1827810 Members
1823 Online
109969 Solutions
New Discussion

Function result inside a command line

 
SOLVED
Go to solution
Leo The Cat
Regular Advisor

Function result inside a command line

Hi

I'd like to pass a command line result to my command line.

Example with the date function.

export aa=date
myscript param1 param2 aa

But of course, this does not work because aa can't receive like this the date result !

How to do this trick ?

Regards
Den

3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Function result inside a command line

hi Den:

# aa=date
# echo "It is now" $($aa)
It is now Mon Aug 25 15:55:53 EDT 2008

Regards!

...JRF...
Tim Nelson
Honored Contributor

Re: Function result inside a command line

Not exactly sure what you are looking for..

export aa=`date`

myscript p1 p2 "$aa"
Leo The Cat
Regular Advisor

Re: Function result inside a command line

James solution is the solution !!!
Thanks JRF !