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 11// Check that we can operate on files from /dev/fd.
22// REQUIRES: dev-fd-fs
3- // REQUIRES: shell
43
54// Check reading from named pipes. We cat the input here instead of redirecting
65// 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):
4949 import os , msvcrt
5050
5151 msvcrt .setmode (sys .stdout .fileno (), os .O_BINARY )
52+ if len (filenames ) == 0 :
53+ sys .stdout .write (sys .stdin .read ())
54+ sys .exit (0 )
5255 for filename in filenames :
5356 try :
5457 contents = None
Original file line number Diff line number Diff line change 7070# NP-CAT-OUTPUT-NEXT:M-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[
7171# 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
7272# 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