How to read from file, which name is "-"
how to rea开发者_开发百科d content of a file which name is "-" (dash, not stdin)?
From any programming language, just open the file. A single dash is certainly no special file name and can be opened like any other one.
From a shell, you can use ./-
:
$ some_command --out foo --in ./-
Assuming you're using a utility that represents STDIN/STDOUT with -
, try using ./-
or -- -
.
cat <- will work under *nix.
No differently that from any other file.
精彩评论