The UNIX and Linux Forums  

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




Thread: Final Output
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 06-29-2006
Doc_RuNNeR Doc_RuNNeR is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 17
If you want a shell script you can use that

Code:
#! /bin/bash
espacios=IFS
IFS="
"
for i in `cat $1`
do
  name=`echo $i | cut -d" " -f1`
  echo $i > aux
  cat $2 | grep "^$name " | cut -d" " -f2 >> aux
  cat aux | tr -s "\n" " " >> aux2
  echo >> aux2
done
IFS=$espacios
unset espacios
rm aux

It generates a file whose name is aux2 that has the information that you want.

Bye