What is the use case of noop [:] in bash?

后端 未结 12 918
滥情空心
滥情空心 2020-12-12 13:07

I searched for noop in bash (:), but was not able to find any good information. What is the exact purpose or use case of this operator?

I tried following and it\'s w

12条回答
  •  自闭症患者
    2020-12-12 13:35

    I've also used in it scripts to define default variables.

    
    : ${VARIABLE1:=my_default_value}
    : ${VARIABLE2:=other_default_value}
    call-my-script ${VARIABLE1} ${VARIABLE2}
    
    

提交回复
热议问题