cc: [email protected]
Subject: Re: [ast-users] code behavior change upgrading to ksh 93t+
--------
> After upgrading ksh (from version "s"?), at least one of my scripts is
> misbehavi
> ng. My system:
>
> $ print ${.sh.version}
> Version AJM 93t+ 2010-02-02
> $ uname -srvpio
> Linux 2.6.18-92.1.13.el5 #1 SMP Thu Sep 4 03:51:21 EDT 2008 x86_64 x86_64
> GNU/Li
> nux
>
>
> The following exemplifies the behavior.
>
> This works as expected:
>
> $ sed 's/^/Hello /' <(print "Fred" | sort)
> Hello Fred
>
> However, the following fails to capture the output of the above command in
> the v
> ariable "x", as it should.
>
> $ x="$(sed 's/^/Hello /' <(print "Fred" | sort))"
> Fred
> $ print "x: $x"
> x:
>
> If I leave out the " | sort", then the output is (correctly) captured in the
> var
> iable "x".
>
> $ x="$(sed 's/^/Hello /' <(print "Fred"))"
> $ print $x
> Hello Fred
>
> Is this a bug in ksh?
>
This was a bug in ksh93t+ that was fixed for ksh93u. You can pick up ksh93u
from the AST download site, http://www.research.att.com/sw/download/.
I will add this as a regression test so that it will not fail with a future
update.
David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users