How to tell bash that the line continues on the next line

后端 未结 3 2134
灰色年华
灰色年华 2020-12-02 14:23

In a bash script I got from another programmer, some lines exceeded 80 columns in length. What is the character or thing to be added to the line in order to indicate that th

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 14:34

    \ does the job. @Guillaume's answer and @George's comment clearly answer this question. Here I explains why The backslash has to be the very last character before the end of line character. Consider this command:

       mysql -uroot \
       -hlocalhost      
    

    If there is a space after \, the line continuation will not work. The reason is that \ removes the special meaning for the next character which is a space not the invisible line feed character. The line feed character is after the space not \ in this example.

提交回复
热议问题