🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Capturar ultimo caracter de una linea

#1163
From: Han Solo
Date: Tue, 07 Mar 2006 16:01
35 lines
1941 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

speeter <speeter@terra.es> writes:

> Hola a todos
>
> Estoy haciendo un script en bash y necesito capturar el ultimo
> caracter de una linea, en una variable.
>
> Alguna idea?

Seguro que se puede hacer mejor. A mīŋŊ me gusta el perl...

echo "Esto es una cadena de prueba"|perl -e 'while (<>){/(.)$/;print "$1\n"}'

Un Saludo
- -- 
Han Solo
The Rebel Alliance

Emacs is not on every system

So what? [...] Do you tell your administrative people to stick with
notepad.exe? Do you tell your fat kids they can only have the crummy
games that come with their video games or plain dress that comes with
Barbie?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFEDa384FjpJaPEp20RAjltAKCYynsa2dLanUWiRQ4I8PG8iT3sQQCeMMuw
x/FRH6Rs3cEOTdvMuhWnHP8=
=fc8Z
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <86fylu1c01.fsf@tatooine.ietcc.csic.es>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.newsland.it!x-privat.org!tatooine.ietcc.csic.es!news
References: <xxhPf.741242$kp.5245523@telenews.teleline.es>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,7b333a468341e8d8
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,ASCII
From: Han Solo <hsolo@escomposlinux.org>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Capturar ultimo caracter de una linea
References: <xxhPf.741242$kp.5245523@telenews.teleline.es>
X-Draft-From: ("es.comp.os.linux.programacion" 6586)
Message-ID: <86fylu1c01.fsf@tatooine.ietcc.csic.es>
User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:6QMoDJG8MQvbcLP83FRFDVn4u4s=
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: $$5ilnja$xievw37t.x-privat.org
Organization: X-Privat NNTP Server - http://www.x-privat.org
Lines: 35
X-Authenticated-User: $$gpbz944x1sozec1ugmi7l
X-Complaints-To: abuse@x-privat.org
Date: 7 Mar 2006 17:01:17 +0100
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.newsland.it!x-privat.org!tatooine.ietcc.csic.es!news