好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

查看本地用户shell - Linux操作系统:Ubuntu_Centos_D

查看本地用户shell

 

1 #!/bin/bash

2 #用途:  www.2cto.com  

3查看本地用户shell

4 line=`cat /etc/passwd|grep $1`

5 if [ $? -eq 0 ];then

7 else

8 echo "Not user "

10 fi

11 oldIFS=$IFS;

12 IFS=":"

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;
 

查看更多关于查看本地用户shell - Linux操作系统:Ubuntu_Centos_D的详细内容...

  阅读:66次