On Wednesday 25 June 2008, Grant wrote:

> > This:
> >        j = basename $i .jpg
> > should be more like this:
> >        j=$( basename $i .jpg )
> >
> > Or:     j=${i%.jpg}
> >
> > That is, there must be no whitespace around the '='. And in order
> > to set j to the result of a command, use $( command ) or ` command
> > `.
>
> Worked perfectly, thanks a lot everyone.

Isn't there a little known and unused but very useful command that 
already does this? This type of usage often comes up on mailing lists 
and invariably someone mentions it after 20 posts or so, but I can 
never remember what it is. Used a lot like rename, but that's not it.


-- 
Alan McKinnon
alan dot mckinnon at gmail dot com

-- 
gentoo-user@lists.gentoo.org mailing list

Reply via email to