From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Adrian C." Subject: Re: Cutting Date: Sun, 11 Dec 2005 01:51:22 +0200 Message-ID: <7.0.0.16.0.20051211015028.01c59648@foo.teinet.ro> References: <439B6596.50104@tuxdoit.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <439B6596.50104@tuxdoit.com> References: <439B6596.50104@tuxdoit.com> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="iso-8859-1"; format="flowed" To: linux-admin@vger.kernel.org Hello. root@ludmila:~# ls *tar.gz NeTraMet43.tar.gz chkrootkit.tar.gz=20 htb_tools-0.2.5.tar.gz=20 live555-latest.tar.gz mod_fastcgi-2.4.2.tar.gz tcpdump-3.9.1-096.ta= r.gz Smarty-2.6.8.tar.gz=20 clamav-0.87.1.tar.gz iftraf-1.0.tar.gz=20 ltraf-0.2.0.tar.gz phpshell-latest.tar.gz tcptrace-6.6.7.tar.g= z Template-Toolkit-2.14.tar.gz=20 exponent-0.95.0.tar.gz knocker-0.7.1.tar.gz=20 ltraf-0.2.1-pre1.tar.gz stak-1.0b1.tar.gz teapop-latest.tar.gz root@ludmila:~# ls *tar.gz | awk -F".tar" '{print $1}' NeTraMet43 Smarty-2.6.8 Template-Toolkit-2.14 chkrootkit clamav-0.87.1 exponent-0.95.0 htb_tools-0.2.5 iftraf-1.0 knocker-0.7.1 live555-latest ltraf-0.2.0 ltraf-0.2.1-pre1 mod_fastcgi-2.4.2 phpshell-latest stak-1.0b1 tcpdump-3.9.1-096 tcptrace-6.6.7 teapop-latest Enjoy. --Adrian. At 01:32 AM 12/11/2005, MARG wrote: >Hi, > >Hide like to extract the name and file verion of a tarball from its fi= le >name in a bash script. > >Example: mysql-5.1.15.tar.bz2 > >I want to get only the "mysql-5.0.15" part. > >How can i get this. >Note: the number of dots, varies. >Example: qmail-1.03.tar.gz > >Only has one dots before the "tar.gz". >MySQL has two. > >Any help would be apreciated. > >Warm regards, >M=E1rio Gamito >- >To unsubscribe from this list: send the line "unsubscribe linux-admin"= in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html