Description of problem: custom scripting written by users is failing under ksh but runs perfectly under bash. Version-Release number of selected component (if applicable): ksh-20050202-0.4E.4.x86_64 How reproducible: here are the scripts in question #!/bin/ksh typeset -i j=1 while [ $j -le 1000 ]; do ./test_ret.sh j=j+1 done echo The above script runs fine with /bin/bash as the shell. With /bin/ksh it fails quite often. Here is the script it is calling: #!/bin/ksh TEMP=/bb/data/oracle/logs/test_return.tmp TEMPLOG=/bb/data/oracle/logs/cmdout.tmp LOG=/bb/data/oracle/logs/test_return.log cat /dev/null > $LOG touch $TEMP #rm -f $TEMP > $TEMPLOG 2>&1 rm -f $TEMP > $TEMPLOG 2>&1 if [ ${?} -ne 0 ]; then echo echo "`date` - Command return non successful for rm -f $TEMP" | tee -a $LOG ls -l $TEMP | tee -a $LOG cat $TEMPLOG | tee -a $LOG else echo -n "." fi The user running these scripts is oracle:dba and this user has all the rights necessary to run this code. The same exact scripts with the bang path changed to /bin/bash runs perfectly. Steps to Reproduce: 1. see above 2. 3. Actual results: Script fails like this: Thu Jan 17 10:44:03 EST 2008 - Command return non successful for rm -f /bb/data/oracle/logs/test_return.tmp ls: /bb/data/oracle/logs/test_return.tmp: No such file or directory ......................................................................... ...................................... Expected results: The scripts should provide only periods as output. Additional info: Obviously these are test scripts written expressly to test a recurring issue with production script failures.
This has the same cause as in the bug #232640 and bug #426132. I have already a patch for them.
so does this mean that a working patch is forthcoming?
You may wish to test the packages from here: http://tsmetana.fedorapeople.org/ksh/el4-test/
This request was evaluated by Red Hat Product Management for inclusion, but this component is not scheduled to be updated in the current Red Hat Enterprise Linux release. If you would like this request to be reviewed for the next minor release, ask your support representative to set the next rhel-x.y flag to "?".
The test scripts run fine with the new shell... prior to installing the rpm we renamed the old ksh to ksh.old. When we change the bang path to the old ksh the scripts fail immediately. So on the surface this looks good. There are some other scripts (production) which need to run... we will wait a while and let them run and see what it looks like... but for now things look pretty good.
The updated package also seems to have fixed (*) some random stack faults I was getting on x86_64 el4. (src rpm rebuilt on x86_64 since there's only i386 at http://tsmetana.fedorapeople.org/ksh/el4-test/). (*) with ksh-20050202-0.4E.2, 5 consecutive runs on the same data resulted in 1 successful completion and 4 stack faults all at different places. With ksh-20050202-0.5E.4, 5 consecutive runs results in 5 successful completions.
*** Bug 444374 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2008-0704.html