Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amdahl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!hplabs!amdahl!gam From: gam@amdahl.UUCP (G A Moffett) Newsgroups: net.news.adm,net.news.sa,net.sources.d Subject: Re: Beware of Blindly Un-SHARing a File Message-ID: <3051@amdahl.UUCP> Date: Sun, 20-Apr-86 18:35:32 EST Article-I.D.: amdahl.3051 Posted: Sun Apr 20 18:35:32 1986 Date-Received: Wed, 23-Apr-86 20:56:48 EST References: <947@kitty.UUCP> <3029@amdahl.UUCP> Reply-To: gam@amdahl.UUCP (G A Moffett) Organization: Amdahl Corp, UTS Products Group Lines: 40 Keywords: sh options Xref: watmath net.news.adm:621 net.news.sa:279 net.sources.d:138 Summary: "sh -x -v" doesn't work as expected ... In article <3029@amdahl.UUCP> I said: > And fortunately, the shell provides a nice way to check what sorts > of things a shar will do. For example: > > sh -x -n foo.shar > > or more verbosely: > > sh -v -n foo.shar I was mistaken in my suggestion to use these two. Their effects are not what I expected them to be: First of all, the flags must be grouped together. If the first arg begins with '-', the shell expects it to contain *all* flags to be passed to it. "sh -x -n ..." produces (ultimately) "-n: cannot open". Secondly, the form "sh -x -n" (properly, "sh -xn") has little effect: the "-n" overrides what the "-x" option tells it to do, and so nothing is printed except environment variable assignments. Thirdly, the last example is equialent to "cat foo.shar". This is not so bad as it seems, since you should probably read the shell script before you run it, if you are suspicious of what it might do .... This is the behavior of the shell in System V. I tried this on a V7 (Unisoft) system and it behaved similarly. Credits: E. Leeper (mtgzz!ecl) and Mark Brader (lsuc!msb) brought these things to my attention. The error is mine in not actually *testing* what I thought would solve the problem. I will be more cautious in the future and test my suggestions before dropping them on an unsuspecting public. -- Gordon A. Moffett ...!{ihnp4,seismo,hplabs}!amdahl!gam "Life's a bitch and then you die." -- [ This does not represent Amdahl Corporation ]