August 6th, 2003, 02:53 AM
Join Date: Aug 2003
Location: under a rock
Time spent in forums: 11 h 20 m 42 sec
Reputation Power: 11
executing variables in ksh script?
In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments.
FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc"
FINDIT="ps -ef | grep oracle | grep prod | grep runback"
I want to have a way to execute the command list defined by the variable $FINDIT later in the script, putting the result in another variable. Any ideas how?
Things I have tried:
1. The straightforward RESULT=`$FINDIT`
(I get a usage on ps)
2. Putting the list in braces gives me bad substitution
3. exec is not on the system.
With either of the possible values of $FINDIT, if I execute them on the command line, there is no problem. What am I doing wrong?
Mother says my .sig can beat up your .sig.