This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to extract suffix from a filename?


There are a few possibilities.  Which is best for you depends on your
system.  Both bash and tcsh/csh have methods built in for chopping up
environment or shell variables.  You could also use sed in a pipeline if you
can't count on the shell you call having those abilities.

For bash, look in the manpage under "Parameter Expansion".  For tcsh, look
in the manpage for "modifiers".
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: "malcolm.boekhoff" <malcolm.boekhoff@actfs.co.uk>
To: "Cygwin News Group" <cygwin@sources.redhat.com>
Sent: Tuesday, June 26, 2001 02:38
Subject: How to extract suffix from a filename?


> Okay, it's a silly question - how can I extract the suffix from a file
> name (I know I can use "basename" and "dirname" to get the file and
> directory components)?



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]