Advertisement
nikolaliltek

Untitled

May 20th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2.  
  3. #!/bin/bash
  4.  
  5. recursiveBuild()
  6. {
  7. if [ $2 = $4 ]
  8. then
  9. return 0
  10. else
  11. local first=$(($2+1))
  12. local second=$3
  13. local incsecond=$(($3+1))
  14. mkdir $1$first$second
  15. mkdir $1$first$incsecond
  16. cd $1$first$second
  17. recursiveBuild $1 $first $((2*$second-1)) $4
  18. cd ..
  19. cd $1$first$incsecond
  20. first=$(($2+1))
  21. second=$3
  22. incsecond=$(($3+1))
  23. #echo "$1 $first $((2*$incsecond-1)) $4"
  24. recursiveBuild $1 $first $((2*$incsecond-1)) $4
  25. cd ..
  26. fi
  27.  
  28. }
  29.  
  30. mkdir $1"11"
  31. cd $1"11"
  32. recursiveBuild $1 1 1 $2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement