Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ $# -ne 1 ]
- then
- echo 'Niepoprawna ilosc argumentow';
- exit
- fi
- if ! [ -d "$1" ]
- then
- echo 'Argument nie jest katalogiem';
- exit
- fi
- if ! [ -w $1 ]
- then
- echo "Nie mam uprawnien do zapisu w katalogu";
- exit
- fi
- for x in `ls $1 | grep -v ".kopia$"`; do
- if [ -f "$1/$x" ]
- then
- cp "$1/$x" "$1/$x.kopia"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement