Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue a command on the next line

Tags:

autoit

Is there a way to continue a command on a new line? My MsgBox() function call is long, for the sake of readability I want to do something like this:

$confirm = MsgBox(321, "Check Information", "Confirmation Number:     " & @LF &
                                            "Amount:                  $")

This returns a syntax error and points to the end of the first line as being the location of the error.

like image 463
Anthony Miller Avatar asked Feb 03 '12 22:02

Anthony Miller


People also ask

Which character is used to continue a command to the next line?

Continuing a Long Command on Another Line To make the commands easier to understand, use the shell escape character, which is a backslash, to continue a command on the next line.

How do you continue a command in next line in Unix?

If you want to break up a command so that it fits on more than one line, use a backslash (\) as the last character on the line. Bash will print the continuation prompt, usually a >, to indicate that this is a continuation of the previous line.

How do you continue to the next line in bash?

From the bash manual: The backslash character '\' may be used to remove any special meaning for the next character read and for line continuation.

How do you go to the next line in Linux?

The most used newline character If you don't want to use echo repeatedly to create new lines in your shell script, then you can use the \n character. The \n is a newline character for Unix-based systems; it helps to push the commands that come after it onto a new line.


1 Answers

Place an underscore at the end of the line:

$confirm = msgbox(321, "Check Information", "Confirmation Number:     " & @LF & _
                                            "Amount:                  $")
like image 165
Daniel Haley Avatar answered Sep 30 '22 09:09

Daniel Haley