From owner-freebsd-questions Fri Dec 1 17:23:53 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 4BEE537B401 for ; Fri, 1 Dec 2000 17:23:48 -0800 (PST) Received: (qmail 76884 invoked by uid 100); 2 Dec 2000 01:23:42 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14888.20254.298529.549656@guru.mired.org> Date: Fri, 1 Dec 2000 19:23:42 -0600 (CST) To: Cliff Sarginson Cc: Ryan Younce , Joe Oliveiro , Mike Meyer , Larry Rosenman , Daniel.Bye@uk.uu.net, questions@freebsd.org Subject: Re: Pesky file In-Reply-To: <00120201170201.04232@buffy> References: <14888.4617.148599.530943@guru.mired.org> <20001201190335.A35590@cheshire.manunkind.org> <00120201170201.04232@buffy> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Message: You should get a better mailer. Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Cliff Sarginson types: > Mmm.. > It's nearly Christmas so a small prize may be awarded > if you can get rid of a file whose name is > -* > > Where is the backspace character. So you want to remove a file that looks like this: guru$ ls -b -- -* -\b*\b How you quote the character to get it past the input routines will depend on your tty settings (specifically, lnext). Letting stand for the appropriate sequence of keystrokes to get the fed to rm, it can be done by one of: "rm -- '-*'", "rm ./-\*", or similar things. You can use printf to eliminate the lnext dependency, but if your erase character isn't C-h, you'll need to use something other than \b for the escape sequence. rm `printf "./\b*\b"` However, you may trip over some shells having printf as a builtin, so you can use a suitable scripting language (with the same caveat about \b): python -c "import os; os.unlink('-\b*\b')" And of course, to be *really* ham-handed about it, you can always use clri followed by an fsck. http://www.mired.org/home/mwm/ Independent WWW/Unix/FreeBSD consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message