標準入力
コマンド
標準出力
キーボード
画面(DOS窓)
D:\test>dir /b of.bat renshu test.txt ← DIR /B の結果を標準出力へ出力 test2.txt test3.txt D:\test>dir /b > list ← 出力を list にリダイレクトする 出力しました D:\test>
D:\test>type list list ← DIR 実行より先に list が生成されるため of.bat renshu test.txt test2.txt test3.txt D:\test>
D:\test>dir /b > list ← 出力を list にリダイレクト D:\test>dir /b >> list ← 追加書き込みのリダイレクト D:\test>type list list ↓↓ list の中身を画面表示しました ↓↓ of.bat renshu test.txt test2.txt test3.txt list - - - - - - - - - -↓↓ 追加された分 ↓↓ of.bat renshu test.txt test2.txt test3.txt D:\test>
A
D:\test>type yesno.txt A ← yesno の中身を見ています D:\test>copy * renshu all.txt list of.bat ← 全ファイルを \renshu にコピー test.txt test2.txt test3.txt 6 個のファイルをコピーしました。 D:\test>copy * renshu all.txt renshu\all.txt を上書きしますか? (Yes/No/All): a list ↑ of.bat キーボードから入力 test.txt test2.txt test3.txt yesno.txt 6 個のファイルをコピーしました。 D:\test>copy * renshu < all.txt ← 入力のリダイレクトあり all.txt renshu\all.txt を上書きしますか? (Yes/No/All): A list ↑ of.bat 上書き確認が自動的に入りました test.txt test2.txt test3.txt 6 個のファイルをコピーしました。 D:\test>
D:\test>del renshu\* D:\test\renshu\*、よろしいですか (Y/N)? y D:\test>