1 |
On Wednesday 25 June 2008, Grant wrote: |
2 |
|
3 |
> > This: |
4 |
> > j = basename $i .jpg |
5 |
> > should be more like this: |
6 |
> > j=$( basename $i .jpg ) |
7 |
> > |
8 |
> > Or: j=${i%.jpg} |
9 |
> > |
10 |
> > That is, there must be no whitespace around the '='. And in order |
11 |
> > to set j to the result of a command, use $( command ) or ` command |
12 |
> > `. |
13 |
> |
14 |
> Worked perfectly, thanks a lot everyone. |
15 |
|
16 |
Isn't there a little known and unused but very useful command that |
17 |
already does this? This type of usage often comes up on mailing lists |
18 |
and invariably someone mentions it after 20 posts or so, but I can |
19 |
never remember what it is. Used a lot like rename, but that's not it. |
20 |
|
21 |
|
22 |
-- |
23 |
Alan McKinnon |
24 |
alan dot mckinnon at gmail dot com |
25 |
|
26 |
-- |
27 |
gentoo-user@l.g.o mailing list |