[ale] stripping filename extension in bash

David S. Jackson deepbsd at earthlink.net
Sun Dec 1 12:51:52 EST 2002


On Sat, Nov 30, 2002 at 07:01:14PM -0500 Bob <rstickel at bellsouth.net> wrote:
> How about
> 
> n=$(( $(expr match "$i" '.*\.') - 1 ))
> [ $n -gt 0 ] && i=${i:0:$n}

Hey, this is spiffy.  Two goodies learned from this: man expr and
a new use for ${var:int:int}

Thanks!  :-)

-- 
David S. Jackson                        dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Decorate your home.  It gives the illusion that your
life is more interesting than it really is.
		-- C. Schulz
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list