Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hp-ses!hpcea!hpnmdla!hpmwtd!jeffa From: jeffa@hpmwtd.HP.COM (Jeff Aguilera) Newsgroups: comp.sys.hp Subject: Re: Re: Trying to remove a file called "-ls" Message-ID: <690003@hpmwjaa.HP.COM> Date: 28 Apr 89 23:22:53 GMT References: <570@sdrc.UUCP> Organization: HP Microwave Tech. - Santa Rosa, Ca. Lines: 55 >> 1. Amazing as it seems, rm actually adheres to the '--' standard so as >> mentioned so many times in the above responses, >> >> rm -- -ls bar $ strings `whence rm` | fgrep -c getopt 2 So it works --- for the twenty-seventh time. But how standard is getopt? The double dash won't work with mv: bar $ strings `whence mv` | fgrep -c getopt 0 >> 2. If ls -i gives >> >> 12000 -ls 12332 .... etc >> >> then use >> >> find . -inum 12000 -exec rm {} \; This works because find passes ./-ls to rm, so why not do that directly? Giving a path works with mv too, as in bar $ mv ./-ls ./-rm Ah, ha! We found the standard buried among the rubble. If you want a nice long list of programs that don't use that wonderful getopt standard, try #!/bin/sh : getopt : just say no for file in /bin/* /usr/bin/* do test -x $file -a `strings $file | fgrep -c getopt` -gt 0 || echo $file done Here are some highlights of the 332 programs on my machine that do not use getopt: /bin/ar /bin/echo /bin/nm /bin/wc /bin/cdb /bin/ed /bin/nohup /bin/xd /bin/chgrp /bin/find /bin/od /usr/bin/awk /bin/chmod /bin/gprof /bin/rmdir /usr/bin/ex /bin/chown /bin/head /bin/sed /usr/bin/man /bin/cp /bin/ksh /bin/sh /usr/bin/tar /bin/cpio /bin/ld /bin/sleep /usr/bin/vedit /bin/csh /bin/mkdir /bin/sort /usr/bin/vi /bin/date /bin/mt /bin/su /usr/bin/yacc /bin/diff /bin/mv /bin/sync /usr/bin/zcat /bin/du /bin/nice /bin/tail -------- j "standards are gooder than good" a