Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Ksh Misbehaves - Needs The Nanny

RE: Ksh Misbehaves - Needs The Nanny

From: Post, Ethan <Ethan.Post_at_ps.net>
Date: Tue, 5 Apr 2005 16:03:26 -0500
Message-ID: <E5D2567DDF0D03428A15664A78CA473C026BC4@pscdalpexch02.perotsystems.net>


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

  1. X=3DIN ;; esac done

-----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

  1. X=3D3DIN ;; esac done

echo ${X}

X=3D3DOUT echo "1\n2\n3" > cat.file

cat cat.file | while read i
do

   case ${i} in

  1. X=3D3DIN ;; esac done

echo ${X}

--
http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 05 2005 - 17:07:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US