Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!hpcupt1!hpirs!wk From: wk@hpirs.HP.COM (Wayne Krone) Newsgroups: comp.sys.hp Subject: Re: Trying to remove a file called "-ls" Message-ID: <4640015@hpirs.HP.COM> Date: 28 Mar 89 03:20:17 GMT References: <570@sdrc.UUCP> Organization: Hewlett Packard, Cupertino Lines: 14 > >> Why not rm -i * and answer no to all the queries except -ls? > > > >Because * is expanded by the shell so the argument list passed to > >rm might be "-i -ls foo1 foo2". > > Why not simply write a C program which uses the unlink system call to > purge the file? This was all discussed in depth several weeks ago, but the easy ways to do it are: rm ./-ls rm -- -ls (or rm - -ls for BSD derived commands)