Linux之shell脚本遍历文件夹下全部文件

#!/bin/bash bash

function ergodic(){ spa

for file in ` ls $1` io

do                 function

    if [ -d $1"/"$file] #若是 file存在且是一个目录则为真                 file

    then                       ergodic $1"/"$file                 di

  else                       local path=$1"/"$file #获得文件的完整的目录                       文件

                 local name=$file       #获得文件的名字                                   co

   fipath

done }

INIT_PATH="/home"

ergodic $INIT_PATH

相关文章
相关标签/搜索