Home » Infrastructure » Linux » How to get READ command working in LINUX. (AIX and LINUX)
How to get READ command working in LINUX. [message #526533] Tue, 11 October 2011 08:51 Go to next message
shamsh_pervaiz
Messages: 22
Registered: September 2005
Location: bangalore
Junior Member
Hello experts,

I 'm new to scripting.
I was trying one script which has to be common and be executed both on AIX and LINUX.

I have the input to be split into 2 variables, so I tried READ command in AIX and it is working fine as below:
AIX
---

>echo "ABC DEF" | read X Y; echo "X value="$X; echo "Y value="$Y;
X value=ABC
Y value=DEF


Where as when I try the same on LINUX, method same as AIX does not work, but works with "WHILE READ".:
LINUX
-----

>$ echo "ABC DEF" | read X Y; echo "X value="$X; echo "Y value="$Y;
X value=
Y value=

>$ echo "ABC DEF" | while read X Y; do echo "X value="$X; echo "Y value="$Y;done
X value=ABC
Y value=DEF

CAN ANY ONE HELP ME IN RESOLVING THE ISSUE ON LINUX. I CAN NOT USE "WHILE READ" AS THIS INCLUDES A LOT OF OTHER CODE WHICH CAN NOT BE PUT IN BETWEEN "DO" AND "DONE".

WHAT IS THE REASON "READ" COMMAND ON LINUX DOES NOT WORK IN SAME PASSION AS AIX.

PLEASE HELP.

Thanks in advance,
Shamsh
Re: How to get READ command working in LINUX. [message #526559 is a reply to message #526533] Tue, 11 October 2011 10:03 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This question bears no real connection with Oracle.
Please find a more appropriate forum.
The topic is locked.
If I'm wrong, please, PM me (or report this message to a moderator, explain why you think it should be unlocked and it might be done).

Also read and follow OraFAQ Forum Guide.

Regards
Michel

[Updated on: Tue, 11 October 2011 10:03]

Report message to a moderator

Previous Topic: Oracle garbage files in RH Linux on Hyper-V not on Xen
Next Topic: ora-27102 out of memory
Goto Forum:
  


Current Time: Thu Mar 28 18:14:46 CDT 2024