Ksh-88e shell array question

Wm E. Davidsen Jr davidsen at sixhub.UUCP
Thu Dec 20 14:35:59 AEST 1990


  Well, when you have the final array of values...

LIM=${A[*]}
n=1
PATH=${A[0]}
while [ $n -lt $LIM ]; do
  PATH=$PATH:${A[$n]}
  let n=n+1
done


- or -

PATH=$(echo ${A[*]} | tr " " ":")

which is a lot simpler, but probably slower because it runs a process
instead of all being in ksh.

Let me know if one of these helps.
-- 
bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.unix.shell mailing list