Re:C++ has become a scripting language
by MereInterest on Wednesday October 16, 2013 @08:43AM
(#6559310)
From the other comment, it is completely equivalent, and I will admit that the pipe is due purely to my ignorance. I usually use `sort` for sorting the output of other commands, and so I forget that it can open a file on its own.
[ Parent
| on HN ]
Re:C++ has become a scripting language
by reycharles on Wednesday October 16, 2013 @12:45PM
(#6560665)
That usage of cat is "wrong" in general:
cat file | command > out
is the same as command < file > outDon't worry about the cat it does have a purpose: portability.
cat in.txt | sort > out.txt
works in powershell(cat is an alias for Get-Content and sort is an alias for sort-object)(without the sort it wouln't work).