Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: lines as array elements



On 28 Jun 1997 09:05:49 +1000, Steve Talley wrote:

Just a couple of optimisations:

:#!/bin/zsh
: 
:IFS="
:"
: 
:i=1;
:for line in `cat file`

 for line in `< file`

:do
:    x[$i]=$line
:    i=`expr $i + 1`

     let i++

:done
-- 
Geoff Wing [mason@xxxxxxxxxxxxxxx]   Technical Manager
  Phone    : +61-3-9818 2977         PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788         Web : <URL:http://www.primenet.com.au/>
  Mobile   : 0412 162 441



Messages sorted by: Reverse Date, Date, Thread, Author