I've been searching these forums for a while, but this is my first actual post, so please bear with me
I'm writing a short script using ksh and am trying to store a command and parameters in a variable. My intention is to issue the command by calling the variable. The command will contain double quotes. My problem is that for some reason there's no output.
Here's a simplified view of what I'm trying to accomplish (find command is used just as an example of the problem):
#!/usr/bin/ksh
cmd="find . -name \"55*\""
echo $cmd
$cmd
The only output is what I echo'ed:
# ./problem.sh
find . -name "55*"
If I issue the same command outside of the script, I get the desired result:
# find . -name "55*"
./55_messages.txt
Is is possible to store a command+parameters in a variable and run the command through the variable?
Thanks,
Hubert