常用经典shell脚本整理
2017-01-22 10:55
218 查看
常用经典shell脚本整理发表于: Linux, Shell, UNIX, 运维经验 | 作者: 谋万世全局者标签: Shell,常用,经典,脚本1.check_user.sh #!/bin/bashecho "You are logged in as `whoami`";if [ `whoami` != linuxtone ]; thenecho "Must be logged on as linuxtone to run
this script."exitfiecho "Running script at `date`"2.do_continue.sh #!/bin/bashdoContinue=necho "Do you really want to continue?
(y/n)"read doContinueif [ "$doContinue" != y ]; thenecho "Quitting..."exitfiecho "OK... we will continue."3.hide_input.sh #!/bin/bashstty -echoecho -n "Enter the database system password: "read pwstty echoecho "$pw was entered" 4.is_a_directory.sh #!/bin/bashif [ -z "$1" ]; thenecho ""echo " ERROR : Invalid number of
arguments"echo " Usage : $0 "echo ""exitfiif [ -d $1 ]; thenecho "$1 is a directory."elseecho "$1 is NOT a directory."fi 5.is_readable.sh #!/bin/bashif [ -z "$1" ]; thenecho ""echo " ERROR : Invalid number of
arguments"echo " Usage : $0 "echo ""exitfiif [ ! -r $1 ]; thenecho "$1 is NOT readable."elseecho "$1 is readable."fi 6.print_args.sh #!/bin/bash## The shift command removes the argument nearest# the command name and replaces it with the next one#while [ $# -ne 0 ]doecho $1shiftdone永久链接 : http://www.ha97.com/4020.html Pasted
from <http://www.ha97.com/4020.html>
相关文章推荐
- Linux下一些常用的Shell脚本整理
- shell脚本中字符串常用操作整理
- 常用经典shell脚本
- Linux下一些常用的Shell脚本整理
- 常用Shell脚本整理《一》
- 监控Oracle数据库的常用shell脚本
- Shell常用命令整理
- 常用shell脚本命令总结(添加中。。。)
- ASP.NET常用JS脚本整理
- 常用的几个shell脚本_3_恢复工程
- 8个DBA最常用的监控Oracle数据库的常用shell脚本
- 监控Oracle数据库的常用shell脚本
- 常用的几个shell脚本_2_查看日志
- 常用shell脚本积累
- 几个常用的shell脚本
- VBS脚本常用经典代码收集
- 8个DBA最常用的监控Oracle数据库的常用shell脚本
- 整理的几个常用的数据库维护的脚本(ZT)
- 常用的几个shell脚本_1_更新工程
- 监控Oracle数据库的常用shell脚本