From: Glynn Clements <glynn@gclements.plus.com>
To: MARG <lists@tuxdoit.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Cutting
Date: Sun, 11 Dec 2005 08:50:21 +0000 [thread overview]
Message-ID: <17307.59469.718445.904130@cerise.gclements.plus.com> (raw)
In-Reply-To: <439B6596.50104@tuxdoit.com>
MARG wrote:
> Hide like to extract the name and file verion of a tarball from its file
> 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
If the name is in a variable, e.g. $file, then:
$ file="qmail-1.03.tar.gz"
$ base="${file%.tar.gz}"
$ echo "$base"
qmail-1.03
--
Glynn Clements <glynn@gclements.plus.com>
prev parent reply other threads:[~2005-12-11 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-10 23:32 Cutting MARG
2005-12-10 23:51 ` Cutting Adrian C.
2005-12-11 8:50 ` Glynn Clements [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17307.59469.718445.904130@cerise.gclements.plus.com \
--to=glynn@gclements.plus.com \
--cc=linux-admin@vger.kernel.org \
--cc=lists@tuxdoit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.