Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

String concatenation

$
0
0
Hi,
I have two files.
Code:

cat file.txt
a
b
c
d

cat file1.txt
j
k
l
m


I need the output as

a:j
b:k
c:l
d:m

I tried the script but not working

Code:

cat test1.sh
#!/bin/sh
for i in `cat file1` ; do
N=0
j=`cat file2`
N=$((N+1))
echo $i:$j >>test2
done


Viewing all articles
Browse latest Browse all 16232