I need something very simple yet I cannot get the syntax correct:
assuming :
date // will return a value of Mon Oct 6 22:58:56 EDT 2008
and
date | awk '{print $2,$3}' // will return a value of Oct 6
I would like to do a grep of that value surrounded by single quotes. i.e. 'Oct 6'
and use it in the following way:
ls -ltrR /TEST_Logs/ | grep < date | awk '{print $2,$3}'
essentially I want to list the TEST_Logs directory and all subdirectories and filter it on the date, but it has to be in single quotes because it is 2 words. So my 2 problems are:
1. How do I redirect the date/awk command into a grep?
and
2. What must I change in my awk command to include single quotes?
i.e.
ls -ltrR /TEST_Logs | grep 'Oct 6'
any help is much appreciated.
assuming :
date // will return a value of Mon Oct 6 22:58:56 EDT 2008
and
date | awk '{print $2,$3}' // will return a value of Oct 6
I would like to do a grep of that value surrounded by single quotes. i.e. 'Oct 6'
and use it in the following way:
ls -ltrR /TEST_Logs/ | grep < date | awk '{print $2,$3}'
essentially I want to list the TEST_Logs directory and all subdirectories and filter it on the date, but it has to be in single quotes because it is 2 words. So my 2 problems are:
1. How do I redirect the date/awk command into a grep?
and
2. What must I change in my awk command to include single quotes?
i.e.
ls -ltrR /TEST_Logs | grep 'Oct 6'
any help is much appreciated.