Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. if [ "$#" -lt 2 ]; then
  2. echo "za malo argumentow"
  3. exit 1
  4. fi
  5. if [[ $1 =~ ^[0-9]{3}$ ]]; then
  6. echo "uprawnienia ok"
  7. else
  8. echo "pierwszy argument nie jest liczbowy"
  9. exit 1
  10. fi
  11. for file in "${@:2}" ; do
  12. if [ -f "$file" ]; then
  13. chmod $1 $file
  14. continue
  15. else
  16. echo "nie wsyzstkie rzeczy są plikami"
  17. exit 1
  18.  
  19. fi
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement