Article View: es.comp.os.linux.programacion
Article #16100Re: Un peque�o script
From: Ignacio Arenaza
Date: Sun, 07 May 2000 00:00
Date: Sun, 07 May 2000 00:00
53 lines
2179 bytes
2179 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "Miguel" == Miguel Angel <falconmfm@NOSPAMyahoo.com> writes:
Miguel> Pues bien la idea es crear un scrip en ksh o bash que sea
Miguel> capaz de saber en que mes estamos quitarle 1 y coger su
Miguel> directorio con un tar y pasarlo a un diquete , la funcion
Miguel> date permite obtener el mes pero con letras "Feb" y el a�o
Miguel> con 4 digitos de modo que no acierto a resolver bien el
Miguel> nombre del directorio .
Ahi va algo para Bash 2.x (puede que funcione con 1.x pero no estoy
seguro):
declare -a meses
meses=( [1]="ENE" [2]="FEB" [3]="MAR" ....... [12]="DIC" )
anyo=`date +%y`
numero_mes=$[`date +%m` - 1]
if test ${numero_mes} -eq 0
then
numero_mes=12
if test ${anyo} -eq 00
then
anyo=99
else
anyo=$[$anyo - 1]
fi
fi
mes=${meses[${numero_mes}]}
nom_fich=${mes}_${anyo}
tar ....
mount .... /floppy
cp .... /floppy
umount /floppy
Saludos. I�aki.
- --
Get PGP/GPG Keys at http://personales.jet.es/inaki.arenaza/pgpkey.html
A proud member of GULA - http://gula.jet.es/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.4 and Gnu Privacy Guard
iD8DBQE5FMeDZXLnGT1HLgcRApxOAJ9xw87l6zeG5/MhZk+oOBVVW/3PtwCfZHnP
iPK/DAd7ac13GID5K23r60M=
=vOJk
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<877ld7gn7e.fsf@eb2ebu.ampr.org>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8f16u0$at$1@talia.mad.ttd.net>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,f661e828859b35a7 X-Google-Attributes: gidf86c8,public From: Ignacio Arenaza <inaki.arenaza@jet.es> Subject: Re: Un peque�o script Date: 2000/05/07 Message-ID: <877ld7gn7e.fsf@eb2ebu.ampr.org> X-Deja-AN: 620363260 Content-Transfer-Encoding: 8bit References: <8f16u0$at$1@talia.mad.ttd.net> Organization: Servidor NNTP de eb2ebu.ampr.org Content-Type: text/plain; charset=iso-8859-1 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.3 Mime-Version: 1.0 Newsgroups: es.comp.os.linux.programacion