Array definition results to erratic behaviour with set command in ksh shell.

Solution Verified - Updated -

Issue

  • After defining an array of 1 value, following behaviour is noticed in ksh shell:
    1) On one session, type the set command and session terminates; as shown below:
[qs402@effraie1]:/ > set -A ARRAY VALUE
[qs402@effraie1]:/ > set
Connection to effraie1 closed.

2) on another session, filter the result by the strings command the result is not correct:

[qs402@effraie1]:/ > set -A ARRAY VALUE
[qs402@effraie1]:/> set | strings
_=VALUE
[qs402@effraie1]:/> 

3) Result of set command should be as below + Array definition:

[qs402@effraie1]:/> set
_=0022
COLORS=/etc/DIR_COLORS
consoletype=pty
DISPLAY=localhost:29.0
ENV='$HOME/.kshrc'
EUID=837
FCEDIT=/bin/ed
G_BROKEN_FILENAMES=1
HISTCMD=2
HISTSIZE=1000
HOME=/export1/home/qs402
HOSTNAME=effraie1
IFS=$' \t\n'
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
LC_COLLATE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINENO=1
LOGNAME=qs402
LS_COLORS=no='00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'
MAIL=/var/spool/mail/qs402
MAILCHECK=600
OPTIND=1
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
PPID=3060
PS1='$LOGNAME@$HOSTNAME:[$PWD]$ '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/
RANDOM=18975
SECONDS=1.788
SHELL=/bin/ksh
SSH_CLIENT='192.168.105.36 50377 22'
SSH_CONNECTION='192.168.105.36 50377 10.254.217.166 22'
SSH_TTY=/dev/pts/14
TERM=dtterm
TMOUT=0
UID=837
USER=qs402

Environment

  • Red Hat Enterprise Linux 5
  • ksh

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content