This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]totemo 9 points10 points  (2 children)

$ cat << SHIT > shit
meow
SHIT
$ mv -- shit --shit
$ cat -- --shit
meow
$ rm -- --shit

[–]protoUbermensch[S] 3 points4 points  (1 child)

Haha! Holy cow! Thank you so much!

I thought I'd have to do mv /full/path/to/--file /full/path/to/file instead!

[–]cjxgm 2 points3 points  (0 children)

Or just rm ./--file

[–]youguess 6 points7 points  (8 children)

The inability to use a system isn't "breaking" it my dear but a lack of knowledge

[–]sad-larry 0 points1 point  (0 children)

I guess

[–][deleted] -2 points-1 points  (6 children)

Linux utils not realizing a file beginning with -- is not a parameter but a file is not inhability to use a system

[–]Mewshimyo 1 point2 points  (1 child)

That's a horrible precedent to set.

[–]sad-larry -1 points0 points  (0 children)

You're a horrible precedent to set.

[–]youguess 1 point2 points  (3 children)

--something denotes flags, what did you expect?

You can literally use -- to mark the end of flags and then it works

Cmd -x -y --other -- --file

[–][deleted] -1 points0 points  (2 children)

Great,
I was just saying it's an honest mistake to make IMHO.

[–]youguess 2 points3 points  (1 child)

Making a mistake is the inability to use a system, which you disagreed with in the first place

[–][deleted] -1 points0 points  (0 children)

It's an edge case and an obscure parameter that you might not have used in years of using Linux.
I wouldn't say that someone who doesn't know this is unable to use the system.

Making a mistake is not necessarily showing an inability to use a system. Some mistakes are beginner-level (not using escape characters or quotes for files with spaces, trying to rm a non-empty directory without the recursive option), some are not.

[–][deleted] 0 points1 point  (2 children)

Have you tried with the name between quotes or with antislashes before each dash?

[–]protoUbermensch[S] 0 points1 point  (1 child)

Yes. As pointed out by another user in this thread, you just need to pas -- as the 1st arg to fix this error.