[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash scripts misrepresenting white space



On Thu, Dec 25, 2003 at 09:32:05PM -0500, Johann Koenig wrote:
> I tried reading the man page and the BASH Programming HOWTO, but I
> couldn't really get what I needed out of either.

A friend of mine wrote an article on common mistakes in shell
programming, which may help you:

  http://www.greenend.org.uk/rjk/2001/04/shell.html

> Oh well, with you're example to guide me, I got it right. If anybodies
> willing, please look over the attached script and give any comments
> that come to mind.

I haven't had a chance to look in detail, but the tool you want to strip
extensions is basename. Alternatively, look at the ${parameter%word}
syntax under "Parameter Expansion" in bash(1).

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: