Having single or double quotes in a custom variable
Marc Powell
lists at xodus.org
Mon Sep 6 15:32:12 CEST 2010
On Sep 6, 2010, at 6:57 AM, Jelle Smet wrote:
> _blah "one two three four" a b c d
>
> I want to use this custom variable in a command to execute like this:
>
> define command{
>
> command_name check_linux_nrpe_all_disks
>
> command_line /bin/echo $_HOSTBLAH$ > /tmp/fubar.txt
>
> }
>
>
> In /tmp/fubar.txt I have this line of text without the quotes:
> one two three fou a b c d
That's what 'echo "one two three four" a b c d > /tmp/fubar.txt' does on the command line --
$ echo "one two three four" a b c d > /tmp/fubar.txt
$ cat /tmp/fubar.txt
one two three four a b c d
> How can I keep the quotes? They can be single or double quotes it doesn't matter.
command_line /bin/echo '$_HOSTBLAH$' > /tmp/fubar.txt
$ echo '"one two three four" a b c d' > /tmp/fubar.txt
$ cat /tmp/fubar.txt
"one two three four" a b c d
--
Marc
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list