Linux bash初学 if语句

#!/bin/bash
if [ $# -eq 1 ] ; then
     if [ -f "$1" ] ; then
        while read username ; do
            user add -s /bin/false $username &>/dev/null
            done < $1
    else
        echo "Input file name not found"
        exit 1
    fi
else
    echo "please input a file name"
    exit 2
fi

 

posted @ 2019-03-24 15:16  Josh_Xie  阅读(184)  评论(0编辑  收藏  举报