nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to grep the date range

This is a discussion on How to grep the date range within the Shell scripting forums, part of the Development/Scripting category; Thanks a lot dear, its working I was doing a silly mistake as mentioned below at one side i was ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #11 (permalink)  
Old 05-13-2008, 06:42 PM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 8
Rep Power: 0
sainipardeep is on a distinguished road
Default Thanks a lot

Thanks a lot dear, its working I was doing a silly mistake as mentioned below

at one side i was using April instead of 'Apr'


egrep '(2[8-9]|3[0])/Apr/2008|0[1-2]/May/2008' server-81-access_log

This works fine.
Reply With Quote
Sponsored Links
  #12 (permalink)  
Old 06-25-2008, 12:05 PM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 8
Rep Power: 0
sainipardeep is on a distinguished road
Default

Syntax change to Shell Script

Can anyone change the syntax to shell script syntax as need to execute the file in Solaris box.
-----------------------
Batch file is:

@REM Windows Build Script

@REM %1 = ANT_TARGET
@REM %2 = BUILD_ENV
@REM %3 = BUILD_NUMBER

set ANT_TARGET=%1
set BUILD_ENV=%2
set BUILD_NUMBER=%3

@REM set ANT_TARGET=clean
@REM set BUILD_ENV=murat

set BATCH_FILE_DIR=%~dp0%

cd "%BATCH_FILE_DIR%\..\..\.."

set WORKSPACE_DIR=%cd%

cd "%BATCH_FILE_DIR%"

set COMMON_DIR=%WORKSPACE_DIR%\common

set EXIT_CODE=0

set DIST_DIRECTORY=%COMMON_DIR%\dist

if "%BUILD_ENV%" == "" set BUILD_ENV=local

if "%BUILD_ENV%" == "local" goto localBuildEnv
set ENV_BAT_FILE=%COMMON_DIR%\scripts\build\env\%BUILD _ENV%\%BUILD_ENV%_env.bat
goto gotEnvBatFile

:localBuildEnv
set ENV_BAT_FILE=%COMMON_DIR%\local\local_env.bat

:gotEnvBatFile
@REM Call batch to get env vars set
call "%ENV_BAT_FILE%"

if %ERRORLEVEL% NEQ 0 set EXIT_CODE=1

echo JAVA_HOME=%JAVA_HOME%
echo GROOVY_HOME=%GROOVY_HOME%
echo ANT_HOME=%ANT_HOME%

set LIB_DIR=%WORKSPACE_DIR%\lib

REM Needed for ftp
set GANT_CLASSPATH=%LIB_DIR%\apache\jakarta\oro\jakart a-oro-2.0.8.jar;%LIB_DIR%\apache\jakarta\commons\commons-net-1.4.1.jar;

REM Needed for scp
set GANT_CLASSPATH=%GANT_CLASSPATH%;%LIB_DIR%\sourcefo rge\jsch\jsch-0.1.38.jar

"%GROOVY_HOME%\bin\gant" -P "%GANT_CLASSPATH%" -D BUILD_ENV=%BUILD_ENV% -D WORKSPACE_DIR=%WORKSPACE_DIR% -D DIST_DIR=%DIST_DIRECTORY% -D BUILD_NUMBER=%BUILD_NUMBER% -f "%COMMON_DIR%\scripts\build\buildAll.gant" %ANT_TARGET%

if %ERRORLEVEL% NEQ 0 set EXIT_CODE=1

exit /b %EXIT_CODE%
Reply With Quote
  #13 (permalink)  
Old 06-25-2008, 05:45 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 571
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Above is Windows batch script and not shell script
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #14 (permalink)  
Old 06-26-2008, 07:34 AM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 8
Rep Power: 0
sainipardeep is on a distinguished road
Default I Know

I know this is Windows batch script and not shell script. I am asking to convert it to shell script.

Please don't mind but i think u didn't read my question properly.

" Can anyone change the syntax to shell script syntax as need to execute the file in Solaris box." mentioned in my last update.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
Shell date command for manipulation and formatting date newbie4 Shell scripting 1 01-30-2008 01:21 PM
Grep ip address in Linux or UNIX sweta Getting started tutorials 0 07-27-2007 06:47 AM
Linux sync. out of range monitor error harshala09 Linux hardware 2 06-14-2007 09:37 AM
Grep and remove files Linux software 1 01-05-2006 06:25 PM


All times are GMT +5.5. The time now is 11:56 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36