Quote:
|
Quote:
#!/usr/bin/gawk -f FNR==1 { # when we encounter line 1 of a file FS=OFS= arg++ ? " " : ";" # arg = 1 for first file, 2 for second "date +%Y/%m/%d" | getline now } arg==1 { if ($6<now && $4==1) $4 = 0 enabled[$1] = $4 # record the enabled status of this username print $0 > "usersDB.conf" } arg==2 { print (enabled[$2] ? "" : "#") $0 > "access.conf" } thanks a lot. |
Quote:
Code:
#!/usr/bin/awk -f |
Quote:
String comparison is done as you would expect, and most charsets (including ASCII) are created so that digits follow the normal rules for succession (including 0 < 1). As long as all fields are padded (which in this case they are), the string comparison should suffice for dates. |
All times are GMT -5. The time now is 09:20 AM. |