Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > OS Script problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-08, 12:14
ishu.cs ishu.cs is offline
Registered User
 
Join Date: Mar 2008
Posts: 19
OS Script problem

Friends
I m tryin to write a script to collect the logs from iqmsg file as the file is to large i hav to grep the log messages of particular time.
The format of the messages in the file is as
06/11 20:00:00......................
i wrote the script as following


dir1=/sybasedata/sybase
iqmsg=`date +%m`/`date +%d`
temp=`date +%H`
echo $temp
temp2=' '
temp1='"'$iqmsg$temp2$temp'"'
echo $temp1
echo $iqmsg

dir2=$dir1/mydb.iqmsg
#echo $dir2
grep $test1 $dir2 > /opt/sybase/SCRIPTS/logs/iqmsglog

o/p of echo is "06/11 14"
when i use
$ grep "06/11 14" /sybasedata/sybasemydb.iqmsg >/opt/sybase/SCRIPTS/logs/iqmsglog

it greps the required information into /opt/sybase/SCRIPTS/logs/iqmsglog

but when i tried to do the same thing from inside the script it gives me the error:
grep: 0652-033 Cannot open 20".


can anybody help me in this i am using AIX OS.
Reply With Quote
  #2 (permalink)  
Old 06-11-08, 12:21
mike_bike_kite mike_bike_kite is offline
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
change the bit that says
Code:
grep $test1 $dir2
to
Code:
grep "$test1" $dir2
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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