开发者

How to read from file, which name is "-"

开发者 https://www.devze.com 2022-12-17 05:32 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消