Just like my last post if you read it, I am doing this using foreach but when the numbers go up it gets really slow. is there a way to achieve this using awk or sed that would be quick when used in a script?
bt:/tmp# echo $0
tcsh
bt:/tmp# cat 1.txt
a
b
c
d
bt:/tmp# cat 2.txt
e
f
g
h
i
j
k
i
m
bt:/tmp# awk 'NR==FNR{a[++j]=$0;next}{b=b"=="$0}END{for(i=1;i<j;i++){print a} printf("%s%s\n",a[j],b)}' 1.txt 2.txt
a
b
c
d==e==f==g==h==i==j==k==i==m
$
$
$ cat file1
a
b
c
d
$
$ cat file2
e
f
g
h
i
j
k
i
m
$
$ perl -pne 'chomp; $_ = $ARGV eq "file2" ? "==$_" : $. > 1 ? "\n$_" : $_; END{print "\n"}' file1 file2
a
b
c
d==e==f==g==h==i==j==k==i==m
$
$