deleting a file named "--exclude"
hey guys, this would seem rather basic. How to delete a file, but i have a problem. I want to delete a file called "--exclude". Any ideas? # ls -la total 1648 -rw-r--r-- 1 root root 642617 Sep 27 13:54 --exclude drwxr-xr-x 15 karl users 4096 Oct 13 20:16 . drwxr-xr-x 4 karl users 4096 Oct 11 18:17 .. drwxr-xr-x 7 karl users 4096 Sep 27 13:59 .svn # rm -i * rm: unrecognized option `--exclude' Try `rm --help' for more information. # rm -f "--exclude" rm: unrecognized option `--exclude' Try `rm --help' for more information. # rm -f \-\-exclude rm: unrecognized option `--exclude' Try `rm --help' for more information. -- -- Karl Hiramoto <karl@hiramoto.org>
On Thu, Oct 13, 2005 at 08:25:24PM +0200, Karl Hiramoto wrote:
hey guys, this would seem rather basic. How to delete a file, but i have a problem. I want to delete a file called "--exclude". Any ideas?
Heh. I used to ask this on interviews. ;) "rm -- --exclude"
# rm -i * rm: unrecognized option `--exclude'
the shell expanded * to include --exclude which reads as an option.
# rm -f "--exclude" rm: unrecognized option `--exclude'
ditto.
# rm -f \-\-exclude rm: unrecognized option `--exclude'
ditto. -- Randomly Generated Tagline: "I love deadlines. I like the whooshing sound they make as they fly by." - Douglas Adams
Thanks, Actually i figured it out after doing some RTFM rm --help even showed how to do it. Theo Van Dinter wrote:
On Thu, Oct 13, 2005 at 08:25:24PM +0200, Karl Hiramoto wrote:
hey guys, this would seem rather basic. How to delete a file, but i have a problem. I want to delete a file called "--exclude". Any ideas?
Heh. I used to ask this on interviews. ;)
"rm -- --exclude"
# rm -i * rm: unrecognized option `--exclude'
the shell expanded * to include --exclude which reads as an option.
# rm -f "--exclude" rm: unrecognized option `--exclude'
ditto.
# rm -f \-\-exclude rm: unrecognized option `--exclude'
ditto.
------------------------------------------------------------------------
_______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
-- -- Karl Hiramoto <karl@hiramoto.org> US VOIP: (+1) 603.966.4448 Spain Casa (+34) 951.273.347 Spain Mobil (+34) 617.463.826 Yahoo_IM = karl_hiramoto jabber.org=karl_hiramoto
On Friday 14 October 2005 07:12 am, Theo Van Dinter wrote:
On Thu, Oct 13, 2005 at 08:25:24PM +0200, Karl Hiramoto wrote:
hey guys, this would seem rather basic. How to delete a file, but i have a problem. I want to delete a file called "--exclude". Any ideas?
Heh. I used to ask this on interviews. ;)
"rm -- --exclude"
although most tools nowadays support --, you could also do: rm ./--exclude -mike
Doesn't rm ??exclude, or rm *exclude work, if you only have the one file with exclude in it? On 10/14/05, Mike Frysinger <vapier@gentoo.org> wrote:
On Friday 14 October 2005 07:12 am, Theo Van Dinter wrote:
On Thu, Oct 13, 2005 at 08:25:24PM +0200, Karl Hiramoto wrote:
hey guys, this would seem rather basic. How to delete a file, but i have a problem. I want to delete a file called "--exclude". Any ideas?
Heh. I used to ask this on interviews. ;)
"rm -- --exclude"
although most tools nowadays support --, you could also do: rm ./--exclude -mike _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
No. Unix shells expands everything on the command line before running the program. So "rm *exclude" and "rm ??exclude" expand to "rm --exclude". The program cannot tell that the "--exclude" was expanded from wildcard values. Quoting Jim Dibb <jimdibb@gmail.com>:
Doesn't rm ??exclude, or rm *exclude work, if you only have the one file with exclude in it?
On Fri, Oct 14, 2005 at 10:58:30AM -0400, Jim Dibb wrote:
Doesn't rm ??exclude, or rm *exclude work, if you only have the one file with exclude in it?
No, because the shell will expand it to --exclude before passing it to the application which will then see it as an option. -- Randomly Generated Tagline: Memory error on Brain1 - R)boot, S)mack upside the head.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I cheat and let Konqueror delete it for me. Right click...MoveToTrash. :-) - -- Andy Stewart, Founder Worcester Linux Users' Group Worcester, MA, USA http://www.wlug.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDT6LSHl0iXDssISsRAr6CAJ9tN15Myew9r21QqCTpydGjVIBUAgCfRsgF fiwwT+X8P6YEO6xlIMLmGNY= =+/h3 -----END PGP SIGNATURE-----
participants (6)
-
Andy Stewart
-
dulsi@identicalsoftware.com
-
Jim Dibb
-
Karl Hiramoto
-
Mike Frysinger
-
Theo Van Dinter