Re: shell and output redirection

  • From: Mladen Gogala <mladen@xxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 2 Jul 2004 15:24:29 -0400

On 07/02/2004 02:57:21 PM, Ganesh.Raja@xxxxxxxxxxxxxxxxxxx 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) = 1
write(2, "l", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "s", 1) = 1
write(2, "s", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "|", 1) = 1
write(2, "|", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "s", 1) = 1
write(2, "s", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "o", 1) = 1
write(2, "o", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "e", 1) = 1
write(2, "e", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "\10", 1) = 1
write(2, "\10 \10", 3) = 3
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "e", 1) = 1
write(2, "e", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "\10", 1) = 1
write(2, "\10 \10", 3) = 3
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "r", 1) = 1
rt_sigprocmask(SIG_BLOCK, ~[], [RTMIN], 8) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
write(2, "r", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "t", 1) = 1
write(2, "t", 1) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "\r", 1) = 1
write(2, "\n", 1) = 1

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

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

/* Create two pipes and fork two processes */

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



-- 
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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: