Networker

Re: [Networker] nsradmin scripting

2009-11-09 19:44:12
Subject: Re: [Networker] nsradmin scripting
From: A Darren Dunham <ddunham AT TAOS DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Tue, 10 Nov 2009 00:42:58 +0000
On Tue, Nov 10, 2009 at 01:23:11PM +1300, Howie Jock wrote:
> You might need to escape the $ in your save set list,

Assuming the $ is literal in the saveset (like I think it is) and not a
shell variable, that's absolutely the problem.  The double-quote context
is going to try to replace it with the contents of that shell variable.

And the double-quoted context is coming from the <<EOF, not from the
additional double-quotes in the here doc.  Those aren't necessary.

$ cat /tmp/heredoc
cat - <<EOF
 "text with $dollarsign"
EOF
$ bash /tmp/heredoc
 "text with "

Instead you need to single-quote the initial token.

$ cat /tmp/heredoc
cat - <<'EOF'
 text with $dollarsign
EOF
$ bash /tmp/heredoc
 text with $dollarsign

-- 
Darren

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>