mmstick/parallel

Input token {N.} doesn't remove extension

SuperFluffy opened this issue · 2 comments

Giving parallel a spin and trying out the example commands. I believe that the input token {N.} doesn't do what it's supposed to do:

% parallel echo {} {1} {2} {3.} ::: 1 2 file.mkv
1 1 2 . 3
2 1 2 . 3
file.mkv 1 2 . 3

If I read the description correctly, instead of seeing . 3 I should see file?

% parallel --version
MIT/Rust Parallel 0.10.7

The issue is that your shell is interpreting it. That's what is wrong. Try doing this instead:

$ parallel echo '{} {1} {2} {3.}' ::: 1 2 file.mkv
1 1 2 file
2 1 2 file
file.mkv 1 2 file

This will prevent your shell from interpreting the braces. You can see how your shell is interpreting commands if you try this (running from fish):

$ echo {} {1} {2} {3.}
1 2 3.

Yes, you are right indeed! I am using zsh and setopt braceccl causes {.3} to be expanded to a lexically ordered list of characters, in this case . 3, as seen above.

Quoting everything works, as does:

% unsetopt braceccl; parallel echo {} {1} {2} {3.} ::: 1 2 file.mkv 
1 1 2 file
2 1 2 file
file.mkv 1 2 file