Home » Infrastructure » Unix » script not returning values
script not returning values [message #97913] Tue, 27 May 2003 05:04 Go to next message
Messages: 255
Registered: April 2000
Senior Member
Hi experts

i want to list all the files that have a day as some value....
Day=`date +%d`

THis will have the day of the month...say 27.
Now when i say

ls -ltr | awk '$7==$Day{print $9}'

This command is not returning any values...but when i say

ls -ltr | awk '$7==27{print $9}'
i get data.

Please help me whats wrong here.

Re: script not returning values [message #97945 is a reply to message #97913] Thu, 03 July 2003 01:26 Go to previous message
Daniele Rattellini
Messages: 38
Registered: August 2002
single quotes do not interpole shell variables!

use this instead

ls -ltr | awk '$7=='$Day'{print $9}'

Previous Topic: reading from buffer console
Next Topic: Keyboard mapping problem
Goto Forum:

Current Time: Wed May 22 11:52:33 CDT 2024