Pipe in a Shell-Script

Pipe in a Shell-Script

Post by Martin Kumme » Sat, 20 Nov 1999 04:00:00



Hello,

I have a problem !!

There is a shell script  "xyz" :

=========
#!/bin/sh
find / | filter | cat
=========

I call it with : ./xyz

When I kill the script with "kill PID" then
the pipe that was called inside the script is still runing.

My question is how to get the pipe killed automatically by killing the
script!!

Thanks a lot !!! Martin

 
 
 

1. a question about 'read' from pipe in shell script

Hi, all,

i am stuck with 'read' in my shell script, and could figure out why it did
not work, here is my simple script:

------------------------------------------
#!/bin/sh

ORACLE_HOME=/apps/oracle/product/8.1.7

if [ `uname` -eq SunOS ]; then
echo "Inside"
   /usr/ccs/bin/size $ORACLE_HOME/bin/oracle | /usr/bin/awk '{print $1}'
|read mtext
fi

echo $mtext
-------------------------------------------
when i run this script, i get:
dev:sql%sh mem_size.sh
Inside

From command line, when i use 'size', the output is:

eds-xml-dev:sql%size $ORACLE_HOME/bin/oracle
27221933 + 267676 + 21060 = 27510669
eds-xml-dev:sql%size $ORACLE_HOME/bin/oracle | awk '{print $1}'
27221933

So it seems 'read' doesn't want to read anything from pipe, could somebody
shed light on this? thanks.

Mike

2. ppp configuration on solaris 2.5.1

3. shell script style question: pipe or redir to file

4. Partition Magic vs. System Commander

5. pipe output from c program to a korn shell script

6. ZIP SCSI-PCMCIA card related questions.

7. piping to/from shell script

8. HELP... hdd upgrade

9. Piping output to a C-shell script from another command - HOW?

10. Checking Pipe Status Using Script At Comp.Unix.Shell FAQ

11. Detecting pipe closure in shell script

12. pipe c output to shell script

13. Pipes and args passed to a shell script