Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Ksh Misbehaves - Needs The Nanny
One small change is required, I changed cat.file to...
1 4
2
3
If you want it to read the while line instead of breaking 1 and 4 into two reads you need to reassign the IFS
> IFS=3D
> for i in $(cat cat.file);do
> echo $i
> done
1 4
2
3=20
-----Original Message-----
From: Kevin Lange [mailto:klange_at_ppoone.com]=20
Sent: Tuesday, April 05, 2005 3:51 PM
To: Post, Ethan; oracle-l_at_freelists.org
Subject: RE: Ksh Misbehaves - Needs The Nanny
Try
echo "1\n2\n3" > cat.file
for i in `cat cat.file`
do
case ${i} in
-----Original Message-----
From: Post, Ethan [mailto:Ethan.Post_at_ps.net]
Sent: Tuesday, April 05, 2005 3:42 PM
To: oracle-l_at_freelists.org
Subject: Ksh Misbehaves - Needs The Nanny
On Sun I get...
IN
IN
On AIX I get...
IN
IN
On webhost (?LINUX? I suppose) I get...
IN
OUT
Arhhhhhhhhgggg!!!!!
#!/bin/ksh
X=3D3DOUT
for i in 1 2 3
do
case ${i} in
echo ${X}
X=3D3DOUT echo "1\n2\n3" > cat.file
cat cat.file | while read i
do
case ${i} in
echo ${X}
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Apr 05 2005 - 17:07:38 CDT