Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this case of Bash output redir mean?

Status
Not open for further replies.

vesselinpeev

Programmer
Feb 18, 2002
1
BG
Hello,

I am pondering upon

> file2 < file1 cat

The command executes &quot;cat&quot; on file1 and redirects
the standard output to file2.

This is another way of writing
&quot;cat file1 > file2&quot;

Can someone fully explain why the first version works at all? No explanation in Bash manuals.

It is the second version reversed with > at the start.

So the standard output is redirected to file2, but as the input to file2 we get &quot;file1 cat&quot;. Why the need for > ?

Thank you in advance for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top