Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

--dry-run isn't what gets executed #57

Open
mqudsi opened this issue Oct 14, 2017 · 4 comments
Open

--dry-run isn't what gets executed #57

mqudsi opened this issue Oct 14, 2017 · 4 comments
Milestone

Comments

@mqudsi
Copy link

mqudsi commented Oct 14, 2017

~>> 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
Copy link

Albibek commented Oct 15, 2017

@mqudsi have you tried running this without double quotes around {}? I assume they are shell escaping, that doesn't work in parallel.

@mqudsi
Copy link
Author

mqudsi commented Oct 15, 2017

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
Copy link

ghuls commented Nov 20, 2017

@mqudsi Your issue is not directly related to --dry-run, but to the fact that this implementation of parallel splits lines from stdin and from files on whitespace instead of on newline characters as described in issue #61.

@mateon1
Copy link

mateon1 commented Nov 22, 2017

@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)

@mmstick mmstick added this to the 0.12 Rewrite milestone Dec 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants