Operating System - HP-UX
1825793 Members
2229 Online
109687 Solutions
New Discussion

Writing lines from two files to match on one line.

 
SOLVED
Go to solution
Donald C Nelson
Frequent Advisor

Writing lines from two files to match on one line.

I have two files; one with disks names and the other with disks sizes. How can write a script where:

the first line in File1 and the first line in File2 and so forth are place on the same line as output.

File1
/dev/dsks/c1t2d0

File2
18GB

Output:
/dev/dsk/c1t2d0 18GB
3 REPLIES 3
Biswajit Tripathy
Honored Contributor
Solution

Re: Writing lines from two files to match on one line.


$ paste File1 File2

- Biswajit
:-)
RAC_1
Honored Contributor

Re: Writing lines from two files to match on one line.

man paste

paste file1 file2
There is no substitute to HARDWORK
Donald C Nelson
Frequent Advisor

Re: Writing lines from two files to match on one line.

Thanks Biswajit Tripathy and RAC.everyone. I forgot about the paste command.