Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- clear
- if [ $# -lt 2 ] || [ $# -gt 4 ]; then
- echo "nieprawidlowa liczba argumentow"
- elif [ ${#1} -ne 3 ]; then
- echo "nieodpowiednia dlugosc pierwszego znaku"
- elif [ $1 -gt 777 ] || [ $1 -lt 0 ]; then
- echo "nieodpowiednia cyfra"
- elif [[ $2 != "f" ]] && [[ $2 != "d" ]] && [[ $2 != "l" ]]; then
- echo "nieprawidlowa druga litera"
- elif [[ $3 != "f" ]] && [[ $3 != "d" ]] && [[ $3 != "l" ]] && [[ $3 != "" ]]; then
- echo "nieprawidlowa trzecia litera"
- elif [[ $4 != "f" ]] && [[ $4 != "d" ]] && [[ $4 != "l" ]] && [[ $4 != "" ]]; then
- echo "nieprawidlowa czwarta litera"
- else
- echo "PRZED"; ls -l
- echo "PO"
- case "$2" in
- "f") find -type f -exec chmod -R $1 {} \;;;
- "d") find -type d -exec chmod -R $1 {} \;;;
- "l") find -type l -exec chmod -R $1 {} \;;;
- esac
- if [ $# -gt 2 ]; then
- case "$3" in
- "f") find -type f -exec chmod -R $1 {} \;;;
- "d") find -type d -exec chmod -R $1 {} \;;;
- "l") find -type l -exec chmod -R $1 {} \;;;
- esac
- fi
- if [ $# -gt 3 ]; then
- case "$4" in
- "f") find -type f -exec chmod -R $1 {} \;;;
- "d") find -type d -exec chmod -R $1 {} \;;;
- "l") find -type l -exec chmod -R $1 {} \;;;
- esac
- fi
- ls -l
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement