Path: utzoo!mnetor!uunet!husc6!mailrus!ames!oliveb!sun!limes From: limes@sun.uucp (Greg Limes) Newsgroups: comp.unix.wizards Subject: Re: an rm question Message-ID: <49968@sun.uucp> Date: 19 Apr 88 02:37:59 GMT References: <27133@yale-celray.yale.UUCP> <670012@hpclscu.HP.COM> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 25 Summary: proper quoting solves lots of things In article <670012@hpclscu.HP.COM>, shankar@hpclscu.HP.COM (Shankar Unni) writes: > Let's say that you managed to create a file called > "a.*\03\07^q". If you just typed in rm a.*\03\07^q, the *shell* steps in > and does nasty stuff. If you put single quotes around it, this name should get through either /bin/sh or /bin/csh; you will probably need to use your LNEXT character (as reported by "stty"; usually Ctrl-V) to get the Ctrl-C and Ctrl-G characters through the line editor. > Even quoting doesn't often help (what if the last > character of the file name is '\' ?). Single quotes around the filename take care of this. > We had the same problem frequently when people would create files called, > for instance "-b", and rm would choke (-b: illegal option!). Try using "./" before the filename. For instance, if you have a file called "-rf *" in your current directory, the command "rm './-rf *'" would get rid of it. Note the single quotes here, too. > --scu -- Greg Limes [limes@sun.com] frames to /dev/fb