RE: Quick Help...Shell script...
Posted in 2000
Try:
cat TABLE.OUT |
while read i
do
# stuff you want to do
done
So what's wrong with awk (sed, etc?) Or perl?
> -----Original Message-----
> From: Prasad Mahale [SMTP:gs0528@hotmail.com]
> Sent: Wednesday, August 23, 2000 4:10 PM
> To: informix-list@iiug.org
> Subject: Quick Help...Shell script...
>
> Hi All,
> Pl help me to complete this shell script..
>
> I have a file - TABLE.OUT
> create table patient
> (
> med_rec_num char(20) not null ,
> last_name char(25) not null ,
> first_name char(15),
> initial char(1),
> ...>
> If i say -
>
> for i in `cat TABLE.OUT`
> do
> echo $i
> done
>
> It displays result as -
> create
> table
> patient
> (
> ...
>
> I want variable i to hold one line at a time instead of one word.
> e.g. i="create table patient"
>
> I am expecting output like-
>
> create table patient
> (
> med_rec_num char(20) not null ,
> last_name char(25) not null ,
> first_name char(15),
> ...>
> I want to process each line further in shell. (not in awk!)
>
> Any trick?
>
>
> Thanks
> Prasad
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.