Ksh-88e shell array question

andrew.d.hay mvadh at cbnews.att.com
Thu Dec 20 00:07:40 AEST 1990


In article <9012190340.AA20465 at lilac.berkeley.edu>, lwv27 at CAS.BITNET writes:
> I am attempting to turn a ksh variable into an array and then back
> into the variable after manipulation.  Here is what I have:
> 
[]
> 
> The problem is that I cannot figure out how to get the colons back into
> the PATH.  What I want to be able to do is to null out entries all together,
> so they are not even present.  What I would REALLY like to do is to
> have something like an array 'shift' type mechanism I think!

here's what i do with TERMCAP:

set -A TERMCAP $(infocmp -C)
typeset -i BIT=1
while [[ BIT -le ${#TERMCAP[@]} ]]
do	TERMCAP="${TERMCAP%:? }${TERMCAP[$BIT]} "
	(( BIT += 1 ))
done
set -A TERMCAP "$TERMCAP"
export TERMCAP

hope this helps...

-- 
Andrew Hay		+------------------------------------------------------+
Ragged Individualist	| 	You just have _N_O idea!  It's the difference    |
AT&T-BL Ward Hill MA	|	between _S_H_O_O_T_I_N_G a bullet and _T_H_R_O_W_I_N_G it!     |
a.d.hay at att.com		+------------------------------------------------------+



More information about the Comp.unix.shell mailing list