robercik1010

hide_dir

Aug 26th, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. !/bin/bash
  2. if [ $# = 0 ]
  3. then
  4. echo -e  "Użycie: $0 folder_do_ukrycia_bądź_okrycia -[hu]\n Opcja h ukrywa folder a u\n go odkrywa"
  5. exit -1
  6. fi
  7. if test -d $1||test -d .$1
  8. then
  9. case $2 in
  10. -h) mv $1 .$1;echo "FOLDER `dirname $1`/$1 został ukryty przez użytkownika
  11. -u) mv .$1 $1;echo "FOLDER `dirname $1`/ $1 został przywrócony przez użytkownika
  12. esac
  13. else echo "$1 to nie folder!";exit -1
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment