From owner-freebsd-questions Mon Dec 17 22:24: 1 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail7.carolina.rr.com (fe7.southeast.rr.com [24.93.67.54]) by hub.freebsd.org (Postfix) with ESMTP id 1F3B637B417 for ; Mon, 17 Dec 2001 22:23:56 -0800 (PST) Received: from snafu.enterit.com ([66.57.159.198]) by mail7.carolina.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Tue, 18 Dec 2001 01:23:43 -0500 Message-Id: <5.1.0.14.0.20011218014357.02b7f6d8@mail.enterit.com> X-Sender: jconner@enterit.com@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 18 Dec 2001 01:47:39 -0500 To: swear@blarg.net (Gary W. Swearingen) From: Jim Conner Subject: Re: rm a file named "-l"? ;-) Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: References: <5.1.0.14.0.20011217163005.034eacc0@mail.enterit.com> <20011217111215.I21241@xs4all.nl> <20011217111215.I21241@xs4all.nl> <5.1.0.14.0.20011217163005.034eacc0@mail.enterit.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 16:53 12.17.2001 -0800, Gary W. Swearingen wrote: >Jim Conner writes: > > > >A quicker way would be to use unlink(1) > > > > Thought I would give an example for clarity: > >Well thanks for that; that's better for this case, but the wildcard >method works when the filename starts with (or contains) an unknown >character like ctrl-M, which you can get in there with the Xemacs shell, >for example ;-(. In bash and ksh (perhaps sh but doubtful) you can do ctrl+v control-char to get any control character to be placed on the command line. unlink (ctrl+v)(ctrl+m)file == unlink ^Mfile eg: [notjames@njkwan ~]$ unlink ^Mfile file: No such file or directory [notjames@njkwan ~]$ Actually, according to the man page, this unlink should be able to do directories if you use -d, -R, or -r command line switches. Although, I did not test this. >IIRC, the SGI unlink could unlink a huge directory in a split second >(and you'd run "fsck" later to clean up the left-overs), while I notice >this one doesn't work on directories at all. - Jim Philosophy is for those who have nothing better to do than wonder why philosophy is for those who have nothing better to do than... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message