Çarşamba, Nisan 22, 2009

An Awk feature

I was trying to use sub (or gsub) function in awk to delete an \r from the end of line. For that purpose I used
dum=sub(/\r/,"",$0)
and thought that the variable "dum" will be filled with the changed value of $0. But I realised that sub function only make the change and returns 0,1 accordingly. So I wrote like this
sub(/r/,"") ; x=$0;


1 yorum:

Adsız dedi ki...
Bu yorum bir blog yöneticisi tarafından silindi.