From msz at astrouw.edu.pl Tue Mar 31 14:16:18 2009 From: msz at astrouw.edu.pl (Michal Szymanski) Date: Tue, 31 Mar 2009 13:16:18 +0200 Subject: passing dollar-sign to remote tcsh? Message-ID: <20090331111618.GA3653@astrouw.edu.pl> Hello, To find all local files with extension 'ext', one could issue, at least on Linux, locate -r '\.ext$' Now, is it possible to pass such a command to a remote tcsh? All attempts like: rsh remhost locate -r '\.ext$' rsh remhost "locate -r '\.ext$'" etc., with all possible combinations of backslashes, single and double quotes, fail, either just hanging (as the first form, with no additional quoting characters) or giving error messages like Variable name must contain alphanumeric characters. Illegal variable name. So, more generally: is it possible to pass a dollar-sign to a remote tcsh when this $ is not supposed to start a variable reference? regards, Michal. -- Michal Szymanski (msz at astrouw dot edu dot pl) Warsaw University Observatory, Warszawa, POLAND From christos at zoulas.com Tue Mar 31 15:52:44 2009 From: christos at zoulas.com (Christos Zoulas) Date: Tue, 31 Mar 2009 08:52:44 -0400 Subject: passing dollar-sign to remote tcsh? In-Reply-To: <20090331111618.GA3653@astrouw.edu.pl> from Michal Szymanski (Mar 31, 1:16pm) Message-ID: <20090331125244.A334156550@rebar.astron.com> On Mar 31, 1:16pm, msz at astrouw.edu.pl (Michal Szymanski) wrote: -- Subject: passing dollar-sign to remote tcsh? | Hello, | | To find all local files with extension 'ext', one could issue, at least | on Linux, | | locate -r '\.ext$' | | Now, is it possible to pass such a command to a remote tcsh? | All attempts like: | | rsh remhost locate -r '\.ext$' | rsh remhost "locate -r '\.ext$'" | etc., with all possible combinations of backslashes, single and double quotes, | | fail, either just hanging (as the first form, with no additional quoting | characters) or giving error messages like | Variable name must contain alphanumeric characters. | Illegal variable name. | | So, more generally: is it possible to pass a dollar-sign to a remote | tcsh when this $ is not supposed to start a variable reference? rsh remhost locate -r \'\\.ext\$\' christos From msz at astrouw.edu.pl Tue Mar 31 23:16:27 2009 From: msz at astrouw.edu.pl (Michal Szymanski) Date: Tue, 31 Mar 2009 22:16:27 +0200 Subject: passing dollar-sign to remote tcsh? In-Reply-To: <20090331125244.A334156550@rebar.astron.com> References: <20090331111618.GA3653@astrouw.edu.pl> <20090331125244.A334156550@rebar.astron.com> Message-ID: <20090331201627.GB1484@astrouw.edu.pl> On Tue, Mar 31, 2009 at 08:52:44AM -0400, Christos Zoulas wrote: > On Mar 31, 1:16pm, msz at astrouw.edu.pl (Michal Szymanski) wrote: > -- Subject: passing dollar-sign to remote tcsh? > > | Hello, > | > | To find all local files with extension 'ext', one could issue, at least > | on Linux, > | > | locate -r '\.ext$' > | > | Now, is it possible to pass such a command to a remote tcsh? > | All attempts like: > | > | rsh remhost locate -r '\.ext$' > | rsh remhost "locate -r '\.ext$'" > | etc., with all possible combinations of backslashes, single and double quotes, > | > | fail, either just hanging (as the first form, with no additional quoting > | characters) or giving error messages like > | Variable name must contain alphanumeric characters. > | Illegal variable name. > | > | So, more generally: is it possible to pass a dollar-sign to a remote > | tcsh when this $ is not supposed to start a variable reference? > > rsh remhost locate -r \'\\.ext\$\' Impressive :) Thanks, Christos. Am I right to think that the idea is to prevent the local shell from quoting, by adding backslashes to the surrounding apostrophes? Michal. -- Michal Szymanski (msz at astrouw dot edu dot pl) Warsaw University Observatory, Warszawa, POLAND