I've observed that the last command in a pipeline causes a "Exec format" error for the ksh93u+ and earlier versions in a Solaris environment.
Here's a reproducible test case. root@S11.2_FCS:~# echo ${.sh.version} Version AJM 93u+ 2012-08-01 root@S11.2_FCS:~# echo "abcdefg" | grep abc > `hostname`_test grep: grep: cannot execute [Exec format error] This issue is not present in the 93v- version as given below. root@S11.2_FCS:~# echo ${.sh.version} Version AIJMP 93v- 2013-10-08 root@S11.2_FCS:~# echo "abcdefg" | grep abc > `hostname`_test root@S11.2_FCS:~# cat S11.2_FCS_test abcdefg root@S11.2_FCS:~# I searched around and found some references to the same issues, but couldn't find any fixes/patches mentioned. http://lists.research.att.com/pipermail/ast-developers/2008q4/000347.html https://access.redhat.com/solutions/23995 https://discussions.apple.com/thread/2544796?tstart=0 https://www.mail-archive.com/ast-users@lists.research.att.com/msg00890.html The issue seems to be happening because the posix_spawn() for "grep" fails because one of the "posix_spawn_attributes" is invalid, most probably because it sets a invalid process group id( the first command in the pipeline which has already exited) . This causes posix_spawn() to return EPERM causing ksh to interpret it as a script causing the "Exec format" error. I tried to look into the "93v-" source code changes, but I'm not able to isolate a patch/fix from that. I see that the spawnveg method has been replaced with spawnvex and some other changes which look relevant. If someone has a patch for the earlier versions, please let me know. Thanks, Lijo
_______________________________________________ ast-developers mailing list ast-developers@lists.research.att.com http://lists.research.att.com/mailman/listinfo/ast-developers