知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

查看本地用户shell

发布时间:2014-09-05 15:23:15作者:知识屋

查看本地用户shell
 
1 #!/bin/bash
2 #用途:  www.zhishiwu.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;
 
(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜