spine-generic / data-multi-subject

Multi-subject data for the Spine Generic project
Creative Commons Attribution 4.0 International
22 stars 15 forks source link

Remove && in the doc #14

Closed jcohenadad closed 4 years ago

jcohenadad commented 4 years ago

Code instructions here: https://github.com/spine-generic/data-multi-subject#download

have "&&" at the end. This is made to copy/paste all the lines and run it at once, but when trying to run line-by-line (which is encouraged, to make sure each line passes well), it does not run.

So, i would suggest to remove the "&&"

kousu commented 4 years ago

Sorry about that. It should read && \, that's the convention for sharing long lines for pasting.

kousu commented 4 years ago

The && is important! You don't want to keep on if one step fails. This is one of the 99 pitfalls of shell.

jcohenadad commented 4 years ago

The && is important! You don't want to keep on if one step fails. This is one of the 99 pitfalls of shell.

so, i'm not sure what "&&" does, but my approach is always to run line by line (no copy/paste of all the lines at once). And as you said, if it fails, i stop running the subsequent lines.

kousu commented 4 years ago

It's an "and". As a side-effect, "A && B" means "Do A then do B only if A succeeded". Most people aren't as careful as you are about following instructions, and it's not always obvious from a program's output if it failed (especially if the output is either very long or if you're running it through pipes to do further processing), so this is a better rule of thumb.

((another option is to do set -e before all scripts, but in an interactive session that has the side effect of closing your window when something fails. You could do use it with a subshell (set -e; A; B; C) but that's effectively identical to A && B && C))