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

lines as array elements



hi,

I have  a file that looks like this:

    -503  306 -498  428
    -500  435 -501  588
    -497  440 -501  593
    -505  451 -502  601
    -510  324 -511  454
    -505  328 -511  459
    -506  333 -509  464
    -520  342 -492  463

what I'd like to do is get each line into an array element like

x[1]="-503  306 -498  428"

up to

x[8]="-520  342 -492  463"

I've tried x=(`cat file`) but that splits on the spaces between the
numbers. I've looked at the IFS variable and tried to change it to
newline but that doesn't work as expected.

Thanks. 

-- 
Thank you for your time and consideration.  

             _ - - - _                             
           /)-  - _     _                          
          / |_o_/  -       _        
              \__  -          _        
                \ \_              -   _  _  _  _   _  _  _  _  _       
                 _                      
   __ __ _ _  -        
Jose Unpingco                                Mail Code ECE 0407
                                             WK# (619) 534-5904



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