The UNIX and Linux Forums  

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 10-08-2008
userix userix is offline
Registered User
  
 

Join Date: May 2008
Posts: 21
Saving output from awk into a perl variable

How would I pass awk output to a perl variable?

For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct.


Code:
$test = system("awk '/NUMBER/{print \$4}' $_");