awk command - Unix

This is a discussion on awk command - Unix ; Hi all., i am working on script. I have a file. i type ls -ltr and i get -rwxrwx--- 1 pavi C2052EX 15 Mar 21 09:50 START.TTN.20060321.095017.ctl_20060321095032 ( pls note everything is in 1 line, here it came in 2 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: awk command

  1. awk command

    Hi all.,

    i am working on script.

    I have a file. i type ls -ltr and i get

    -rwxrwx--- 1 pavi C2052EX 15 Mar 21 09:50
    START.TTN.20060321.095017.ctl_20060321095032

    ( pls note everything is in 1 line, here it came in 2 lines.)

    I have to use awk command and only get the MAR 21 to be displayed in
    the out.it is tab delimited.

    can anyone help me please how can i do it using awk

    thanks
    pavi


  2. Re: awk command


    "pawan_test" wrote in message
    news:1142958286.919378.70320@e56g2000cwe.googlegro ups.com...
    > Hi all.,
    >
    > i am working on script.
    >
    > I have a file. i type ls -ltr and i get
    >
    > -rwxrwx--- 1 pavi C2052EX 15 Mar 21 09:50
    > START.TTN.20060321.095017.ctl_20060321095032
    >
    > ( pls note everything is in 1 line, here it came in 2 lines.)
    >
    > I have to use awk command and only get the MAR 21 to be displayed in
    > the out.it is tab delimited.
    >
    > can anyone help me please how can i do it using awk
    >
    > thanks
    > pavi
    >


    One way (out of many)

    Pipe it through:
    awk '{print substr($0,42,6)}'

    and if you want it in caps, use the awk function 'toupper', or the Unix
    utility 'tr'.







+ Reply to Thread