I'm interested to know what this snippet of RSH code does, and whether Bash has something similar:
if [ -z $ALPHA \
-z $BRAVO \
-z $CHARLIE \
-z $DELTA ]; then
var=$ZULU
fi
Those baskslashes are allowing for line continuation. It's as if the code were written like the following:
if [ -z $ALPHA -z $BRAVO -z $CHARLIE -z $DELTA ]; then
var=$ZULU
fi
From 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).
The \
is escaping the end of line.
It is a way to tell that the line is not yet complete and is being continued in the next line.
It just makes your code easier to read.
It is available in bash as well:
$ echo foo
foo
$ echo foo \
> bar
foo bar
$