![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| modifying grep to return latest files | ragha81 | Shell Programming and Scripting | 5 | 04-02-2009 11:16 AM |
| how to grep word from .gz files & .z files | udaya_subbu | Shell Programming and Scripting | 8 | 08-08-2008 05:53 AM |
| modifying C file and linking back to project files | bruins2005 | UNIX for Dummies Questions & Answers | 1 | 06-22-2006 11:08 PM |
| Perl - Appending/Modifying Excel files | srinivay | Shell Programming and Scripting | 2 | 01-10-2005 06:46 AM |
| How can I ... (Modifying large ASCII files) | hviktor | UNIX for Dummies Questions & Answers | 2 | 07-20-2001 10:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
modifying grep to get files only within last 2 hrs
Hi gurus
I am currently using the below mentioned grep to find timestamp of last generated log file. Code:
touch -t $time_search dummy
ecust_time_stamp=$(find . -name 'eCustomerCME*' -newer dummy -type f -exec ls -ltr {} \; | tail -1 | awk ' { print $6,$7,$8 } ')
Code:
export day=`date +%d`
export month=`date +%m`
export day_len=${#day}
export mon_len=${#month}
export hr_min=0000
if [[ $day_len -lt 2 ]] || [[ $mon_len -lt 2 ]]
then
month=0$month
day=0$day
export time_search=$month$day$hr_min
else
export time_search=$month$day$hr_min
fi
thanks in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|