Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.sys.hp Subject: Re: Trying to remove a file called "-ls" Keywords: HP bug Message-ID: <1158@auspex.UUCP> Date: 13 Mar 89 19:56:25 GMT References: <570@sdrc.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 29 >Now on any other UNIX system all I have to do is issue the >command "rm -i *". I tried it under SunOS and it didn't work, either. The problem is that, if "-ls" is the first file name, the command looks to the system like: rm -i -ls ... and UNIX programs generally will *not* treat only the first argument beginning with "-" as an options specifier; as such, it thinks "-ls" is specifying the "l" and "s" flags to "rm". The fix is that you somehow have to convince it that "-ls" isn't an option. There are a number of ways of doing this: 1) pass a special flag that says "nothing after this is a flag, even if it begins with "-". The BSD "rm", upon which the SunOS one is based, uses "-" for this. The HP-UNIX one is probably based on the System V one, which means it may accept "--" for this: rm -i -- * 2) stick something in front of the "-" in "-ls". At least one overly-complex way of doing this has been presented in a previous posting; a simpler way is just to prepend "./" in front of it: rm -i ./*