What is the purpose of the : (colon) GNU Bash builtin?

前端 未结 12 911
梦如初夏
梦如初夏 2020-11-22 14:01

What is the purpose of a command that does nothing, being little more than a comment leader, but is actually a shell builtin in and of itself?

It\'s slower than inse

12条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 14:20

    : can also be for block comment (similar to /* */ in C language). For example, if you want to skip a block of code in your script, you can do this:

    : << 'SKIP'
    
    your code block here
    
    SKIP
    

提交回复
热议问题