Embedded quotes in shell command. HELP!!
sergei.sheinin_at_db.com
Date: 09/13/05
- Next message: Richard Bos: "Re: fgets and EOF in Bash"
- Previous message: Umberto: "Re: fgets and EOF in Bash"
- Next in thread: sergei.sheinin_at_db.com: "Re: Embedded quotes in shell command. HELP!!"
- Reply: sergei.sheinin_at_db.com: "Re: Embedded quotes in shell command. HELP!!"
- Reply: Chris F.A. Johnson: "Re: Embedded quotes in shell command. HELP!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Sep 2005 07:40:20 -0700
Hello, All!
I'm having a problem where a Perl script needs to launch a command in
the following format (which doesn't work now):
ssh appserv1 -l appadmin 'find /app2/files/*.txt-* -mtime -1 | grep -v
'Z$' | cut -d . -f 1'
As you can see, what this command does is logs on to server appserv1,
pulls *.txt* files from directory /app2/files/ that are not older than
one day, filters the results with grep command so that entries for
files ending with letter Z are not retrieved, and uses cut command to
remove file extensions.
My problem is with nested single-quotes, as the grep command requires
the pattern to be single-quoted. But in this case the entire command
following ssh appserv1 -l appadmin must be single quoted as well (or am
I missing something?).
Is there a way to escape the inner single quotes in this command, cuz
otherwise I'll have to write a separate Perl routine for filtering the
entries ending with letter Z, in which case I can remove the grep
command from the statement.
Thanks for your help,
Endorphin.
- Next message: Richard Bos: "Re: fgets and EOF in Bash"
- Previous message: Umberto: "Re: fgets and EOF in Bash"
- Next in thread: sergei.sheinin_at_db.com: "Re: Embedded quotes in shell command. HELP!!"
- Reply: sergei.sheinin_at_db.com: "Re: Embedded quotes in shell command. HELP!!"
- Reply: Chris F.A. Johnson: "Re: Embedded quotes in shell command. HELP!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|