set command shows erratic behaviour with array definition is ksh shell
Issue
- After defining an array of 1 value, set command behaves erratic as described below:
1) On one session, define an array and type set command; it terminates the session as shown below:
[abc@xyz]:/ > set -A ARRAY VALUE
[abc@xyz]:/ > set
Connection to effraie1 closed.
2) On another session, filter the result by the strings command and the result is shown below:
[ab@xyz]:/ > set -A ARRAY VALUE
[abc@xyz]:/> set | strings
_=VALUE
[abc@xyz]:/>
3) Type set command without defining an array, result should be as shown below + Array definition (If defined):
[abc@xyz]:/> 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 (ksh-20080202-14.el5)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.