> $ fn=foo.c ; mv $fn ${fn%.c}.o
>
> (Ideally I wouldn't need that semicolon there, but it doesn't appear to
> work that way).
I screwed up with this a little while ago and nearly released some
code that did this
a=b
a=c c=$a
echo $c
In your case (without the ``;'') the setting of fn is only done in
the environment of ``mv'' and not in the shells own environment (not
even temporarily).
I'm not clear as to whether mine should really print ``b'' or ``c''.
It seems that (a)sh and (the real) ksh print ``b'', and bash and pdksh
print ``c'' :-/
--
Brian <[EMAIL PROTECTED]> <brian@[uk.]FreeBSD.org>
<http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message