[LUG.ro] (no subject)

redondos lugro@lugro.org.ar
Thu, 22 Feb 2007 18:41:06 -0300


--Bn2rw/3z4jIqBvZU
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 22 2007 14:30, Luis Diaz wrote:
> Gente, organizando fotos descubri que las del celular no tienen datos
> EXIF, y la fecha es el nombre del archivo, y necesito si alguien me da
> una idea de como hacer un script en bash que re-ordene los datos del
> nombre del archivo a otro "formato de fecha", esto es:
>=20
> el archivo se llama 02-12-06_2235.jpg o sea q es una foto sacada el
> 2/12/06 a las 22:35 y tengo que cambiar de lugar los numeros y sacar
> el .jpg, ya que jhead los quiere en formato aaaa:mm:dd-hh:mm:ss

Algo rapidito en bash, sin validaci=F3n ni nada.

#!/bin/bash
for file in $@; do
        date=3D${file/_*/}; date=3D${date//-//}
        time=3D${file/*_/}; time=3D${time:0:2}:${time:2:2}
        # jhead ...
done

Ejemplo: 02-12-06_2235.jpg
redondos@refinery ~ $ file=3D"02-12-06_2235.jpg"; date=3D${file/_*/}; date=
=3D${date//-//}; time=3D${file/*_/}; time=3D${time:0:2}:${time:2:2}; echo $=
date $time
02/12/06 22:35

> gracias!

De nada. Saludos.

--=20
redondos

--Bn2rw/3z4jIqBvZU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.2 (GNU/Linux)

iD8DBQFF3g3yJZ/yCc25j3IRAgXWAKCv6RL85uTNyjHe9UdzoBszgSxlVACgqI8b
IuKelikBXTi4+zlBBzydiIY=
=v8FJ
-----END PGP SIGNATURE-----

--Bn2rw/3z4jIqBvZU--