How to merge two files line by line in Bash
here's non-paste methods
awk
awk 'BEGIN {OFS=" "}{
getline line < "file2"
print $0,line
} ' file1
Bash
exec 6<"file2"
while read -r line
do
read -r f2line <&6
echo "${line}${f2line}"
done <"file1"
exec 6<&-
You can use paste
:
paste file1.txt file2.txt > fileresults.txt