The UNIX and Linux Forums  


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




Thread: Awk problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-27-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Here is one way to do it. I would avoid passing in variables in the manner that you are attempting. It's too messy.


Code:
while read appname apphandle eitthvad pid
do
    [[ ${appname}${apphandle}${eitthvad}${pid} = "" ]] && continue
    nawk -F\; -v pid=${pid} -v apphandle=${apphandle} -v appname=${appname} '
        $1 == pid {
           print $1, $2, $3, $4, $5, $6, $7, $8, apphandle appname
        }' $OUTFILE
done < $TEMPFILE