1 #!/bin/bash
2 #用途:
3查看本地用户shell
4 line=`cat /etc/passwd|grep $1`
5 if [ $? -eq 0 ];then
6 echo user:$1
7 else
8 echo "Not user "
9 exit 0
10 fi
11 oldIFS=$IFS;
12 IFS=":"
13 count=0
14 for item in $line;
15 do
16 [ $count -eq 0 ] && user=$item;
17 [ $count -eq 6 ] && shell=$item;
18 let count++
19 done;
20 IFS=$oldIFS
21 echo $1\`s shell is $shell;
阅读(375) | 评论(0) | 转发(0) |