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 -->
  #4 (permalink)  
Old 01-29-2008
smr_rashmy smr_rashmy is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 41
Could you please explain me both when you find time?

hey its not working ya.

$ dt=`date -u +%d-%m-%y`
$
$ echo $dt
29-01-08
$
$ cat tst.txt
Date 12-01-08
$
$ awk -v dat=$dt -v '{if( $1 ~ /Date/) print $1" "dat;}' tst.txt
Usage: awk [-F fs][-v Assignment][-f Progfile|Program][Assignment|File] ...
$
$ sed -e 's/Date\(.*\)/Date '$dt'/' tst.txt
Date 29-01-08
$ cat tst.txt
Date 12-01-08
$

what is wrong with my command?

Last edited by smr_rashmy; 01-29-2008 at 01:11 AM..