🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1230

Re: Ayuda con Bash Script. Tratamiento de nombres de ficheros.

#1230
From: AnimAlf
Date: Tue, 28 Feb 2006 03:32
72 lines
3132 bytes
--=-uAiBiJfJePx5GFT8HtpY
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

El dt 28 de 02 del 2006 a les 01:56 +0000, en/na Manolo va escriure:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
>=20
> Hola. Espero que la pregunta este hecha en el sitio adecuado y del modo
> adecuado. A ver si me explico...
>=20
> Estoy currandome un script para convertir ficheros .wma a .ogg
> utilizando 'mplayer' y 'oggenc'.=20
>=20
> Declaro esta variable:
>=20
> NOM=3D`ls *0$cont*.wma|rev|cut -c 5-|rev`
>=20
> el resultado es el nombre de un fichero cortando la extension y el
> punto, osea cortando '.wav'
>=20
> 'echo $NOM' devuelve algo asi:

> 01 Walk on Hot Coals

Puedes reemplazar el espacio " " por "\ "
Se utiliza lo siguiente:
${var/Patron/Reemplazo}
Sustituiria la primera coincidencia de Patr=C3=B3n con Reemplazo
Para el reemplazo global ser=C3=ADa
${var//Patron/Reemplazo}

Te quedar=C3=ADa tal que as=C3=AD

echo ${NOM// /\\ }
01\ Walk\ on\ Hot\ Coals

> Ahora quiero hacer un 'mv audiodump.wav $NOM.wav' pero no me lo permite

NOM=3D${NOM// /\\ };
mv audiodump.wav $NOM.wav;

Saludos
--=20
AnimAlf AnimAlf@engendro.sytes.net=20
http://www.tinet.cat/~acl=20
Personal Experimental WebServer: http://www.engendro.sytes.net=20
LiNUX ReGiSteRED UseR #91326=20
PublicPGPkeyID 0xB3B41215=20
Is the truth out there?=20

Coalici=C3=B3n europea contra el correo comercial no solicitado:=20
http://www.euro.cauce.org/es

--=-uAiBiJfJePx5GFT8HtpY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iQCVAwUARAPDtx535IyztBIVAQKtZQP9EmldT+C9oktqpP69I+0Rxbh0g8ndFQDS
qEc7i/JFvDQfUDwqed1qbzeQegrLJ9fQth0qkdGJh+H/EemNK20gUFbqSDxK9wBK
56261OHOhmc10yVsa/eujfCHlXR2SXfw6k8VJ/MR/xFXc3QOxzwUxG+JEcSPY/i0
INocm6/ATQE=
=Uj6Q
-----END PGP SIGNATURE-----

--=-uAiBiJfJePx5GFT8HtpY--
Technical Details
Message-ID: <1141097399.31230.10.camel@general.engendro.sytes.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!telenews.teleline.es!not-for-mail
References: <t5OMf.170600$US.147751@news.ono.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,917cffdfe5a49207
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!telenews.teleline.es!not-for-mail
X-Trace-PostClient-IP: 80.32.76.249
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Ayuda con Bash Script. Tratamiento de nombres de ficheros.
From: AnimAlf <AnimAlf@engendro.sytes.net>
In-Reply-To: <t5OMf.170600$US.147751@news.ono.com>
References: <t5OMf.170600$US.147751@news.ono.com>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-uAiBiJfJePx5GFT8HtpY"
Organization: Is the truth out there?
Message-ID: <1141097399.31230.10.camel@general.engendro.sytes.net>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Lines: 73
Date: Tue, 28 Feb 2006 03:32:47 GMT
NNTP-Posting-Host: 10.20.31.4
X-Complaints-To: usenet@teleline.es
X-Trace: telenews.teleline.es 1141097567 10.20.31.4 (Tue, 28 Feb 2006 04:32:47 MET)
NNTP-Posting-Date: Tue, 28 Feb 2006 04:32:47 MET