Re: command to strip suffix in .sh script

2010-06-03 Thread George Davidovich
On Thu, Jun 03, 2010 at 11:11:16PM +0700, Anh Ky Huynh wrote: > On Wed, 02 Jun 2010 20:25:36 -0400 Vinny wrote: > > On 06/02/2010 04:30, Matthew Seaman wrote: > > > On 02/06/2010 09:24:01, Matthias Apitz wrote: > > > > Aiza wrote: > > > > > > > > > I have this code > > [snip] > > > > $ echo 'archiv

Re: command to strip suffix in .sh script

2010-06-03 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/06/2010 17:11:16, Anh Ky Huynh wrote: > On Wed, 02 Jun 2010 20:25:36 -0400 > Vinny wrote: >> On 06/02/2010 04:30, Matthew Seaman wrote: >>> archive_name=${fromarchive%-*} >> Thanks Matthew, that's really neat. It took me a long time >> to fin

Re: command to strip suffix in .sh script

2010-06-03 Thread Anh Ky Huynh
On Wed, 02 Jun 2010 20:25:36 -0400 Vinny wrote: > On 06/02/2010 04:30, Matthew Seaman wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On 02/06/2010 09:24:01, Matthias Apitz wrote: > >> El día Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiza > >> escribió: > >> > >>> I

Re: command to strip suffix in .sh script

2010-06-02 Thread Vinny
On 06/02/2010 04:30, Matthew Seaman wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/06/2010 09:24:01, Matthias Apitz wrote: El día Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiza escribió: I have this code [snip] $ echo 'archivename-201006021514.34.tar.gz' | sed 's/-.*$//

Re: command to strip suffix in .sh script

2010-06-02 Thread Polytropon
On Wed, 02 Jun 2010 16:15:22 +0800, Aiza wrote: > I have this code > > archive_name=`echo -n "${fromarchive}" | tr -c '[:alnum:]' _` > > ` is the key under Esc key and ' key is next to enter key. > > fromarchive value is archivename-201006021514.34.tar.gz > > I want to strip the suffix -20100

Re: command to strip suffix in .sh script

2010-06-02 Thread Adam Vande More
On Wed, Jun 2, 2010 at 3:24 AM, Matthias Apitz wrote: > El día Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiza escribió: > > > I have this code > > > > archive_name=`echo -n "${fromarchive}" | tr -c '[:alnum:]' _` > > > > ` is the key under Esc key and ' key is next to enter key. > > > > f

Re: command to strip suffix in .sh script

2010-06-02 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/06/2010 09:24:01, Matthias Apitz wrote: > El día Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiza escribió: > >> I have this code >> >> archive_name=`echo -n "${fromarchive}" | tr -c '[:alnum:]' _` >> >> ` is the key under Esc key and ' ke

Re: command to strip suffix in .sh script

2010-06-02 Thread Matthias Apitz
El día Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiza escribió: > I have this code > > archive_name=`echo -n "${fromarchive}" | tr -c '[:alnum:]' _` > > ` is the key under Esc key and ' key is next to enter key. > > fromarchive value is archivename-201006021514.34.tar.gz > > I want to

command to strip suffix in .sh script

2010-06-02 Thread Aiza
I have this code archive_name=`echo -n "${fromarchive}" | tr -c '[:alnum:]' _` ` is the key under Esc key and ' key is next to enter key. fromarchive value is archivename-201006021514.34.tar.gz I want to strip the suffix -201006021514.34.tar.gz from the archivename. The archivename can be up