--dry-run isn't what gets executed
mqudsi opened this issue · 4 comments
mqudsi commented
~>> echo ./zoomed\ in.png
./zoomed in.png
~> echo ./zoomed\ in.png | parallel 'file -ib "{}"'
parallel: reading inputs from standard input
cannot open `"./zoomed in.png"' (No such file or directory)
~> echo ./zoomed\ in.png | parallel --dry-run 'file -ib "{}"'
parallel: reading inputs from standard input
file -ib "./zoomed in.png"
~> file -ib "./zoomed in.png"
image/png; charset=binary
Any idea why parallel isn't working here? The output of --dry-run
is correct.
Albibek commented
@mqudsi have you tried running this without double quotes around {}
? I assume they are shell escaping, that doesn't work in parallel
.
mqudsi commented
mqudsi@ZBook /m/c/U/M/Downloads> echo ./zoomed\ in.png | parallel --dry-run 'file -ib {}'
parallel: reading inputs from standard input
file -ib ./zoomed in.png
mqudsi@ZBook /m/c/U/M/Downloads> echo ./zoomed\ in.png | parallel 'file -ib {}'
parallel: reading inputs from standard input
cannot open `./zoomed' (No such file or directory)
cannot open `in.png' (No such file or directory)
ghuls commented
mateon1 commented
@ghuls
That is definitely not the issue here, the file command accepts multiple files as arguments. That means:
$ file badfile1 badfile2
badfile1: cannot open `badfile1' (No such file or directory)
badfile2: cannot open `badfile2' (No such file or directory)
I can't test this now, but it might be related to the current working directory being changed by parallel.
The input is definitely not parsed as file -ib '"./zoomed' 'in.png"'
, as file would output cannot open `"./zoomed` (no such file or directory)