From owner-freebsd-questions Tue Dec 18 19: 4:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id 2B5D737B417 for ; Tue, 18 Dec 2001 19:04:45 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id B0E77C29A; Tue, 18 Dec 2001 19:04:44 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id TAA03035; Tue, 18 Dec 2001 19:04:42 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id fBJ35M465173; Tue, 18 Dec 2001 19:05:22 -0800 (PST) (envelope-from swear@blarg.net) To: Jim Conner Cc: freebsd-questions@FreeBSD.ORG Subject: Re: rm a file named "-l"? ;-) 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> <5.1.0.14.0.20011218014357.02b7f6d8@mail.enterit.com> From: swear@blarg.net (Gary W. Swearingen) Date: 18 Dec 2001 19:05:22 -0800 In-Reply-To: <5.1.0.14.0.20011218014357.02b7f6d8@mail.enterit.com> Message-ID: Lines: 27 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Jim Conner writes: > 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 But that's only good if you know what the characters are and how many. Often, they just look like "?" or a bunch of spaces. Last resort is still "rm -i *", but ctrl+v is a nice tip anyway. Thanks. > 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. I only read this part: When the utility is called as unlink, only one argument, which must not be a directory, may be supplied. Apparently the "rm" command supports it (with those options), despite what the DESCRIPTION says. P.S. That "ctrl+v" thing really suprised me (in pdksh); as soon as you type it, the command line is replaced by "PD KSH v5.2.14 99/07/13.2" (SUPRISE!) until you type something else which seems to accept some control characters as literals and others as command-editing commands. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message