Bash convention for if ; then

后端 未结 5 900
野趣味
野趣味 2021-02-15 11:42

From this web page :

http://tldp.org/LDP/abs/html/abs-guide.html

It\'s mentioned the usage of the if bracket then convention which need a space after the semicol

5条回答
  •  萌比男神i
    2021-02-15 12:02

    The space after the semicolon is not required by the syntax for any shell I know of, but it's good style and makes the code easier to read.

    I suppose the "sometimes needs to be escaped" wording refers to cases like echo foo\;bar, where you don't want the semicolon to be interpreted as a separator by the shell.

提交回复
热议问题