longSir

流水不争先,争的是滔滔不绝

导航

Shell 便利目录的脚本

 1 #!/bin/bash
 2 
 3 function ergodic(){
 4     for file in `ls $1 `
 5     do
 6         if [ -d $1"/"$file ]
 7         then    
 8             ergodic $1"/"$file
 9         else
10             $3 $1/$file $2/${file##*/}
11 
12         fi
13     done
14 }
15 
16 INIT_PATH="/path_to_src_dir"
17 OUT__PATH="/path_to_dst_dir"
18 EXE="/path_to_exe_script"
19 
20 ergodic $INIT_PATH $OUT__PATH $EXE 

 

posted on 2024-12-08 10:25  tablong  阅读(6)  评论(0)    收藏  举报