awk help

 
SOLVED
Go to solution
allanm77
Frequent Advisor

awk help

Hi,

 

Have a file which has  list of binary -

 

cat file

Applicationame-20110829-103844-56848782bd0249da9e17397acbacb27v
...

 

On the binary I have to run a command called install so I generate it by doing an awk  -

 

awk '{print "install -binary "$1" -app"}' file

install -binary Applicationame-20110829-103844-56848782bd0249da9e17397acbacb27v -app

Need the Applicationname in the end as an argument to -app.

install -binary Applicationame-20110829-103844-56848782bd0249da9e17397acbacb27v -app Applicationame

 

Thanks,

Allan.

2 REPLIES 2
allanm77
Frequent Advisor

Re: awk help

Any help is greatly appreciated!
James R. Ferguson
Acclaimed Contributor
Solution

Re: awk help

Hi Allan:

 

Perhaps:

 

awk '{split($0,app,/-/);print "install -binary "$1" -app",app[1]}' file

Regards!

 

...JRF...