linux简单脚本2
来源:互联网 发布:java中的md5怎么解密 编辑:程序博客网 时间:2024/05/16 18:18
#!/bin/shchangemod (){ if [ -d $filepath ]; then cd $filepath for var in `ls -tr` do changefilemod $var done return 0 else if [ -f $filepath ]; then changefilemod $filepath return $? else return -1 fi fi}changefilemod(){ filename="$1" if [ -n $filename -a $filename != "chmod.sh" ]; then chmod $mode $filename return 0 else return -1 fi}handelfilepath(){ if [ -z $filepath ] || [ $filepath = "null" ]; then filepath=`pwd` fi}handelmode(){ if [ -z $mode ]; then mode="744" fi}checkparams(){ paramnumber=$1 if [ $paramnumber -eq 1 ];then echo "your params is error you can user this shell like this ./chmod.sh or ./chmod null 774 " return -1 else return 0 fi}##################################################################main#################################################################filepath=$1mode=$2checkparams $# if [ $? -ne 0 ];then exit 1 fihandelfilepathhandelmodechangemodresultCode=$?if [ $resultCode -eq "0" ]; then echo "change mode ok"else echo "change mode fail....."fi
0 0
- linux简单脚本2
- linux简单自动化脚本
- linux系统维护简单脚本
- Linux 简单脚本程序
- linux shell脚本简单示例
- 简单的Linux脚本程序
- linux 学习的简单脚本
- 简单linux进程看护脚本
- linux脚本之简单实例
- Linux简单的shell脚本
- python简单脚本2
- 编写简单的 Linux Shell 脚本
- 简单的Linux服务器监控脚本
- 网上找到linux 简单模块编译脚本
- Linux下收集日志的简单脚本
- 简单的Linux防火墙配置脚本例子
- 一个简单的linux脚本创建过程
- Linux下简单Shell 脚本的写法
- 简单jQplot创建引擎(支持线图/饼图/柱状图)
- Maven初学笔记快速入门
- 虚拟机上新添加磁盘进行挂载
- Asp.Net MVC4.0 官方教程 入门指南之五--控制器访问模型数据
- coder计算器
- linux简单脚本2
- C++中sort函数用法
- 算出number(一行保存一个数字)文件中和最大的连续行数,打印开始结束行号,打印最大的和
- java笔记之异常
- Asp.Net MVC4.0 官方教程 入门指南之六--查看Edit方法和Edit视图
- int转6位16进制数。
- 简明python教程学习笔记(四)-标示符、变量、运算符
- 非静态的内部类会持有外部类的一个隐式引用
- htop源码中的Hashtable