Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Quick script request
Date: Wed, 25 Jun 2008 20:42:24
Message-Id: 200806252242.47674.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] Quick script request by Grant
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

Replies

Subject Author
Re: [gentoo-user] Quick script request Daniel Iliev <daniel.iliev@×××××.com>