Comment by snatchpiesinger
Comment by snatchpiesinger 2 days ago
Cool! My personal preference is Knuth-style line-breaks on binary operators and pipes, which means breaking before the operator/pipe symbol.
foo -a -b \
| bar -c -d -e \
| baz -e -f
instead of foo -a -b | \
bar -c -d -e | \
baz -e -f
This doesn't seem to be an option, but could be easy to implement.
If you end with a pipe, you don't need the backslash before the newline. It's implicit.
https://unix.stackexchange.com/questions/253518/where-are-ba...
When writing bash, if I have a command with many switches, I use an array to avoid backslashes and make the intent clearer:
I also insist on long-form options in shell scripts since they are much more self-documenting as compared to single-letter options.