home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!think.com!yale.edu!news.yale.edu!neutron!dcs
- From: dcs@neutron.chem.yale.edu (Dave Schweisguth)
- Subject: Baffled by ksh signal handling
- Message-ID: <1992Nov17.182957.14710@news.yale.edu>
- Sender: news@news.yale.edu (USENET News System)
- Nntp-Posting-Host: neutron.chem.yale.edu
- Organization: Yale University
- X-Newsreader: TIN [version 1.1 PL6]
- Date: Tue, 17 Nov 1992 18:29:57 GMT
- Lines: 47
-
- Hi all,
-
- Makin' myself a little dump-a-random-quote-to-a-pipe thingy. Here it is:
-
- --- snip ---
- #!/bin/ksh -p
-
- action="$1"
- file="$2"
-
- trap "rm -f $file > /dev/null 2>&1; exit 0" 2
-
- rm -f $file > /dev/null 2>&1
- /etc/mknod $file p
- while :; do
- eval $action >> $file
- sleep 1
- done
- --- snip ---
-
- So why does this happen:
-
- [dcs ~] pipe ls foo &
- [2] 29707
- [dcs ~] cat foo
- bin
- foo
- lib
- src
- text
- tutorial
- ws
- [dcs ~] killall -2 pipe
- /usr/people/dcs/bin/pipe[11]: foo: cannot create
- [2] Done pipe ls foo
-
- foo _is_ removed. So why doesn't it exit? And it didn't work (or rather
- failed in the same way) when I put the trap stuff in a function and just
- called the function from the trap.
-
- Mail would be fine.
-
- TIA,
-
- --
- | Dave Schweisguth Yale MB&B & Chemistry Net: dcs@neutron.chem.yale.edu |
- | Lab phone: 203-432-5208 Fax: 203-432-6144 Home phone: 203-624-3866 |
-