ksh:bug-or-feature

ksh:bug-or-feature

Post by Dr. Reinhard Corr [RHR » Sat, 27 Aug 1994 15:38:39



Why does the ksh shell-script abort at line #9
and does not continue like in line #5?

Both lines have errors. So I expect a returncode
unequal zero. In line #6 I can see the returncode of
the action of line #5. But line #10 will never reached
to show the returncode of line #9, because the shell-script abort.
There is no change in behavior, if you set "set +o errexit".

script: --------------------------------------------

#!/bin/ksh

echo started                               #3
typeset -ir inum1=5                        #4
unset inum1                                #5
echo $?                                    #6
echo continued                             #7
typeset -i inum2=5                         #8
inum2=xyz                                  #9
echo $?                                    #10
echo ended                                 #11

 
 
 

1. ksh:bug or feature

Why does the shell script below abort at line #9 and does not
continue with an error return code like in line #5?

Both lines (#5 and #9) have an error. But why an abort and not
a return with a return code unequal zero?
The option "set +o errexit" does not change that behavior.

Thank you for an idea.
Reinhard Corr

script:----------------------------------------------------
#!/bin/ksh

echo started                               #3
typeset -ir inum1=5                        #4
unset inum1                                #5
echo $?                                    #6
echo continued                             #7
typeset -i inum2=5                         #8
inum2=xyz                                  #9
echo $?                                    #10
echo ended                                 #11

2. NT clock drives me crazy

3. ksh: expression eval feature or bug?

4. JAVA

5. ksh bug or feature

6. Running apache web server for the first time on MKLinux

7. ksh closes exec'd fds for external programs: bug or feature?

8. LTT for 2.5.43 9/10: MIPS trace support

9. work around ksh feature in other shells

10. bash feature in ksh

11. Wanted: emulation of csh's "set notify" feature in ksh

12. Obsolescent ksh features

13. Command line editing features in ksh