Ho visto molto questo costrutto negli script e l'ho usato da solo, ma mi dà fastidio che non riesco a trovarlo nella documentazione.
Esempio:
[ -f file1 ] &&
[ -f file2 ] &&
echo "Both files exist." ||
echo "One or the other file doesn't exist."
Questo potrebbe essere fatto anche con barre rovesciate prima delle newline, come menzionato in man bash:
If a \<newline> pair appears, and the backslash is not
itself quoted, the \<newline> is treated as a line continuation (that
is, it is removed from the input stream and effectively ignored).
Esempio:
[ -f file1 ] && \
[ -f file2 ] && \
echo "Both files exist." || \
echo "One or the other file doesn't exist."
... ma questo non sembra essere necessario. La prima versione sopra funziona anche senza le barre rovesciate.
Dove posso trovarlo man bash? (Inoltre, questo è bashspecifico o conforme a POSIX?)
names=( Rama Soma<newline> Sita Diya ). Python li descrive chiaramente qui, ma la documentazione di Bash non sembra.
;,&,(e).