3 ms·
> checkin a file with a name that begins with a dash. Now check it out under Linux and try manipulating it with command-line utilities $> echo 'hello worl
by jonhohle 18y ago
> checkin a file with a name that begins with a dash. Now check it out under Linux and try manipulating it with command-line utilities
$> echo 'hello world' > -h
$> cat ./-h
hello world
what's the problem?
- wmf 18y agoTry "cat *" and see what happens. This has more details than you ever wanted to know about filenames: http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html http://www.dwheeler.com/essays/fixing-unix-linux-filenames.h...
- jonhohle 18y agoif I expected a filename with a leading dash, I'd follow the same convention as I did before: "cat ./*". You're link suggests the same thing.
- blasdel 18y agoAll of the utilities that use GNU getopt support using ' -- ' to delimit the end of the parameters: $> echo 'hello world' > -h $> cat -- -h hello world