What is /bin/true?

后端 未结 6 971
谎友^
谎友^ 2020-12-24 00:29

On a Linux system, what is /bin/true? What is it used for?

6条回答
  •  没有蜡笔的小新
    2020-12-24 00:49

    In the UNIX shells, it's used for the same purposes as boolean constants true and false in any other language.

    while true; do
        something
    done
    
    flag=true
    ...
    if $flag; then
        something
    done
    

提交回复
热议问题