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: shell and output redirection

RE: shell and output redirection

From: David Lee <David_Lee_at_kaplan.com>
Date: Fri, 2 Jul 2004 17:06:57 -0400
Message-ID: <201AE221B32F7E48B74E6B4B78BFC9AB076749@ktpamail3.kaplaninc.com>

At what context do you execute this below? =20 Inside a shell script or perl program?
I can do it in perl by generating the output file and then ask perl to = execute the output file using system or the quote mark.

This is clever. I used pipe all the time filtering data but not to this = extent.
Thanks for the tip.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Mladen Gogala Sent: Friday, July 02, 2004 3:24 PM
To: oracle-l_at_freelists.org
Subject: Re: shell and output redirection

On 07/02/2004 02:57:21 PM, Ganesh.Raja_at_barclayscapital.com wrote:
> They are Not Run ||'el... The utput of the first program is stored =
before
> the second is executed...

Not true. Here is the trace:

read(0, "l", 1) =3D 1
write(2, "l", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "s", 1) =3D 1
write(2, "s", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "|", 1) =3D 1
write(2, "|", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "s", 1) =3D 1
write(2, "s", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "o", 1) =3D 1
write(2, "o", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "e", 1) =3D 1
write(2, "e", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "\10", 1) =3D 1
write(2, "\10 \10", 3) =3D 3
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "e", 1) =3D 1
write(2, "e", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "\10", 1) =3D 1
write(2, "\10 \10", 3) =3D 3
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "r", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, ~[], [RTMIN], 8) =3D 0 rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) =3D 0 write(2, "r", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "t", 1) =3D 1
write(2, "t", 1) =3D 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) =3D 0 read(0, "\r", 1) =3D 1
write(2, "\n", 1) =3D 1

/* Read "ls|sort" from terminal screen */

pipe([3, 4]) =3D 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [CHLD RTMIN], 8) =3D 0 pipe([5, 6]) =3D 0
fork() =3D 9430
setpgid(9430, 9430) =3D 0
rt_sigprocmask(SIG_SETMASK, [CHLD RTMIN], NULL, 8) =3D 0 close(4) =3D 0
close(4) =3D -1 EBADF (Bad file descriptor) rt_sigprocmask(SIG_BLOCK, [INT CHLD], [CHLD RTMIN], 8) =3D 0 fork() =3D 9431

/* Create two pipes and fork two processes */

wait4(-1, [WIFEXITED(s) && WEXITSTATUS(s) =3D=3D 0], 0, NULL) =3D 9429 /* Wait for the output. Exec calls in the 2 forked processes weren't = visible */

--=20
Mladen Gogala
Oracle DBA

Note:
This message is for the named person's use only. It may contain = confidential, proprietary or legally privileged information. No = confidentiality or privilege is waived or lost by any mistransmission. = If you receive this message in error, please immediately delete it and = all copies of it from your system, destroy any hard copies of it and = notify the sender. You must not, directly or indirectly, use, disclose, = distribute, print, or copy any part of this message if you are not the = intended recipient. Wang Trading LLC and any of its subsidiaries each = reserve the right to monitor all e-mail communications through its = networks.
Any views expressed in this message are those of the individual sender, = except where the message states otherwise and the sender is authorized = to state them to be the views of any such entity.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Jul 02 2004 - 16:03:43 CDT

Original text of this message

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