Semicolons superfluous at the end of a line in shell scripts?

后端 未结 5 952
鱼传尺愫
鱼传尺愫 2020-12-12 20:07

I have a shell script which contains the following:

case $1 in
    0 )
    echo $1 = 0;
    OUTPUT=3;;
    1 )
    echo $1 = 1;
    OUTPUT=4;;
    2 )
    ec         


        
5条回答
  •  甜味超标
    2020-12-12 20:45

    Single semicolons at the end of a line are superfluous, since the newline is also a command separator. case specifically needs double semicolons at the end of the last command in each pattern block; see help case for details.

提交回复
热议问题