Closed bobh0303 closed 3 years ago
Observed:
rrun touch "my file.txt"
creates two files: my and file.txt
my
file.txt
Expected:
It should create just one file called my file.txt
my file.txt
Attempts to fix
I thought the problem was in line 63: https://github.com/silnrsi/smith/blob/b7566e2fefe3ef3ac033d4c85ee7b2f57c4c1a56/contrib/rrun/rrun#L62-L63 where the $@ wants to be quoted to "$@"
$@
"$@"
However when I tried this I got inexplicable results:
$ rrun touch "my file.txt" /bin/sh: 3: touch my file.txt: not found
which is what I would have expected with "$*" (and indeed, that generates the same error).
"$*"
I've also tried bash's Q (quote feature):
${@@Q}
and while that seems to work, I can no longer put multiple commands on rrun. For example, with:
rrun smith clean \; smith build
the semicolon is passed as a parameter to smith rather than acting as a command separator.
I assume the underlying problem is that the $@ is within a heredoc and thus is subject to shell expansion twice, but I can't figure out a solution.
If a solution is found we can delete the "Known bugs" section of the README.
escaping the spaces within quoted parameters, e.g., rrun touch "my\ file.txt", is a workaround
rrun touch "my\ file.txt"
Observed:
creates two files:
my
andfile.txt
Expected:
It should create just one file called
my file.txt
Attempts to fix
I thought the problem was in line 63: https://github.com/silnrsi/smith/blob/b7566e2fefe3ef3ac033d4c85ee7b2f57c4c1a56/contrib/rrun/rrun#L62-L63 where the
$@
wants to be quoted to"$@"
However when I tried this I got inexplicable results:
which is what I would have expected with
"$*"
(and indeed, that generates the same error).I've also tried bash's Q (quote feature):
and while that seems to work, I can no longer put multiple commands on rrun. For example, with:
the semicolon is passed as a parameter to smith rather than acting as a command separator.
I assume the underlying problem is that the
$@
is within a heredoc and thus is subject to shell expansion twice, but I can't figure out a solution.If a solution is found we can delete the "Known bugs" section of the README.