Sponsored Content
Top Forums Shell Programming and Scripting grep'ing a file until a certain message appears Post 302196741 by pallak7 on Monday 19th of May 2008 10:11:27 AM
Old 05-19-2008
Well, I would do that except for it's possible for the process to start up unhealthily (couldn't think of another word). This means that the process is alive but not functioning the way it's supposed to. In order for me to check if the process is alive and healthy, I have to check the log file. Also, it takes ~20 secs for the process to come up completely so I feel like the checking has to be done in a loop; I can't just check once and then move on.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep'ing for text within a bunch of files...?

I have, say, a dozen files, and I want to grep for a string of text within them. I don't remember the exact syntax, but let me give it a shot and show you an idea here... find . -type f -exec grep thisword {} \; ...and there's a way to put more than one grep into the statement, so it will tell... (1 Reply)
Discussion started by: kitykity
1 Replies

2. Shell Programming and Scripting

grep'ing for specific directories, and using the output to move files

Hello, this is probably another really simple tasks for most of you gurus, however I am trying to make a script which takes an input, greps a specific file for that input, prints back to screen the results (which are directory names) and then be able to use the directory names to move files.... (1 Reply)
Discussion started by: JayC89
1 Replies

3. Shell Programming and Scripting

grep'ing and sed'ing chunks in bash... need help on speeding up a log parser.

I have a file that is 20 - 80+ MB in size that is a certain type of log file. It logs one of our processes and this process is multi-threaded. Therefore the log file is kind of a mess. Here's an example: The logfile looks like: "DATE TIME - THREAD ID - Details", and a new file is created... (4 Replies)
Discussion started by: elinenbe
4 Replies

4. Shell Programming and Scripting

pipe'ing grep output to awk

This script is supposed to find out if tomcat is running or not. #!/bin/sh if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null then echo Tomcat for $1 running else echo Tomcat for $1 NOT running fi the /tomcat/bases is a file that... (2 Replies)
Discussion started by: ziggy25
2 Replies

5. Shell Programming and Scripting

grep'ing a variable that contains a metacharacter ($) with a while loop

This is driving me crazy, and I'm hoping someone can help me out with this. I'm trying to do a simple while loop to go through a log file. I'm pulling out all of the lines with a specific log line, getting an ID from that line, and once I have a list of IDs I want to loop back through the log and... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

6. Shell Programming and Scripting

Severe performance issue while 'grep'ing on large volume of data

Background ------------- The Unix flavor can be any amongst Solaris, AIX, HP-UX and Linux. I have below 2 flat files. File-1 ------ Contains 50,000 rows with 2 fields in each row, separated by pipe. Row structure is like Object_Id|Object_Name, as following: 111|XXX 222|YYY 333|ZZZ ... (6 Replies)
Discussion started by: Souvik
6 Replies

7. Shell Programming and Scripting

grep'ing dot history file

Hi, I tried to grep ".sh_history" (DOTsh_history) file and did not return anything though I found the word in .sh _history file through vi editor in Linux. Then I tried to grep ".profile" to check if it is the prob with hidden files and I got results. Then I verified the same with my friend... (4 Replies)
Discussion started by: bobbygsk
4 Replies

8. Shell Programming and Scripting

Grep'ing information from a log file on SUN OS 5

Hi Guys, I'm trying to write an script that will be launched by a user. The script will look at a log file and check for alerts with the date (supplied by user) and a machine's hostname (also supplied by the user). I'm trying to get the output formatted just like the log file. The logfile looks... (5 Replies)
Discussion started by: illgetit
5 Replies

9. UNIX for Dummies Questions & Answers

grep'ing a variable - why not working

Hi all, Am writing a ksh script where I am looking for processes that has gone defunct and all of which has the same PPID PID is the variable that I need to match as this is the process ID of the processes that has gone defunct Am just curious how come the following DOES NOT work? ps... (6 Replies)
Discussion started by: newbie_01
6 Replies

10. UNIX for Dummies Questions & Answers

After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks, While transferring file from FTP software like Filezilla the files gets corrupted. Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary... (6 Replies)
Discussion started by: Khan28
6 Replies
sigsend(2)							System Calls Manual							sigsend(2)

NAME
sigsend(), sigsendset() - send a signal to a process or a group of processes SYNOPSIS
DESCRIPTION
The system call sends a signal to a process or a group of processes. The process or group of processes to which the signal is to be sent is specified by id and idtype. The signal to be sent is specified by sig and is either one from the list given in (see signal(2)) or 0. If sig is equal to zero (the null signal), error checking is performed but no signal is actually sent. This can be used to check the validity of id and idtype. The real or effective user ID of the sending process must match the real or effective user ID of the receiving process, unless the process has appropriate privileges, or sig is and the sending process has the same session ID as the receiving process. idtype and id work together as follows: o If idtype is sig will be sent to the process with a process ID equal to o If idtype is sig will be sent to any process with a process group ID equal to o If idtype is sig will be sent to any process with a session ID equal to o If idtype is sig will be sent to any process with an effective user ID equal to o If idtype is sig will be sent to any process with an effective group ID equal to o If idtype is sig will be sent to all processes and id will be ignored. o If id is the value of id is taken from the calling process. The process with a process ID of is always excluded. The process with a process ID of is included only if idtype is equal to provides an alternate interface for sending signals to a set of processes. psp is a pointer to a structure that includes the following members: idop p_op; idtype_t p_lidtype; id_t p_lid; idtype_t p_ridtype; id_t p_rid; The structure defines a set of processes as the result of a set operation (difference, union, intersection, or exclusion) on two operands (idtype/id pairs). The left (right) operand is specified by and takes the values specified by id and takes the values specified by idtype in the system call defined above. p_op specifies the operand, and takes one of the following values: Set difference. The resultant set consists of the processes that are in the left operand and not in the right operand. Set intersection. The resultant set consists of the processes that are in both the left and right operands. Set union. The resultant set consists of the processes that are in either the left or right operand or both. Set exclusive The resultant set consists of the processes that are in either the left or right operand but not in both. RETURN VALUE
Upon successful completion, returns a value of Otherwise, it returns a value of -1 and sets to indicate the error. ERRORS
If fails, it sets errno (see errno(2)) to one of the following values: [EINVAL] sig is neither a valid signal number nor zero. [EINVAL] idtype is not a valid value. [EINVAL] sig is idtype is and id is [ESRCH] No process can be found corresponding to that specified by id and idtype. [EPERM] The user ID of the sending process is not 0, and its real or effective user ID does not match the real or effective user ID of the receiving process, and the calling process is not sending to a process that shares the same session ID. SEE ALSO
kill(2), signal(2). sigsend(2)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy