Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- repertory=$1
- if [ -d "$repertory" ]
- then
- repertory=$repertory*
- for oneFile in $repertory
- do
- nbzip=$(echo "$oneFile"| grep -c ".zip")
- if [ $nbzip -eq 1 ]
- then
- newDirectory=$(echo "$oneFile" | cut -d'-' -f1-2)
- echo "$newDirectory"
- unzip "$oneFile" -d "$newDirectory"
- newDirectory=$newDirectory/*
- echo "$newDirectory"
- for oneFile1 in "$newDirectory"
- do
- echo "$oneFile1"
- chmod 640 "$oneFile1"
- done
- fi
- done
- exit 0
- else
- echo "Ce n'est pas un répertoire"
- exit 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement