The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 05-26-2009
cambridge cambridge is offline
Registered User
  
 

Join Date: May 2009
Posts: 55
I didn't spot that you were ignoring case in your grep commands. Changes in bold red:

Code:
gawk '
   BEGIN {
     for (i=-3;i<=3;i++)
     {
        cmd="date --date=\"" i "days\" \"+%b%d\""
        cmd | getline
        close(cmd)
        dy[tolower($0)]++
     }
   }
   { for (s in dy) if ($0 ~ "^" tolower(s) "[^0-9]") print }' les