|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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'` (I had to use the above to make my life a little easier as the quotes were causing me more problems.) since the \( is present rsh doesnt send it with the escape properly and it doesnt give the result. I tried enclosing with '' and also trying to escape with a \ and didnt work. Is this possible at all? or am I missing something. Any is greatly appreciated. Thanks, Dharma. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|