문제

I don't understand, while following cat command doesn't display contents of both file1.txt and file2.txt

cat file1.txt < file2.txt

It's displaying contents of file1.txt, but not the contents of file2.txt

while the following commands work as expected

cat file1.txt file2.txt
cat < file2.txt

Appreciate your help, in understanding the issue.

도움이 되었습니까?

해결책

You need to write it as follows

$ cat file1.txt - < file2.txt

if you want to mix file arguments with stdin.

Source man cat, Examples.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top