03-21-06 10:56 PM
On 2006-03-21, pawan_test <sridhara007@gmail.com> wrote:
> Hi Guys.,
>
>
> thanks for the suggestions. both the suggestions are working.
> ls -ltr | awk '{printf "%s\t%s\n",$6,$7;}'
> ls -ltr | awk '{ printf("%s %s\n",$6,$7); }'
>
> when i execute the above command it gives me all the values in the
> fields 6 and 7.
> i am looking in the output to display only march 21. ( i.e today's
> date) .
> can you please give me a suggestion.
Well, that's easy:
echo hi|awk '{ print "Mar\t21" }'
Or, if you want the current date if you run this tomorrow and beyond:
set $(date)
echo hi|awk '{ print "'$2'\t'$3'" }'
:-)
(Point of this satirical post: Providing a good specification for a problem
solution, even a seemingly simple one, is often difficult and requires great
precision. You need more precision in your problem statement if you want
to cut down on the number of repetitions of: "Yes, that does xxx nicely,
but that's not what I asked for - I asked for yyy.")
--
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.c
om ***
[ Post a follow-up to this message ]
|