折腾一晚上了,第一脚本终于写出来了
中途遇见点错误
- syntax error near unexpected token
`do'
|
这个错误 就是因为我再windows下
编写的 稍微的解决了下
可是
问题还是出现,在高纪胜和叶学辉的帮助下
还是改正了 哈
我说下功能 这个主要写的是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
|
原文地址:
阅读(358) | 评论(0) | 转发(0) |