[ale] echo filename (without extension)

Geoffrey esoteric at 3times25.net
Tue Dec 17 17:54:43 EST 2002


for fn in *;do

echo ${fn%.*}
done

will strip anything following the tailing '.'

your assignment, how does this differ from :


echo ${fn%%.*}


Michael D. Hirsch wrote:
> On Tuesday 17 December 2002 05:03 pm, Christopher Bergeron wrote:
> 
>>>echo `basename $i`
>>
>>hrm, that one doesn't seem to work:
>>
>>[root at www pictures]$ echo `basename Mvc-382f.jpg`
>>Mvc-382f.jpg
> 
> 
> if you know it ends in ".jpg" you can do
> 	basename $i .jpg
> But if you don't then you need to be trikier with regexps.
> 
> Michael
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> 

-- 
Until later: Geoffrey		esoteric at 3times25.net

The latest, most widespread virus?  Microsoft end user agreement.
Think about it...

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list