Reputation: 1629
I have a file named -
. How to pass the file name as an argument to console commands ?.
I mean is there a way to escape -
character in console ?
Upvotes: 1
Views: 293
Reputation: 33273
You can prepend a path to it, for example:
cat ./-
David A Wheeler has written an in-depth essay on the subject of how to handle file names in shell scripts.
Upvotes: 2
Reputation: 8395
For some commands, I know you can say it is the end of the parameters on the command line with a double -
.
e.g.:
touch -
rm -- -
rm: Remove -? y
Upvotes: 0