Bash Continue Command / Script On The Next Line

Bash Continue Command / Script On The Next Line

In Bash, you can use the \ character to continue a command or script on the next line.

Here's an example of how to use the \ character to continue a command on the next line:

long_command \
option1 \
option2 \
option3
Sourc‮ww:e‬w.lautturi.com

In this example, the long_command command is continued on the next line, with each option on a separate line. This can make the script more readable and easier to maintain.

You can also use the \ character to continue a script on the next line. For example:

if [ condition1 ] && \
[ condition2 ]
then
    # do something
fi

In this example, the if statement is continued on the next line, with each condition on a separate line.

Created Time:2017-10-27 14:56:34  Author:lautturi