Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with an awk's program, help me please

Status
Not open for further replies.

zoufri75

Technical User
Mar 17, 2002
25
FR
Is it possible to replace the old line by the new line generate by the awk command ??

my program looks like that now (for the moment my program add a new line) :

datedumois=`date +%m%y`
date_fic=` grep HTBACS fic_htbacs | awk '{print $7}'`

if [[ $date_fic = $datedumois ]]
then
echo "le fichier n'as pas besoin d etre mis a jour" > htbacs.log
break
else
awk '/HTBACS/ {datedumois="'`date +%m%y`'" ; $NF = datedumois ;
print $1"\t\t\t\t\t"$2" "$3"\t "$4"\t\t\t "$5,$6,$7 }' fic_htbacs >> fic_htbacs

fi
~

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top