网站地图    收藏   

主页 > 系统 > linux系统 >

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

来源:自学PHP网    时间:2015-04-14 11:12 作者: 阅读:

[导读] 查看本地用户shell1 #!/bin/bash2 #用途: www.2cto.com 3查看本地用户shell4 line=`cat /etc/passwd|grep $1`5 if [ $? -eq 0 ];then6 echo user:$17 else8 echo Not user 9 exit 010 ......

查看本地用户shell
 
1 #!/bin/bash
2 #用途:  www.2cto.com  
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;
 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论