Subject: Re: ksh bug?
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 09/13/2006 19:39:31
In article <20060913184045.GA15526@moray.salmi.ch>,
Jukka Salmi <j+nbsd@2006.salmi.ch> wrote:
>Hi,
>
>which shell is right?
>
>$ cat reldate
>echo "`cut -d\\\" -f2 reldate.h`"
>
>$ cat reldate.h
>const char *ReleaseDate = "2006-09-08";
>
>$ ksh reldate
>reldate: no closing quote
>
>$ sh reldate
>2006-09-08
>
>$ bash reldate
>2006-09-08
>
>
>Hints are welcome...
You should stop using `` and always use $() instead:
- `` does not nest
- variable expansion semantics are not well defined in ``
$ cat reldate
echo "$(cut -d\" -f2 reldate.h)"
works in all 3 shells.
christos