I have 10 text files and I want to paste each file with its pair, such that I have 5 total files.
paste
I tried the following:
for i in 4_1 5_
If you want to use one variable and perform and action with it, you just need to use one loop:
for file in 4 5 6 7 8 do paste "${file}_1" "${file}_2" done
This will do
paste 4_1 4_2 paste 5_1 5_2 ...