home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!gatech!pitt.edu!djbpitt
- From: djbpitt+@pitt.edu (David J Birnbaum)
- Newsgroups: comp.unix.questions
- Subject: sh, tcsh, and alias differences
- Message-ID: <5313@blue.cis.pitt.edu.UUCP>
- Date: 30 Aug 92 19:35:25 GMT
- Sender: news+@pitt.edu
- Organization: University of Pittsburgh
- Lines: 36
- Originator: djbpitt@unixd2.cis.pitt.edu
-
- For odd reasons apparently related to AFS mounts, the purge utility
- (part of the athena safe delete suite, available as athena-rm.tar-z
- from your favorite archive) won't execute purge correctly on my sys-
- tem (purge permanently removes files that were deleted using the safe
- delete). Expunge, a related utility, takes assorted options and can
- be made to act like purge and to do what I want on my system. I run
- under tcsh and my purge script, replacing the internal purge, looks
- like:
-
- #!/bin/sh
- expunge -r -i -l -s -y -m -v \* 2> /dev/null
-
- Now ... how do I do this in tcsh? The following works as an alias:
-
- "( expunge -r -i -l -s -y -m -v \* > /dev/tty ) > & /dev/null"
-
- but when I try it as a shell script I get a "not found" message. I've
- tried different types of quotes and escapes - to no avail. Some varia-
- tions object to the ampersand; others to /dev/null. Yes, the script is
- executable, yes, it's in my path, yes, I removed the original purge from
- my bin, and yes, I rehashed.
-
- I realize the short answer to my question is "you do this in tcsh
- exactly the way you did; you invoke sh and don't muck around." But to
- satisfy my 'satiable curiosity, why doesn't my tcsh script work, even
- while the alias and sh scripts do?
-
- Thanks,
-
- David
-
- --
- Professor David J. Birnbaum djbpitt+@pitt.edu [Internet]
- The Royal York Apartments, #802 djbpitt@pittvms [Bitnet]
- 3955 Bigelow Boulevard voice: 1-412-687-4653
- Pittsburgh, PA 15123 USA fax: 1-412-624-9714
-