[30期] 我的第一个shell脚本~感谢其他几位同学帮助
2011-07-27 09:06
295 查看
折腾一晚上了,第一脚本终于写出来了
中途遇见点错误
这个错误 就是因为我再windows下编写的 稍微的解决了下
可是问题还是出现,在高纪胜和叶学辉的帮助下 还是改正了 哈
我说下功能 这个主要写的是find 几个选项 通过文件大小 文件名 文件所有者 来搜索
希望各位同学能帮我再简化下脚本 3Q3Q了~
中途遇见点错误
syntax error near unexpected token `do' |
可是问题还是出现,在高纪胜和叶学辉的帮助下 还是改正了 哈
我说下功能 这个主要写的是find 几个选项 通过文件大小 文件名 文件所有者 来搜索
希望各位同学能帮我再简化下脚本 3Q3Q了~
#!/bin/bash #!this shell about user to search file!the search mode about filesize,filename,fileowner #!author:lamp30Q qindongsheng qq:229932704 echo "my first shell,if the shellfile has errors,hope everybody to change" echo echo select mode in size name userfile do break done echo "pls input you want to search the DIR," read sdir case $mode in size) echo "pls input the file Least size,For Exmple:100MB,you must input +204800" read fileleast echo "pls input the file Max size,For Exmple:100MB,you must input -204800" read filemax /usr/bin/find $sdir -size $fileleast -a -size $filemax ;; name) echo "pls input the filename as you want to search " read filename /usr/bin/find $sdir -name $filename ;; userfile) echo "pls input username as you wang to search file owner" read username /usr/bin/find $sdir -user $username ;; *) echo "input error" esac |
相关文章推荐
- [30期] 我的第一个shell脚本~感谢其他几位同学帮助
- [30期] 我的第一个shell脚本~感谢其他几位同学帮助
- 我的第一个shell脚本
- linux使用shell脚本管理其他服务器Tomcat启动停止、自动发布
- 9、在Shell脚本中调用其他脚本
- 第一个shell脚本-helloworld
- 第一个shell脚本 结合计划任务下载远程文件
- linux study 1-第一个shell脚本
- shell 脚本打包一个目录下的子目录,同时拷贝到其他路径
- 我的第一个shell脚本
- 【Shell脚本学习5】第一个Shell脚本
- 【Shell 编程基础第一部分】第一个Shell脚本HelloShell及一些简单的Shell基础书写与概念
- 第一个shell脚本helloword
- 我写的第一个shell脚本(2009-06-08)
- shell for循环、循环变量值付给其他shell脚本
- 【Shell 编程基础第一部分】第一个Shell脚本HelloShell及一些简单的Shell基础书写与概念;
- 9、在Shell脚本中调用其他脚本
- 【Linux命令行与shell脚本编程】教程二——学会查找帮助信息
- Shell - 简明Shell编程01 - 第一个脚本(HelloShell)
- 【学习Linux】第一个shell脚本