PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > how to escape \ in rsh
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

how to escape \ in rsh

Réponse
 
LinkBack Outils de la discussion
Vieux 16/05/2007, 21h25   #1
dharma
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to escape \ in rsh

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.

  Réponse avec citation
Vieux 17/05/2007, 15h46   #2
maaz@cox.net
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to escape \ in rsh

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.

  Réponse avec citation
Vieux 18/05/2007, 19h26   #3
dharma
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h13.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09094 seconds with 11 queries