home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!odin!fido!sam.wpd.sgi.com!pj
- From: pj@sam.wpd.sgi.com (Paul Jackson)
- Newsgroups: comp.sys.sgi
- Subject: Re: Shell script problem
- Message-ID: <1joc3bINN7qp@fido.asd.sgi.com>
- Date: 22 Jan 93 08:43:23 GMT
- References: <81288@hydra.gatech.EDU>
- Reply-To: pj@sgi.com
- Organization: Silicon Graphics, Research & Development
- Lines: 31
- NNTP-Posting-Host: sam.wpd.sgi.com
-
- In article <81288@hydra.gatech.EDU>, ccoprrm@prism.gatech.EDU (Robert E. Minsk) writes:
- |> I have a shell script that creates a temporary directory writes some files
- |> to the directory then does a rm -rf "directory". The files are removed but
- |> the directory remains. If I try to do a rmdir in the shell script it
- |> return "Directory not empty". Parts of the shell script is listed below.
- |>
- |> #!/bin/sh
- |> SLATEDIR=/usr/tmp/slate.$$
- |> trap "rm -rf $SLATEDIR" 0 1 2 3 15
- |> mkdir $SLATEDIR
- |> "write some stuff in $SLATEDIR"
- |> exit 0
-
- The following works fine for me on 4.0.5:
-
- #!/bin/sh
- SLATEDIR=/usr/tmp/slate.$$
- trap "rm -fr $SLATEDIR" 0 1 2 3 15
- mkdir $SLATEDIR
- touch $SLATEDIR/a
- exit 0
-
- Try it -- if it works for you, then the part about "write some
- stuff in $SLATEDIR" must be relevant. If it doesn't work
- verbatim for you, then somethings WREK'd.
-
- --
-
- I won't rest till it's the best ...
- Software Production Engineer
- Paul Jackson (pj@sgi.com), x1373
-