ksh93 different results using -x option


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh93 different results using -x option
# 1  
Old 10-26-2011
Question ksh93 different results using -x option

This problem seems to be specific to ksh93.

If you run with set -x some scripts don't work properly. For example:

Code:
$ cat ksh.test2
[[ 6 > 8 ]] && print FUBAR! || print OK!
$
$ /bin/ksh93 ksh.test2
OK!
$ /bin/ksh93 -x ksh.test2
+ [[ 6 > 8 ]]
+ print FUBAR!
FUBAR!
$

Trying to find out why this is happening, as it makes it hard to debug some scripts when things like this fail with the "-x" option set. Haven't found anything similar to it searching the web yet.

Last edited by radoulov; 10-26-2011 at 06:07 PM.. Reason: Code tags!
# 2  
Old 10-26-2011
I cannot reproduce this with Version JM 93u 2011-02-08:

Code:
zsh-4.3.12[t]% ksh93 ksh.test2
OK!
zsh-4.3.12[t]% ksh93 -x ksh.test2
+ [[ 6 > 8 ]]
+ print OK!
OK!
zsh-4.3.12[t]% ksh93 -c 'print ${.sh.version}'
Version JM 93u 2011-02-08

It could be a bug, you may try to install a more recent version.
# 3  
Old 10-26-2011
Sorry - I should have clarified that we see this using ksh93e. Our system is frozen on this release, and it's reproducable on Solaris 8 and Solaris 10 systems. I just figured someone else had to of seen this at some point, and yet I can't find anyone mentioning it on the web.

I do not see the problem if I run it with ksh93r version, which we have installed, but isn't our default ksh.
Code:
lsslogin1$ ls -l /bin/ksh93e
lrwxrwxrwx   1 root     other         19 Oct 10  2009 /bin/ksh93e -> /opt/ksh93e/bin/ksh
lsslogin1$ ls -l /opt/ksh93e/bin/ksh
-rwxr-xr-x   1 root     bin       794624 Feb 28  2000 /opt/ksh93e/bin/ksh
lsslogin1$

Has anyone else seen this problem using ksh93e, and if so, is there a patch or workaround for it? Thank you!


Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by Franklin52; 10-27-2011 at 03:18 AM.. Reason: Please use code tags, thank you
# 4  
Old 10-27-2011
Just an idea: on Solaris you may have /usr/dt/bin/dtksh. It's a ksh93, but I don't recall the exact version.
# 5  
Old 10-27-2011
Thanks, but I don't think this is the problem. We do have the dtksh on our system, but we are not using it. If I run the dtksh with the -x option, it works OK. The problem is with the ksh93e version - just wish we knew why the "-x" option doesn't produce the same output with ksh93e.

Code:
lsslogin1$ ls -l /usr/dt/bin/*ksh*  /opt/ksh93e/bin/ksh
-rwxr-xr-x   1 root     bin       794624 Feb 28  2000 /opt/ksh93e/bin/ksh
-r-xr-xr-x   1 root     bin       740756 Jan 22  2005 /usr/dt/bin/dtksh
lsslogin1$

# 6  
Old 10-27-2011
I understand, I was just saying, that you could use dtksh as a workaround.
You could contact David Korn (and the other current KornShell developers) directly on the ast-* mailing lists.


Last edited by radoulov; 10-30-2011 at 05:05 PM..
# 7  
Old 10-27-2011
Thanks for the suggestion - I know we have workarounds, but it just complicates things when you have to have developers change the ksh just for debugging purposes only, and then change it back for real building/testing/execution.

I was just hoping someone could explain why using the "-x" or "set -x" option with ksh93e doesn't always work right.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Ksh93/AIX compatibility

Hi everyone ! Im trying to know from wich version of AIX KSH93 is available ? Internet tell me 6.x and 7.x AIX are available, bue what about 5.x ? Is KSH93 available on AIX 5.x ? Is it the same way to manipulate variables as KSH93 on 7.x ? Thanks for your support and have a nice day ! (2 Replies)
Discussion started by: majinfrede
2 Replies

2. UNIX for Advanced & Expert Users

Ksh93 on Linux compatible with ksh93 on AIX

Hi Experts, I have several shell scripts that have been developed on a Linux box for korn ksh93. If we want to run this software on an AIX 6.1 box that runs ksh88 by default can we just change the she-bang line to reference /bin/ksh93 which ships with AIX as its "enhanced shell" to ensure... (6 Replies)
Discussion started by: Keith Turley
6 Replies

3. Shell Programming and Scripting

Can ctag and cscope support recording search results and displaying the history results ?

Hello , When using vim, can ctag and cscope support recording search results and displaying the history results ? Once I jump to one tag, I can use :tnext to jump to next tag, but how can I display the preview search result? (0 Replies)
Discussion started by: 915086731
0 Replies

4. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

5. UNIX for Dummies Questions & Answers

ksh93 newline character problem

Hi , I am working on Linux, with ksh93 installed. The following statement echo \\n just prints \n on this shell. However on pdksh echo \\n gives a blank new line as a output. What is the correct way of printing a new line character on the ksh93? (4 Replies)
Discussion started by: neeto
4 Replies

6. UNIX for Advanced & Expert Users

Install ksh93 for cygwin

Hi, Does anyone know where can I get ksh93 for installation on CYGWIN. Thanks? (1 Reply)
Discussion started by: devtakh
1 Replies

7. Shell Programming and Scripting

Performance degradation with KSH93

Hi, I have a script that calls an external program to perform some calculations and then I read with "grep" and "sed" values from the output files. I've noticed that performance of KSH93 degrades with every iteration. The output files are all the same size, so I don't understand why after the... (2 Replies)
Discussion started by: i.f.schulz
2 Replies

8. Shell Programming and Scripting

ksh88 or ksh93

Hi all! Does anybody know how can I check if any UNIX installation has implemented ksh88 or ksh93? Thanks in advance. Néstor. (3 Replies)
Discussion started by: Nestor
3 Replies

9. Shell Programming and Scripting

ksh93 deprecation...

Any means of running ksh93 in a ksh88-mode? Might sound odd, but I want/need to restrict U/Win-developed scripts to correspond to the ksh88 version on my Solaris environment(s). Thanks. (2 Replies)
Discussion started by: curleb
2 Replies

10. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies
Login or Register to Ask a Question