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
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