[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ¿O.T? Bash Scripting



El Wed, Jan 19, 2005 at 04:51:39PM +0100 Santiago Vila ha dit:

> On Wed, 19 Jan 2005, Txente wrote:
> 
> > Pretendo comprimir con Gzip todos los archivos que cuelgan de un determinado
> > direrctorio (/var/proyectos) y para ello he ido averiguando un script...
> > ===========================================================
> > for each in $(find /var/proyectos/* | grep -v .gz);
> > do
> >   if [ -f $each ]
> >   then
> >      echo $each
> >      gzip -9f $each
> >   fi
> > done;
> > ===========================================================
> 
> gzip -r9 /var/proyectos/*

tiene el problema que volvería a comprimir los ficheros ya
comprimidos, por eso txente ha puesto grep -v .gz (que por cierto
debería ser '\.gz$' para no excluir ficheros como 'foogzbar.txt')

m.

-- 
            Nothing is more despicable than respect based on fear
                              (Albert Camus)

           ( ( ( i ) ) )  http://indymedia.org  ( ( ( i ) ) )
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver keys.indymedia.org --recv-keys B9A88F6F           `-

Attachment: signature.asc
Description: Digital signature


Reply to: