1753543 Members
5208 Online
108795 Solutions
New Discussion юеВ

Re: scripting

 
ROSS HANSON
Regular Advisor

scripting

Hello,
I have two files. In one fileA there are numbers:
4096
16
2048
4096
10000
2000
1024
ect........

In fileB is commands:
lvcreate -L -n name1 vg03
lvcreate -L -n name2 vg03
lvcreate -L -n name3 vg 03
etc.......

between -L and -n on fileB is delimited by
spaces. I am trying to place fileA numbers
between -L and -n in the space. I have been trying awk but I have not found the correct syntacs as of yet. Can anyone help?
Ross Hanson
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: scripting

Hi Ross:

# awk '{getline NUM < "filea";print $1,$2,NUM,$3,$4}' fileb

Regards!

...JRF...
TTr
Honored Contributor

Re: scripting

You probably realized by now but JRF left out the vg03. Add a $5 to the print list above.
James R. Ferguson
Acclaimed Contributor

Re: scripting

Hi (again):

> TTr: You probably realized by now but JRF left out the vg03. Add a $5 to the print list above.

Yes, indeed I did :-( Thanks for the correction!

Regards!

...JRF...
ROSS HANSON
Regular Advisor

Re: scripting

You gentleman are awesome!! Thanks
Ross Hanson