I know the Linux command paste can be used to combine two lines in two files. My question is how can I add some other string inside them?
For example, I have 2 files:
[root@localhost ~]# cat c1
aaaa
bbbbbbbbbbbbb
[root@localhost ~]# cat c2
11111111
222222222222
[root@localhost ~]#
[root@localhost ~]# paste c1 c2
aaaa 11111111
bbbbbbbbbbbbb 222222222222
[root@localhost ~]#
How can I insert text between them, for example, how can I get the following result?
var aaaa = some_function(11111111);
var bbbbbbbbbbbbb = some_function(222222222222);
Can this be implemented by the paste command? Thanks.
Maybe there’s a way to do this with
paste, but it can certainly be done easily withawk: