参考:lunar1983的专栏 实现:从给定目录树中grep出含制定字符串的行,并给出所在路径 代码如下所示: #!/bin/sh - if [ $# -ne 2 ] then ...
bin bash function ergodic for file in ls do if d file 如果 file存在且是一个目录则为真 then ergodic file else local path file 得到文件的完整的目录 local name file 得到文件的名字 fi done INIT PATH home ergodic INIT PATH ...
2015-03-05 16:05 0 4938 推荐指数:
参考:lunar1983的专栏 实现:从给定目录树中grep出含制定字符串的行,并给出所在路径 代码如下所示: #!/bin/sh - if [ $# -ne 2 ] then ...
dir=/etc/ for file in $dir/*; do echo $file done ...
手动敲命令太累 #!/bin/sh #str="/home/etouch/Desktop/testshell/picture" "/home/etouch/Desktop/testshell/pi ...
shell脚本如下: 执行脚本如下: 去掉尾部tgz,留下文件名,可以用如下:${sfile%.tgz} echo "去掉尾部tgz=${sfile%.tgz}" ...
#!/bin/bashfunction ergodic(){ for file in ` ls $1 ` do if [ -d $1"/"$file ] then ergodic $1"/"$file ...