RESEARCHUT
Minds With Innovations

RESEARCHUT - minds with innovations

01 Jul '07 - 126 W - + 3 - 6 rm \- "-" ??

Does anyone know when really did coreutils get patched for this behavior ?

rrs@learner:~$ rm -foo
rm: invalid option -- o
Try `rm ./-foo' to remove the file `-foo'.
Try `rm --help' for more information.
This feature really wasn't earlier and if you ever ended up with files starting with characters like "-", it was not a straight task to remove it.

Earlier (when I wasn't aware of this patch), the workaround was to write a small 1 liner and not use getopt at all. Something like:

rrs@learner:~$ cat rm.py
#!/usr/bin/env python

import os, sys

sys.stdout.write("Removing file %s.\n" % (sys.argv[1]) )
os.unlink(sys.argv[1])

I'm really happy to see this bug fixed. rm — -foo

Use “—” (2 hyphens) as command line argument, if you’ve file names starting with “-” in coreutils .

à¤à¤œà¥€à¤· जà¥à¤à¥à¤² (URL) - 01 July '07 - 22:06

Just noticed your blogging software doesn’t support UTF-8.

Ashish Shukla (URL) - 01 July '07 - 22:08

I’ve changed it to UTF-8 now.

Ritesh Raj Sarraf - 02 July '07 - 22:28

Cool and its working. Thanks

आशीष शुक्ल (URL) - 02 July '07 - 22:32

  
Remember personal info?

Emoticons / Textile

Sorry for the trouble but to prevent spam I require you to answer this silly question.
 

  (Register your username / Log in)

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.

Trackback link:

Please enable javascript to generate a trackback url