get file content and produce command

hi buddies;

ip.txt:

192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
...

parameters.txt:

portvalue
username
password
session
...

i want to produce:

l ./shell 192.168.1.1 'lt all;l+;get . portvalue;get . username;get . password;get . session;get . remaining-parameters;l-'
l ./shell 192.168.1.2 'lt all;l+;get . portvalue;get . username;get . password;get . session;get . remaining-parameters;l-'
l ./shell 192.168.1.3 'lt all;l+;get . portvalue;get . username;get . password;get . session;get . remaining-parameters;l-'
l ./shell ...same-for-remaining-IPs

any help? thx

awk 'NR==FNR{a=a?a"get . "$0";":"get . "$0";";next;}{print "i ./shell "$0" "c a "l-"c}' c="'" Code ip.txt
1 Like

thanks anurag;
this is the solution (a bit modified from yours):

awk 'NR==FNR{a=a?a"get . "$0";":"get . "$0";";next;}{print "l ./shell "$0" "c"lt all;l+;" a "l-"c}' c="'" parameters.txt ip.txt