How to make “if not true condition”?

后端 未结 6 1073
夕颜
夕颜 2020-12-22 15:56

I would like to have the echo command executed when cat /etc/passwd | grep \"sysa\" is not true.

What am I doing wrong?

if          


        
6条回答
  •  独厮守ぢ
    2020-12-22 16:10

    This one

    if [[ !  $(cat /etc/passwd | grep "sysa") ]]
    Then echo " something"
    exit 2
    fi
    

提交回复
热议问题