Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- #use bash-script(shebang)
- #Harm-Joost van Kuijk (2044347)
- #Gersom Slort (2027969)
- #watch out for whitespaces!
- IFS=$'\n'
- #if parameter, use it! otherwise this filepath.
- if [ "$1" = "" ]
- then
- d=`pwd`
- echo $d;
- else
- d="$1"
- echo $d;
- fi
- #Get backup-doelpath
- #doel=`cat ~/etc/bak.dst`
- #echo $doel
- doel=~/bakbackup/
- echo $doel
- if [ -d $doel ]
- then
- echo "hij bestaat"
- else
- echo "hij bestaat niet"
- #Vraag of je de backup-dir wilt maken.
- read -p "Maak backup-dir? (j/n) " antwoord
- echo $antwoord
- #Als ja dan maak dir. Als nee breek script af.
- if [ $antwoord = "j"]
- then
- #Maak de dir
- echo "Maak dir"
- mkdir -p ~/bakbackup/
- else
- #Breek script af
- echo "breek script af"
- exit
- fi
- fi
- echo "ajfhkjfhakjrdhgkajhgkajfhgkjhfgkajb"
- #for f in `ls $d`
- #do
- # if test -f "$d/$f"
- # then
- # echo "F" $d/$f
- # fi
- #
- # if test -d "$d/$f"
- # then
- # echo "D" $d/$f
- # # B.7. Roep het script aan voor deze directory
- # $0 "$d/$f"
- # fi
- #done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement