grep within ksh program


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting grep within ksh program
# 1  
Old 02-21-2006
grep within ksh program

Hi,
is there problem with grep command when using ksh?
I had the below command:
/usr/bin/grep \""$Mon $NewDD\"" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null

when I run ksh in debug mode, this command can not grep anything even the data is in the file.

+ /usr/bin/grep "Feb 9" /tmp/timemanager/intlog.12173
+ 1>> /tmp/timemanager/log.12173 2> /dev/null


But when I just type in the above command and it runs fine.( I think I have sh as default shell program at the prompt)

Any help would be apreciated!
# 2  
Old 02-21-2006
grep command in ksh

Hello?

Is it so strange that no one knows about it?
# 3  
Old 02-22-2006
Quote:
Originally Posted by cin2000
Hello?

Is it so strange that no one knows about it?
Please read the forum rules.
Do not bump up questions if they are not promptly answered.

It would definitely work perfectly and it worked.

post the file,
search pattern
and the snippet of script (where u grep )
# 4  
Old 02-22-2006
ksh grep

Well, I fixed my problem by only put on one quotation mark at each end like below:

/usr/bin/grep "$Mon $NewDD" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null


It does not make sense to me.

Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies

2. Shell Programming and Scripting

AWK Program Not Executing On Linux with KSH

Overview: I have an AWK program that parses thru a database backup server log file and outputs ths following parameters SRNO DATE : TIME SIZE IN(KB) DATABASE NAME DUMP TYPE 1 May 16 2012: 13:30:00 6874 TestDB database 2 May 16 2012: 13:30:44 11462 master database Problem: This program has... (5 Replies)
Discussion started by: JolietJake
5 Replies

3. Shell Programming and Scripting

ksh program

Hi, I have a text file with multiple sql statements in which I have pick only the below select update and delete statements and do print as given below. All the select,update,delete statements will be as same as ( subquery with ().all statements ending with ; ) the examples given below. 1)... (19 Replies)
Discussion started by: manasa_vs
19 Replies

4. Shell Programming and Scripting

Passing answers to external program from KSH

I have asked this before but I haven't had any luck so far getting this to work. I use RCS(revision control system). When it runs if I pass the value 'unlock' to $3 its reassigned to $unlock. When I run the command (rcs -u'version number' 'filename') ti will ask me 1-(Do you want to break the lock... (5 Replies)
Discussion started by: pjones006
5 Replies

5. Shell Programming and Scripting

Automating a Java program using KSH

Hi Guys, We have a java program that basically install updates to an existing software. The java program consist of several screens asking user for choices (please see below for a detailed example) *** Screen 1 *** Please choose the operation you want to perform: 1. Install new... (5 Replies)
Discussion started by: maddmaster
5 Replies

6. Shell Programming and Scripting

convert ksh to C program

Hi Guys...is there a way to convert a .ksh script to .C program..? (3 Replies)
Discussion started by: aggars
3 Replies

7. Shell Programming and Scripting

Invoke perl program from Ksh

Hi all, Can I invoke a perl script from Ksh script and pass parameters to the perl script. Please do help me.. thanks Maha (10 Replies)
Discussion started by: mahalakshmi
10 Replies

8. Shell Programming and Scripting

ksh program with password

Hi, I am looking for a way to utilize password when the ksh program is launched. What's the standard or best way to do it? Thanks for your help! (5 Replies)
Discussion started by: cin2000
5 Replies

9. Programming

parameters from my program in c to a .ksh script

hi.. this is my question: it is possible transfer parameters from my program written in C to a .ksh script? how can i do it? i have a program in C, what is called from a .ksh script, and i need what the C program returns some values (parameters) please, help me - any idea thanks ... (2 Replies)
Discussion started by: DebianJ
2 Replies

10. UNIX for Advanced & Expert Users

date program in ksh

#Author : kkodava #!/usr/bin/ksh #Use of this program is You can findout the no of days & day of starting and ending dates #usage no_of_days startdate<yyyymmdd> enddate<yyyymmdd> syy=`echo $1|cut -c1-4` smm=`echo $1|cut -c5-6` sdd=`echo $1|cut -c7-8` eyy=`echo $2|cut -c1-4` emm=`echo... (1 Reply)
Discussion started by: krishna
1 Replies
Login or Register to Ask a Question