Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6894912
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-12-26 17:27:44

原文地址:查看本地用户shell 作者:baochenggood

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;
阅读(340) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~