From nobody@FreeBSD.org Tue Jun 28 06:22:15 2005 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77B5316A41C for ; Tue, 28 Jun 2005 06:22:15 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 631E843D49 for ; Tue, 28 Jun 2005 06:22:15 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j5S6MFTd001329 for ; Tue, 28 Jun 2005 06:22:15 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j5S6MEqY001328; Tue, 28 Jun 2005 06:22:14 GMT (envelope-from nobody) Message-Id: <200506280622.j5S6MEqY001328@www.freebsd.org> Date: Tue, 28 Jun 2005 06:22:14 GMT From: "Adil F. Mamedov" To: freebsd-gnats-submit@FreeBSD.org Subject: rm doesn't remove file with name, which is like flag for the command (-l, -a...) X-Send-Pr-Version: www-2.3 >Number: 82721 >Category: misc >Synopsis: rm doesn't remove file with name, which is like flag for the command (-l, -a...) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 28 06:30:18 GMT 2005 >Closed-Date: Tue Jun 28 07:00:24 GMT 2005 >Last-Modified: Tue Jun 28 07:00:24 GMT 2005 >Originator: Adil F. Mamedov >Release: 5.3 >Organization: R.I.S.K Company, Baku, Azerbaijan. >Environment: FreeBSD myhostname 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Tue Mar 1 19:11:54 AZT 2005 ejik@myhostname:/usr/src/sys/i386/compile/GENERIC i386 >Description: I found a file with name "-l" in my home directory. When i try to delete it or rename it, i get error: ejik-/home/ejik# rm "-l" rm: illegal option -- l usage: rm [-f | -i] [-dPRrvW] file ... unlink file ejik-/home/ejik# rm -l rm: illegal option -- l usage: rm [-f | -i] [-dPRrvW] file ... unlink file ejik-/home/ejik# mv "-l" l mv: illegal option -- l usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory ejik-/home/ejik# mv -l l mv: illegal option -- l usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory ejik-/home/ejik# mv '-l' l mv: illegal option -- l usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory ejik-/home/ejik# rm '-l' rm: illegal option -- l usage: rm [-f | -i] [-dPRrvW] file ... unlink file ejik-/home/ejik# >How-To-Repeat: echo > -l - This creates the file Then just try to delete, or move it... >Fix: >Release-Note: >Audit-Trail: From: "Adil F. Mamedov" To: , "Adil F. Mamedov" Cc: Subject: Re: misc/82721: rm doesn't remove file with name, which is like flag for the command (-l, -a...) Date: Tue, 28 Jun 2005 11:41:05 +0500 This is a multi-part message in MIME format. ------_=_NextPart_001_01C57BAC.5D448378 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The files can be deleted this way: =20 root# rm ./-l =20 Adil F. Mamedov, R.I.S.K. Company , Service Center. =20 ------_=_NextPart_001_01C57BAC.5D448378 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

The files can be deleted this = way:

 

root# rm ./-l

 

Adil F. = Mamedov,

R.I.S.K. Company, Service Center.

 

------_=_NextPart_001_01C57BAC.5D448378-- From: Matteo Riondato To: bug-followup@freebsd.org, "Adil F. Mamedov" Cc: Subject: Re: misc/82721: rm doesn't remove file with name, which is like flag for the command (-l, -a...) Date: Tue, 28 Jun 2005 08:48:11 +0200 kaiser#touch -- -l kaiser#ls | grep "\-l" -l kaiser#mv -- -l l kaiser#ls | grep "\-l" kaiser#ls | grep -e ^l$ l kaiser# This work with rm too. Note that this work with any program which uses the getopt(3) routine. If you don't have any objection I will close this bug. Best Regards -- Matteo Riondato FreeBSD Volunteer (http://freebsd.org) G.U.F.I. Staff Member (http://www.gufi.org) FreeSBIE Developer (http://www.freesbie.org) State-Changed-From-To: open->closed State-Changed-By: matteo State-Changed-When: Tue Jun 28 06:59:07 GMT 2005 State-Changed-Why: Closed at submitter's request. http://www.freebsd.org/cgi/query-pr.cgi?pr=82721 >Unformatted: