join two files horizontally unix 1

join two files horizontally unix

paste f1 f2

Here is what the above code is Doing:
1. We’re creating a function called paste that takes two arguments, f1 and f2.
2. We’re opening the file f1 and reading its contents into a variable called text1.
3. We’re opening the file f2 and reading its contents into a variable called text2.
4. We’re concatenating the contents of text1 and text2 and storing the result in a variable called both.
5. We’re opening a file called paste and writing the contents of both to it.

Similar Posts