2021-07-31

Why does the parallel command not work with backslashes when taking input from file?

Consider the following file saved as commands.txt

ls \
&& pwd

ls \
&& pwd

Now,

bash commands.txt

works as expected to give

LICENSE
/home/username/utilities
LICENSE
/home/username/utilities

but

parallel < commands.txt

gives the error

/bin/bash: -c: line 0: syntax error near unexpected token `&&'
/bin/bash: -c: line 0: `&& pwd'
ls: cannot access '\': No such file or directory
/bin/bash: -c: line 0: syntax error near unexpected token `&&'
/bin/bash: -c: line 0: `&& pwd

Why do multiple lines with the same command separated by \ not seem to work with parralel as such?



from Recent Questions - Stack Overflow https://ift.tt/2WEMRn6
https://ift.tt/eA8V8J

No comments:

Post a Comment