Re: Quick Help...Shell script...
Posted in 2000
Try doing something like this:
cat file | while read i
do
echo $i
done
-Kevin
"Prasad Mahale" <gs0528@hotmail.com> on 08/23/2000 02:09:43 PM
To: informix-list@iiug.org
cc: (bcc: Kevin Dewsnup/AGInc)
Subject: Quick Help...Shell script...
Note: Some recipients have been dropped due to syntax errors.
Please refer to the "$AdditionalHeaders" item for the complete headers.
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.