|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
||||
|
||||
|
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" -or- 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 FINDIT=${list} 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? Thanks, -zedmelon
__________________
Mother says my .sig can beat up your .sig. |
|
#2
|
||||
|
||||
|
depressing update...
I thought I'd found the answer in a post by M.Hirsch on this page here:
http://forums.devshed.com/t74294/s.html RESULT=`echo -e "$FINDIT"` only puts this into the variable $RESULT: "-e $FINDIT" :( slash me grows despondent... |
|
#3
|
|||
|
|||
|
RESULT=`eval $FINDIT`
![]()
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#4
|
||||
|
||||
|
THANKS!
M.Hirsch...
That worked on the command line. I'm betting it'll work in the script as well. Of course, this is monitoring a process that runs 1/week, so I'll confirm next Tuesday... :( Thanks again; I appreciate the help. -zedmelon |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > executing variables in ksh script? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|