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 -->
  #1 (permalink)  
Old 04-21-2005
jvander jvander is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 20
How to direct awk output to expr?

Is there any way to combine the following two statements into one? I can't figure out how to get expr to take input from the output of the awk call - I've tried piping the output of the awk call into the expr call, and tried using a 'Here' document, nothing seems to work.

export CNT=`wc -l ${QV_FILENAME} | awk '{print $1}'`
export FILE_RECCNT=`expr ${CNT} - 2`

Thanks for any help that anyone can offer.