grep space problem - Unix

This is a discussion on grep space problem - Unix ; Hello., 1 gggggg C2052EX 15 Mar 31 13:03 1 rrrrrr C2052EX 15 Apr 3 12:00 todaydat=`date | awk -F" " '{print $2" "$3 }'` (# the output must be like Apr 3, or March 31 or Oct 8 etc) find ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: grep space problem

  1. grep space problem

    Hello.,

    1 gggggg C2052EX 15 Mar 31 13:03
    1 rrrrrr C2052EX 15 Apr 3 12:00

    todaydat=`date | awk -F" " '{print $2" "$3 }'` (# the output must be
    like Apr 3, or March 31 or Oct 8 etc)

    find DIR_PATH/START.*.*.*.ctl* -exec ls -ltr {} \; -mmin +200 | grep
    "$todaydat" | awk -F" " {'print $9'}

    I have a peculiar spacing problem.when i used the above find comman on
    march 31st it worked fine. but on april 3 it did not work.

    the reason: Mar 31
    Apr 3
    the space between r and 3 in Marc 31 is one
    but the space between r and 3 in Apr 3 is two.

    so the same find command which worked on march 31st is not working on
    april 3rd.

    can anyone please give me a suggestion to solve this.

    thanks
    pavi


  2. Re: grep space problem

    On 2006-04-03, pawan_test wrote:
    > Hello.,
    >
    > 1 gggggg C2052EX 15 Mar 31 13:03
    > 1 rrrrrr C2052EX 15 Apr 3 12:00
    >
    > todaydat=`date | awk -F" " '{print $2" "$3 }'` (# the output must be
    > like Apr 3, or March 31 or Oct 8 etc)


    Please do not multi-post; your question has been answered in
    another group.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

+ Reply to Thread