The "paste" FilterWe have used grep, cut, and colrm to substract content. Now let's learn to add.
The paste command is used to put two files together. The format for paste is: Instead of putting file1 on top of file2, file1 and file2 are combined side-by-side.
For example, combining file1 and file2, we would get:
AssignmentCreate a new script named "swap" that will swap the colomns in a two column file. The two columns should be seperated by a tab.To test your script you will need to create your own dummy data file with two columns that you can test swapping back and forth. Here is an example run:
This assignment will be kinda tricky. For example, you have to figure out where to keep the first and second columns until you are ready to recombine them. Note that your script should have NO side-effects.
|