Re: how to escape \ in rsh
On May 17, 7:46 am, m...@cox.net wrote:
> On May 16, 1:25 pm, dharma <ajdharma...@gmail.com> wrote:
>
> > Hello
>
> > I am trying to use find in rsh like this
>
> > rsh svr-app1 find /export/home/ \( -name "a*${curdate}.dat" -o -name
> > "a*${curdatey}.dat" \) -print
>
> > where
>
> > curdate=`date '+%m%d%y'`
> > curdatey=`date '+%m%d%Y'`
>
> Are you defining $curdate and $curdatey and then running your rsh
> command? If so, are you sure the variables are being expanded before
> the rsh is executed? If the command is being passed as-is to your
> remote server, the variables are undefined on the server which will
> prevent you from getting the desired results. Try adding your
> definitions for $curdate and $curdatey into your rsh command before
> your find command. Wrap all three in single quotes.
>
> If you can, use ssh as opposed to rsh.
Thanks for the reply. I fixed the problem. As you said the variables
were not being passed as it was all under single quote ( I found them
using sh -x)so I had to split the single quotes up and it worked. I am
not sure if this is the right way, but it works for me.
rsh svr-app1 find /export/home/ '\(' -name "a*${curdate}*" -o -name
"a*${curdatey}*" '\)' -print
|