search for: shellword

Displaying 6 results from an estimated 6 matches for "shellword".

Did you mean: shellwords
2012 Feb 14
4
How to escape exec command parameters?
If I have a "simple" variable value, this works fine: capmon@peter:~> puppet -e ''$v="xyz" exec { f: command => "/bin/echo v is $v", logoutput => true }'' notice: /Stage[main]//Exec[f]/returns: v is xyz notice: /Stage[main]//Exec[f]/returns: executed successfully But how do I escape "bad" values of $v? Painful examples like the
2016 Oct 20
5
-e escape rule
Hello, I'm using Ruby's Shellwords module, which generates a string from an array, suitable for shell evaluation. Ruby's implementation prefers escaping whitespace with a backslash rather than quotes. However, this appears to cause some kind of issue in Rsync when it computes argv from -e option. Here is an example command ge...
2016 Oct 30
2
-e escape rule
...the white-space sequence. It's okay.. But it's also a surprise that backslash escape sequences don't work according to intuition of how commands are normally executed. If you supplied the string in -e to system, it would work as expected.. Unfortunately, this is the default when using Shellwords.join in Ruby. So, I had to write a custom RSync "join" function to produce an appropriate command for -e argument. On 30 October 2016 at 04:49, Wayne Davison <wayned at samba.org> wrote: > On Sat, Oct 29, 2016 at 5:36 AM, Samuel Williams > <space.ship.traveller at gmail....
2016 Oct 20
0
-e escape rule
On 2016-10-20 10:24, Samuel Williams wrote: > Hello, > > I'm using Ruby's Shellwords module, which generates a string from an > array, suitable for shell evaluation. > > Ruby's implementation prefers escaping whitespace with a backslash > rather than quotes. However, this appears to cause some kind of issue > in Rsync when it computes argv from -e option. The m...
2016 Oct 21
2
-e escape rule
...he man page, I only saw the summary. Yes, that clearly explains how it's supposed to work. On 21 October 2016 at 01:46, Dave Howorth <dhoworth at mrc-lmb.cam.ac.uk> wrote: > On 2016-10-20 10:24, Samuel Williams wrote: >> >> Hello, >> >> I'm using Ruby's Shellwords module, which generates a string from an >> array, suitable for shell evaluation. >> >> Ruby's implementation prefers escaping whitespace with a backslash >> rather than quotes. However, this appears to cause some kind of issue >> in Rsync when it computes argv fr...
2016 Oct 29
2
-e escape rule
> The point is that the original escaping DOUBLE escapes an equals sign: > foo\\\=bar > It shouldn't, there's no reason to. If you paste into your command line: rsync -e ssh\ -l\ backup\ -i\ /etc/synco/id_rsa\ -o\ ConnectTimeout\\\=60\ -o\ BatchMode\\\=yes The list of arguments would be (i.e. the values in ARGV): ['rsync', '-e', 'ssh -l backup -i