From: unpingco@mpl.ucsd.edu (Jose Unpingco)
To: zsh-users@math.gatech.edu (zsh)
Subject: lines as array elements
Date: Fri, 27 Jun 1997 15:38:18 -0700 (PDT) [thread overview]
Message-ID: <9706272238.AA12078@cryptica.UCSD.EDU> (raw)
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
next reply other threads:[~1997-06-27 22:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-06-27 22:38 Jose Unpingco [this message]
1997-06-28 6:03 ` Zoltan Hidvegi
1997-06-27 23:00 Steve Talley
1997-06-28 5:15 ` Geoff Wing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9706272238.AA12078@cryptica.UCSD.EDU \
--to=unpingco@mpl.ucsd.edu \
--cc=zsh-users@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).