Hello, there seams to be a serious bug in the code up to and including ksh93u+ (tested on Linux 32b/64b and AIX 5L 5.3 with ksh93s+ and ksh93u+).
The commands: trap 'print ERR trapped' ERR trap 'print USR1 trapped' USR1 trap 'print USR2 trapped' USR2 trap trap -p trap -p >&- trap -p 2>&- str=$(trap -p) ; print "str=$str" trap -p | cat >/tmp/test.txt ; cat /tmp/test.txt trap -p >/tmp/test.txt ; cat /tmp/test.txt str=$(trap -p ERR) ; print "str=$str" The commands with output and comments: $ trap -p trap -- 'print USR2 trapped' USR2 trap -- 'print USR1 trapped' USR1 trap -- 'print ERR trapped' ERR $ trap -p >&- $ trap -p 2>&- trap -- 'print USR2 trapped' USR2 trap -- 'print USR1 trapped' USR1 trap -- 'print ERR trapped' ERR $ str=$(trap -p) ; print "str=$str" # ERR missing str=trap -- 'print USR2 trapped' USR2 trap -- 'print USR1 trapped' USR1 $ trap -p | cat >/tmp/test.txt ; cat /tmp/test.txt # all missing $ trap -p >/tmp/test.txt ; cat /tmp/test.txt # OK, but not what I expect or want to use. trap -- 'print USR2 trapped' USR2 trap -- 'print USR1 trapped' USR1 trap -- 'print ERR trapped' ERR $ str=$(trap -p ERR) ; print "str=$str" str= $ I expect to be able to store the complete output of every trap in a string, not only in some file temporarily being used (which I have to remove later). Do you have a fix for the issue (binary for Linux 32b/64b and AIX 5L 5.3)? H. Schmied _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
