How to define the input of a program in Windows?

1

A simple question. On * NIX systems, you can do the following:

cat input_do_programa.file
"texto exemplo"
input_do_programa.file > meu_programa.exe

Is there an equivalent for Windows?

    
asked by anonymous 13.07.2014 / 15:52

1 answer

4

The program to run must come first. < to redirect the standard input stream (stdin) and > to redirect the output stream (stdout) ( >> to append to the end of the file). To redirect the standard error output (stderr) use 2> :

programa.exe < entrada.txt > saida.txt 2> erro.txt

It is not necessary to redirect both input and output, it may be just one of the two.

    
13.07.2014 / 18:11