![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk gsub | pxy2d1 | Shell Programming and Scripting | 4 | 08-22-2008 08:14 AM |
| How to apply sub/gsub of awk on a particular field? | jaduks | Shell Programming and Scripting | 1 | 12-05-2007 05:16 AM |
| Help with AWK and gsub | npolite | Shell Programming and Scripting | 4 | 11-15-2007 04:21 PM |
| use var in gsub of awk | summer_cherry | Shell Programming and Scripting | 1 | 10-15-2007 05:01 AM |
| Gsub and nawk | scotty_123 | Shell Programming and Scripting | 1 | 05-10-2007 11:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 ![]() Regards, Scorpio |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|