Awk Gsub Query

Hi,

Can some one please explain the following line please throw some light on the ones marked in red

awk '{print $9}' ${FTP_LOG} | awk -v start=${START_DATE} 'BEGIN { FS = "." } { old_line1=$0; gsub(/\-/,""); if ( $3 >= start ) print old_line1 }' | awk -v end=${END_DATE} 'BEGIN { FS="." } { old_line2=$0; gsub(/\-/,""); if ( $3 <= end ) print old_line2 }' > ${FILES_TO_DOWNLOAD}

Thank you

Hi,

Put some echo statements inside the script for FTP_LOG ,START_DATE etc.. and for understanding run each command seperately (seperated by '|' )

It looks like printing the 9 th filed from FTP_LOG first and declaaring variables like START_DATE inside the awk, seperator is ' . '. and substtuting the values with gsub function.

And u didnt marked as red anywhere :slight_smile:

Regards,
Scorpio

The gsub function is the part I couldnt understand,

Thanks

It removes all dash characters. (The backslash is redundant, but luckily harmless.)