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 -->
  #1 (permalink)  
Old 06-27-2006
sprellari sprellari is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 49
Awk problem

Hi. I'm really not good in awk syntax or scripting by awk and therefore requesting some assistance.



Code:
cat $TEMPFILE | grep -v ^$ | awk '{print $2, $3, $4, $8}' | while read appname apphandle eitthvad pid
do
        cat $OUTFILE | awk -F ";" '$1 == '$pid' {print $1, $2, $3, $4, $5, $6, $7, $8, '$apphandle $appname'};'
done

Awk complains about the "'$apphandle $appname'" part. I can include one variable in the output statement by using ' around the variable name, but when there are two or more things break down. Any thougts?