listing file date and time without usage of pipe

Hi ,
I am using below code to list the 6th,7th and 8th field of the file

ls -lrt test | awk '{print $6,$7,$8}'

output:

Nov 21 19:34

Now the problem here is that I want to do it without the usage of pipes as its now allowed in my production environment

Please let me know how it can be achieved

Regards,
Harish

Why is a pipe not allowed in a production environment?

Actually its not allowed in production environment as we need to run through query id
Through backgroud id we can but we have to run it only through query id

So I am looking for an alternative to pipe

Regards,
Harish

I don't understand the meaning of "run through query id", but if you have the stat program (usually you have it by default on Linux), you can display the file modification time with a single command.

Very odd request!
See if this will help...

stat -c %y test
awk -v arg="$(ls -l test)" 'BEGIN{split(arg,a);print a[6],a[7],a[8]}'

--ahamed

awk '{print $6,$7,$8}' <(ls -lrt test)

:smiley:
Nice!

--ahamed