#!/bin/bash function ergodic(){ for file in ` ls $1 ` # do # if [ -d $1"/"$file ] # then # ergodic $1"/"$file # else # wc -L $1"/"$file | cut -d' ' -f1 >> /home/huanghongbo/out # fi # done do echo $file done } INIT_PATH="/home/huanghongbo/" ergodic $INIT_PATH
参考: