[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pipes & ExecResult/ReturnsZero
From: |
Mark . Burgess |
Subject: |
Re: Pipes & ExecResult/ReturnsZero |
Date: |
Wed, 30 Nov 2005 07:54:26 +0100 (MET) |
User-agent: |
SquirrelMail/1.4.4 |
> Is it expected that pipe characters will continue to work in ExecResult
> even though they no longer work in ReturnsZero? ExecResult still honors
> pipe characters inside double-quotes, while ReturnsZero only honors them
> inside single quotes.
>
> localdate = ( ExecResult(/bin/sh -c "/bin/date | grep 2005") )
>
> Whereas ReturnsZero requires opposite quoting to work with pipes
> properly:
> ResolvesX = ( ReturnsZero(/bin/sh -c 'nslookup "some.example.com" 2>&1
> | grep 169.254.1.1 >/dev/null') )
>
> It seems inconsistent to make these two functions require opposite
> quoting. Was this intended, or will there be a ShellCommandExecResult in
> the future?
>
> Thank you,
> -Jason Martin
>
>
The quopting is the same, but neither of the fnuctions uses a shell. I
made an ExecShellResult function for convenience. We could do the same for
RetrunsZero is necessary. The quoting I recommend however (latest patchr
eleases) is to always have quotes around the shell string and to backslash
quptes inside them
Func("/bin/sh -c \"my string\"")
M