Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/sh
  2. #use bash-script(shebang)
  3.  
  4. #Harm-Joost van Kuijk (2044347)
  5. #Gersom Slort (2027969)
  6.  
  7. #watch out for whitespaces!
  8. IFS=$'\n'
  9.  
  10. #if parameter, use it! otherwise this filepath.
  11. if [ "$1" = "" ]
  12. then
  13.    d=`pwd`
  14.  echo $d;
  15. else
  16.    d="$1"
  17.  echo $d;
  18. fi
  19.  
  20. #Get backup-doelpath
  21. #doel=`cat ~/etc/bak.dst`
  22. #echo $doel
  23. doel=~/bakbackup/
  24. echo $doel
  25.  
  26. if [ -d $doel ]
  27. then
  28.    echo "hij bestaat"
  29. else
  30.    echo "hij bestaat niet"
  31.    #Vraag of je de backup-dir wilt maken.
  32.    read -p "Maak backup-dir? (j/n) " antwoord
  33.    echo $antwoord
  34.  
  35.    #Als ja dan maak dir. Als nee breek script af.
  36.    if [ $antwoord = "j"]
  37.    then
  38.       #Maak de dir
  39.       echo "Maak dir"
  40.       mkdir -p ~/bakbackup/
  41.    else
  42.       #Breek script af
  43.       echo "breek script af"
  44.       exit
  45.    fi
  46. fi
  47.  
  48. echo "ajfhkjfhakjrdhgkajhgkajfhgkjhfgkajb"
  49.  
  50. #for f in `ls $d`
  51. #do
  52. #   if test -f "$d/$f"
  53. #   then
  54. #      echo "F" $d/$f
  55. #   fi
  56. #
  57. #   if test -d "$d/$f"
  58. #   then
  59. #      echo "D" $d/$f
  60. #      # B.7. Roep het script aan voor deze directory
  61. #      $0 "$d/$f"
  62. #   fi
  63. #done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement