What does following cat commnad in Unix mean? I am new to Unix
cat test.txt | java myfilegrammar.pcfg > test1.txt 2> test2.txt
|
What does following cat commnad in Unix mean? I am new to Unix
| |||||
feedback
|
This question came from our site for professional and enthusiast programmers.
|
It pipes the contents of You might find it a little easier to understand if it is parenthesized, like this (note that this is for clarity and is not valid syntax):
This makes it more clear that the first text file is an input file, while the last two are output files. (However, the | |||
|
feedback
|
|
Randal L. Schwartz would award your code a Useless use of
(No, I'm no trying to be insulting; merely entertaining. If you follow the links, your question will be asnwered.) | |||
|
feedback
|
| |||
|
feedback
|
|
Your The same can be done without using
| |||
|
feedback
|
|
Each process in Linux starts with three file descriptors by default:
If you see a redirection, i.e. The command that you gave could also be written as:
Or:
... depending on how myfile.java handles standard input. | |||
|
feedback
|
|
send the contents of test.txt to "myfile.java grammar.pcfg" via standard input. send the standard output of myfile.java grammar.pcfg to test1.txt send the standard error output of myfile.java grammar.pcfg to test2.txt | |||
|
feedback
|
|
it is the same as
but with additional process ( | |||
|
feedback
|