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 07-01-2009
pravfraz pravfraz is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 5
awk command-logging

hi folks,

In the following code, logfile remains empty.

Code:
 
log_file="/u/Sc/prav.log.$mon$day"
 
ps -ef | grep "myprocess"| awk -v logfile=$log_file '{
 system("date >> logfile")
}'

can u please help as how to log the date to that logfile.
thanks in advance!