hervasiop12345

instalar

Oct 1st, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. #!/bin/bash
  2. #Description: Copia un fichero a un directorio si tenemos permiso de lectura/Escritura respectivamente
  3. #Author:jMa
  4.  
  5. if [ \( $# != 2 \) ] || [ \( ! -r $1 \) ] || [ \( ! -d $2 \) ] || [ \( ! -w $2 \) ]
  6. then
  7.   echo "Error: Haz la llamada con dos argumentos (fichero y directorio) y asegurate que tienes permiso de lectura/escritura respectivamente"
  8.   exit 1
  9. else
  10.   cp $1 $2;cd $2;chmod 110 $1;echo "Instalación completa"  
  11.   exit 0
  12. fi
Advertisement
Add Comment
Please, Sign In to add comment