Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -ne 4 ]; then
  4. echo " il numero dei parametri è sbagliato "
  5. exit 1
  6. fi
  7.  
  8.  
  9. if [ ! -d $1 ]; then
  10. echo " il primo parametro non è una directory "
  11. exit 1
  12. fi
  13.  
  14. if [ ! -d $2 ]; then
  15. echo " il secondo parametro non è una directory "
  16. exit 1
  17. fi
  18.  
  19. for file in $(ls $1 | grep -v ^$4 | grep $3$ )
  20. do
  21.  
  22. if [ -f $1/$file ]; then
  23. echo $1/$file
  24. echo "file regolare "
  25. echo "file  che non iniziano con $4 e finiscono con $3 "
  26.  
  27. cp $1/$file $2/$file"$4"
  28.          
  29. fi
  30.  
  31. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement