参考:lunar1983的专栏 实现:从给定目录树中grep出含制定字符串的行,并给出所在路径 代码如下所示: #!/bin/sh - if [ $# -ne 2 ] then ...
参考:lunar1983的专栏 实现:从给定目录树中grep出含制定字符串的行,并给出所在路径 代码如下所示: #!/bin/sh - if [ $# -ne 2 ] then ...
#!/bin/bash function ergodic(){ for file in ` ls $1` do if [ -d $1"/"$fi ...
dir=/etc/ for file in $dir/*; do echo $file done ...
手动敲命令太累 #!/bin/sh #str="/home/etouch/Desktop/testshell/picture" "/home/etouch/Desktop/testshell/pi ...
#!/bin/bashfunction ergodic(){ for file in ` ls $1 ` do if [ -d $1"/"$file ] then ergodic $1"/"$file ...
不论是面试还是正常工作需要都会用到遍历文件夹下的所有文件,今天就记录一下笔记。废话不多说直接上代码: 运行结果: 源代码已上传GitHub:https://github.com/cuiyuanxin/php-demo/blob/master/dir.php 纯手打笔记 ...