if-then-else语句

5年以前  |  阅读数:471 次  |  编程语言:Shell 
#!/bin/bash
#testing the else section
testuser=badtest
if grep $testuser /etc/passwd
then
    echo The files for user $testuser are:
    ls -a /home/.b*
else
    echo "The user name $testuser does not exist on this system"
fi

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8