![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep/awk not getting the message correctly | SwapnaNaidu | Shell Programming and Scripting | 2 | 11-12-2008 01:56 AM |
| grep -A switch not working correctly with -m | zer0 | UNIX for Dummies Questions & Answers | 2 | 06-19-2008 07:26 AM |
| Grep date from ls -l | GenMen | Shell Programming and Scripting | 1 | 05-01-2008 10:53 PM |
| Is grep being used correctly? | sai0899 | Shell Programming and Scripting | 2 | 04-18-2008 01:03 AM |
| ls -l | grep $date (failing) | yongho | Shell Programming and Scripting | 1 | 08-01-2005 04:30 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am still a novice at this stuff, but I have searched everywhere and I cant seem to get this working.
I am using a database program that I need to pull information from. The command I am using is the following. search /project | grep "date -v -1m "+%Y-%m"" This returns no results, however if I break it down it doesnt make sense to me because, date -v -1m "+%Y-%m"" will return the result of "2009-02" If I run the command search /project | grep "2009-02" I get the results I expect (every file with a creation date or modification date of 2009-02 If I create a variable x=2009-02 then run the command search /project | grep "$x" this works and returns all the files created or modified in 2009-02 So why is it that if I set my variable as the date of the previous month using lastmonth=" date -v -1m "+%Y-%m"" and then run the search with search /project | grep "$lastmonth" gives me no results? Also, FYI, I tried running the whole command together /search /project | grep " date -v -1m "+%Y-%m"" and still got no results. Please help. I feel like I've been going in circles on this for 2 days now. Thanks -- Jason |
![]() |
| Bookmarks |
| Tags |
| date, grep, search, variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|