Ksh-88e shell array question

lwv27 at CAS.BITNET lwv27 at CAS.BITNET
Wed Dec 19 13:36:00 AEST 1990


I am attempting to turn a ksh variable into an array and then back
into the variable after manipulation.  Here is what I have:

==== Cut here ====

#! /bin/ksh


# Now convert this into an array

IFS=":" ; export IFS

set -A tbl $PATH

size=${#tbl[*]}

i=0
while [ $i -lt $size ] ; do
        echo "Table element $i is ${tbl[$i]}"
        ((i+=1))
done

lst="${tbl[*]}"
lst2="${tbl[@]}"
echo $lst
echo $lst2

exit 0

=== Cut Here ===

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!
--
Larry W. Virden                 UUCP: osu-cis!chemabs!lwv27
Same Mbox: BITNET: lwv27 at cas    INET: lwv27%cas.BITNET at CUNYVM.CUNY.Edu
Personal: 674 Falls Place,   Reynoldsburg,OH 43068-1614
America Online: lvirden



More information about the Comp.unix.shell mailing list