Help me understand this!
Fairlight
fairlite at fairlite.com
Wed Jul 21 11:34:13 PDT 2004
This public service announcement was brought to you by Lerebours, Jose:
>
> for X in `cat filename`
> do
>
> echo "$X"
>
> done
>
> The displayed text is as follows
>
> FIELD1LN1
> FIELD1LINE1
> FIELD1LN2
> FIELD2LINE2
> FIELD1LN3
> FIELD2LINE3
>
> I am expecting to retain both fields side by side
> in $X. If I vi the file it looks fine. If I cat
> the file it looks fine ...
That's not going to work with 'for' in Bourne, or 'foreach' in csh. They
go by words, not lines.
If you can feed the file to STDIN from the command line, try using 'read'
to grab a whole line at a time, assuming you must (or want to) stick with
Bourne.
mark->
--
Bring the web-enabling power of OneGate to -your- filePro applications today!
Try the live filePro-based, OneGate-enabled demo at the following URL:
http://www2.onnik.com/~fairlite/flfssindex.html
More information about the Filepro-list
mailing list