Xref: utzoo comp.unix.xenix:6020 comp.unix.questions:13650 comp.unix.wizards:16169 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!ncsc1!dgp From: dgp@ncsc1.ATT.COM (Dennis Pelton x8876) Newsgroups: comp.unix.xenix,comp.unix.questions,comp.unix.wizards Subject: Re: Ugly file name Summary: rm anything -else Keywords: rm cat mv regexp Message-ID: <480@ncsc1.ATT.COM> Date: 16 May 89 21:34:04 GMT References: <128@tdl.UUCP> <7170@bsu-cs.bsu.edu> <1614@auspex.auspex.com> <448@hsi86.hsi.UUCP> Distribution: usa Organization: AT&T NCSC, Englewood,CO Lines: 22 In article <448@hsi86.hsi.UUCP>, derek@hsi.UUCP (Derek Lee-Wo) writes: > In article <1614@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: > :Helpful Hints #1273: if you have a file name containing characters that > :the shell assigns special significance to, put the file name in single > :quotes when typing it as a file name: > : % rm 'odds&ends' > > This doesn't work for filenames that start with a minus. eg -badfile > Anyone know how to erase such files with whipping up a short C program? > Derek Lee-Wo (Co-op), Health Systems International, New Haven, CT 06511 The construction # rm foo any-other-file will remove any-other-file even if it starts with a '-' sign. This assumes that either foo does not exist or you don't care if it doesn't exist. What happens is that rm assumes, once it gets a non-negative (:-) argument, that all succeeding arguments are file names. Dennis Pelton att.com.UUCP!ncsc5!dgp