The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Translating gcc/g++/gfortran Options to Sun Studio Compiler Options iBot Solaris BigAdmin RSS 0 02-04-2009 02:30 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 06:06 PM
JavaScript::Squish 0.07 (Default branch) iBot Software Releases - RSS News 0 03-17-2008 08:00 PM
Associated array from command line options jperret Shell Programming and Scripting 1 01-10-2008 05:16 PM
Executing command line options Safia High Level Programming 8 07-04-2002 03:50 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-26-2009
nomkev nomkev is offline
Registered User
  
 

Join Date: May 2009
Posts: 6
any way to squish several date options into one line?

this obviously isnt overly important, but its a bit slow and i was wondering if i could prevent it from re-searching the file several times. i want my matches from the previous and coming three days, as well as today. this is what i have but its weighty and im having trouble finding a way to slim it down.

cd ~/work
grep -iT `date --date="3 days ago" "+%b%d"` les
grep -iT `date --date="2 days ago" "+%b%d"` les
grep -iT `date --date="1 days ago" "+%b%d"` les
grep -iT `date "+%b%d"` les
grep -iT `date --date="next day" "+%b%d"` les
grep -iT `date --date="2 days" "+%b%d"` les
grep -iT `date --date="3 days" "+%b%d"` les

just need to spit out the lines starting with mmmdd, and im hoping to save some space/time.
thanks
nomkev
 

Bookmarks

Tags
date, grep

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0