home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!stanford.edu!agate!netsys!ukma!kherron
- From: kherron@ms.uky.edu (Kenneth Herron)
- Subject: Re: C-Shell question
- References: <1992Nov3.130759.27280@eua.ericsson.se>
- <1992Nov4.080338.9458@eua.ericsson.se>
- <1992Nov5.020850.572@news.csd.sgi.com>
- <1992Nov6.115704.23205@cs.utwente.nl>
- Message-ID: <1992Nov6.113910.21207@ms.uky.edu>
- Distribution: na
- Date: Fri, 6 Nov 1992 16:39:10 GMT
- Organization: University Of Kentucky, Dept. of Math Sciences
- Lines: 46
-
- ahoekstr@cs.utwente.nl (Andre D. Hoekstra) writes:
-
- >>The exit status you get is from the command "rsh" and not from the script it
- >>executes. Since "rsh" completes normally, you will see "0" which is its
- >>"completion ok" status. If you do an "echo $status" inside the script, you
- >>might see the exit status of the command of rm.
-
- >The original question was:
-
- >I have a script that goes:
-
- >#!/bin/csh # ??
-
- >/bin/rm -f file
-
- >if ( $status ) then blabla
-
- >#end of script; exit
-
- >When I run this script normallly it works OK, but when I try to
- >rsh somehost script
- >I always get a $status of 0
-
- No, this *wasn't* the original question. In the original question,
- the rm command line didn't have the -f option. This makes a *lot*
- of difference. On at least the two systems I tried here, rm -f
- always results in a 0 exit code no matter how many files rm was able
- to remove. I suspect the answer to your question is simply that rm
- works differently on the system you're rsh'ing to.
-
- Let me suggest that in the future you include the actual script--edit
- out the irrelevant parts if it's big--rather than retyping it in your
- post.
-
- As for Mr. Vidya and the others, it sounds like they didn't read your
- question closely enough and thought you were doing something like
-
- #! /bin/csh
- rsh foo /bin/rm file
- if ( $status ) ...
-
- --
- Kenneth Herron kherron@ms.uky.edu
- University of Kentucky +1 606 257 2975
- Dept. of Mathematics "Your ball goes over them, it sails off the edge into
- a huge cauldren of fire-breathing dragons." "And they call this a par three?"
-