I set in cmd variable the find syntax: , I use ksh shell/bash
# cmd=" find /usr/cti/conf -name \"*.tgz*\" "
# echo $cmd
find /usr/cti/conf/ -name "*.tgz*"
so why when I want to run the cmd as the following I not actually activate the find ...
# exec $cmd
appserver1a:/var/tmp/ ROOT # ( this exit from the shell )
it's also not works when I run with double brackets
exec "$cmd"
ksh: find /usr/cti/conf/backup -name "*.tgz*" : not found
what is the resolution for this?
Remark I not want to set the cmd like this ( this is works )
cmd=` find /usr/cti/conf/backup -name "*.tgz*" `
or
cmd=$( find /usr/cti/conf/backup -name "*.tgz*" )
Both solutions - the one provided below and the one posted by Eugeniu Rosca - seem to work for me.
cmd="find /usr/cti/conf/backup -name \"*.tgz*\""
exec $cmd
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.