I am trying to understand the implementation of the paste command in unix when there is a file from input redirection.
Assuming the following files:
A.txt:
A
B
C
D
B.txt:
1
2
3
4
The unix command:
paste - A.txt - < B.txt
The expected output:
1 A 2
3 B 4
C
D
Does this mean that whenever you redirect a file into standard input, the -
shares the same file for both the -
(and what is this called?)
I am trying to understand why the output is different from doing something like: paste B.txt A.txt B.txt
as I thought the redirected input simply replaces the -
but the result is different.