File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Check that we can operate on files from /dev/fd.
2
2
// REQUIRES: dev-fd-fs
3
- // REQUIRES: shell
4
3
5
4
// Check reading from named pipes. We cat the input here instead of redirecting
6
5
// it to ensure that /dev/fd/0 is a named pipe, not just a redirected file.
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ def main(argv):
49
49
import os , msvcrt
50
50
51
51
msvcrt .setmode (sys .stdout .fileno (), os .O_BINARY )
52
+ if len (filenames ) == 0 :
53
+ sys .stdout .write (sys .stdin .read ())
54
+ sys .exit (0 )
52
55
for filename in filenames :
53
56
try :
54
57
contents = None
Original file line number Diff line number Diff line change 70
70
# NP-CAT-OUTPUT-NEXT:M-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[
71
71
# NP-CAT-OUTPUT-NEXT:M-\M-]M-^M-_M-`M-aM-bM-cM-dM-eM-fM-gM-hM-iM-jM-kM-lM-mM-nM-o
72
72
# NP-CAT-OUTPUT-NEXT:M-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?
73
+
74
+ ## Test that cat will pipe stdin to stdout if no other files are specified.
75
+ # RUN: echo test | cat | FileCheck --check-prefix=CAT-STDIN %s
76
+ # CAT-STDIN: test
You can’t perform that action at this time.
0 commit comments