Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/bin/sh
  2. base=$1
  3. output=$2
  4. baseLength=length $base
  5.  
  6. funFile(){
  7. echo "find a file $1"
  8. string=$1
  9. echo ${string}
  10. # expr substr "$string" 1 3 # 从第一个位置开始取3个字符, abc
  11. # expr substr "$string" $baseLength
  12. # fileName=${string##*/}
  13. srcml $1 -o $1.xml
  14. }
  15.  
  16. # param 1:source
  17. funListFile(){
  18. for file in $1/*
  19. # 遍历输入目标文件夹下的file
  20. do
  21. if test -f $file
  22. then
  23. funFile $file
  24. fi
  25. if test -d $file
  26. then
  27. funListFile $file
  28. fi
  29. done
  30. }
  31.  
  32. echo 'base: '$base
  33. echo 'output: '$output
  34. funListFile $base
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement