Merge two files into one file

Hi, I need help with merging two files. My requirement is as below:
File 1:

MachineA
MachineB

File 2:

Process1
Process2
Desired File:
MachineA Process1
MachineB Process2

If file 2 contains only one entry Process1, then second line in the desired output should be:
MachineA Process1
MachineB

Thanks..

---------- Post updated at 11:24 PM ---------- Previous update was at 11:09 PM ----------

Found 'paste' command delivers what I am looking for. Thanks!

Hi,

You could try this :

y=1
while read line
do
   r=`sed -n "$y p" file2`
   sed -i "$y s/$/$r/" file1
   y=`expr $y + 1`
done < file1

I used below input :

File 1 :                                        File 2 :
MachineA                                     Process1
MachineB                                     
MachineC                                     Process2

Below is output :

MachineAProcess1
MachineB
MachineCProcess2

It holds good for the scenario u have mentioned also. Hope this helps.
If the file sizes are large then you could use awk instead of sed i believe.

Regards,
RM