The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 04-23-2009
abinaya abinaya is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 24
Hi,

Try the below code:

Code:
 
#!/bin/sh
for i in `cat concatinfile`
do
while read line
do
echo "`echo $i | cut -d"/" -f4 | cut -d"_" -f1`: $line" >> concatoutfile
done < $i
done

here "concatinfile" is the inputfile which contains the list of files to be concated.
"concatoutfile" is the output file

Reg,
Abinaya