Skip to content
Snippets Groups Projects
Commit e3e58d19 authored by Goik Martin's avatar Goik Martin
Browse files

Configurable destination dir

parent 28fda45b
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
exam=Se1/Ws2016 exam=Se1/Ws2018
#exam=Sda1/Ws2016 #exam=Sda1/Ws2016
#exam=Sda1/SoSe2016 #exam=Sda1/SoSe2016
cloudbase=~/C/Hdm/Fh/KlausurBewertung
############################## ##############################
...@@ -11,26 +13,20 @@ rm -rf ~/newUsers.txt ...@@ -11,26 +13,20 @@ rm -rf ~/newUsers.txt
for zip in $( ls *.zip); do for zip in $( ls *.zip); do
userId=${zip%.zip} userId=${zip%.zip}
destuser=~/C/HdM/Fh/KlausurBewertung/$userId destuser=$cloudbase/$userId
if [ -d "$destuser" ] if [ -d "$destuser" ]
then then
echo "$destuser exists" echo "$destuser exists"
else else
echo "$destuser does not exist" echo "$destuser will be created"
echo $userId >> ~/newUsers.txt echo $userId >> ~/newUsers.txt
fi fi
destdir=$destuser/$exam destdir=$destuser/$exam
# mkdir -p Unpack;cd Unpack
# unzip ../$fbname 1> /dev/null 2>& 1 || echo $fbname is not a .zip archive
mkdir -p $destdir mkdir -p $destdir
echo moving $zip to $destdir echo moving $zip to $destdir
mv $zip $destdir mv $zip $destdir
# mv Unpack/$fbname/* $destdir
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment