Skip site navigation (1)Skip section navigation (2)
Date:      18 Dec 2001 19:05:22 -0800
From:      swear@blarg.net (Gary W. Swearingen)
To:        Jim Conner <jconner@enterit.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: rm a file named "-l"? ;-)
Message-ID:  <wfadwfzz7x.dwf@localhost.localdomain>
In-Reply-To: <5.1.0.14.0.20011218014357.02b7f6d8@mail.enterit.com>
References:  <5.1.0.14.0.20011217163005.034eacc0@mail.enterit.com> <rl7krl3731.krl@localhost.localdomain> <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>

next in thread | previous in thread | raw e-mail | index | archive | help
Jim Conner <jconner@enterit.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?wfadwfzz7x.dwf>