shell初级编程
2011-07-07 22:12
155 查看
功能:判断输入的用户名是否存在与/etc/passwd中
#!/bin/bash if [ $# -le 0 ];then echo "Please input the right arg" else i=`cat /etc/passwd | cut -f1 -d':' | grep -w "$1" -c ` if [ $i -le 0 ];then echo "User $1 is not in the passwd" else echo "User $1 is in the passwd" fi fi
相关文章推荐
- shell初级编程
- linux运维初级班shell脚本编程考试及参考答案20110523
- shell初级编程问题(一):fi关键字显示红色,运行报语法错误
- linux运维初级班shell脚本编程考试及参考答案20110523
- linux运维初级班shell脚本编程测试及参考答案
- Linux_Shell初级编程入门
- shell脚本编程-函数
- SHELL脚本编程的常识
- Linux-Shell脚本编程-学习-5-Shell编程-使用结构化命令-if-then-else-elif
- Shell脚本编程概述(四):bash内置字符处理工具
- VC 向windows系统菜单中添加菜单项---Windows shell扩展编程
- Shell脚本编程(3)
- Bash 实例,第一部分 Bourne again shell (bash) 基本编程
- shell脚本编程习题浅析
- Shell编程经验总结
- shell脚本编程基础
- shell脚本编程基础
- shell脚本编程之for语句、if语句使用介绍
- 【Unix/Linux编程实践】shell如何运行程序—编写命令解析器sh
- shell 脚本编程之特殊变量