I would have thought that the first command would have work or shouldn't it?
It should - e.g. this works on ksh 93s+ (RHEL):
However, I'm a bit confused about what you're trying to do? All that will get you is a list of (the same) PPID - which you already know...
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)
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)
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)
Hello,
I'm writing a script that will automate the launch of some services on my AIX machine. However, some services are dependent on the successful startup of others. When I start these services manually, I usually just check a log file until I see a message that confirms a successful... (3 Replies)
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)
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)
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)
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)
Hi,
If I hard code a value in the grep it works fine from script, when I use variable it doesn't work. On a seperate note, some lines (during testing) works fine from command line but not from scirpt.
#!/bin/bash
# Will fetch the (oldest - as ls will sort by name by default)Date in the... (7 Replies)
Hello,
I am using below code :
export ORAR=orp712z.int.thomsonreuters.com
#echo $ORAR;
if echo $ORAR|grep -i "_"
then
ORACLE_SID1= echo $ORAR|cut -f2 -d "_"
echo $ORACLE_SID1
ORACLE_SID=fgrep "$ORACLE_SID1" /etc/oratab|cut -f1 -d ":"
#echo $ORACLE_SID
else
ORACLE_SID1= echo $ORAR|cut... (1 Reply)
Discussion started by: admin_db
1 Replies
LEARN ABOUT FREEBSD
preap
preap(1) User Commands preap(1)NAME
preap - force a defunct process to be reaped by its parent
SYNOPSIS
preap [-F] pid...
DESCRIPTION
A defunct (or zombie) process is one whose exit status has yet to be reaped by its parent. The exit status is reaped via the wait(3C),
waitid(2), or waitpid(3C) system call. In the normal course of system operation, zombies may occur, but are typically short-lived. This may
happen if a parent exits without having reaped the exit status of some or all of its children. In that case, those children are reparented
to PID 1. See init(1M), which periodically reaps such processes.
An irresponsible parent process may not exit for a very long time and thus leave zombies on the system. Since the operating system destroys
nearly all components of a process before it becomes defunct, such defunct processes do not normally impact system operation. However, they
do consume a small amount of system memory.
preap forces the parent of the process specified by pid to waitid(3C) for pid, if pid represents a defunct process.
preap will attempt to prevent the administrator from unwisely reaping a child process which might soon be reaped by the parent, if:
o The process is a child of init(1M).
o The parent process is stopped and might wait on the child when it is again allowed to run.
o The process has been defunct for less than one minute.
OPTIONS
The following option is supported:
-F Forces the parent to reap the child, overriding safety checks.
OPERANDS
The following operand is supported:
pid Process ID list.
EXIT STATUS
The following exit values are returned by preap, which prints the exit status of each target process reaped:
0 Successfully operation.
non-zero Failure, such as no such process, permission denied, or invalid option.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu (32-bit) |
+-----------------------------+-----------------------------+
| |SUNWesxu (64-bit) |
+-----------------------------+-----------------------------+
SEE ALSO proc(1), init(1M), waitid(2), wait(3C), waitpid(3C), proc(4), attributes(5)WARNINGS
preap should be applied sparingly and only in situations in which the administrator or developer has confirmed that defunct processes will
not be reaped by the parent process. Otherwise, applying preap may damage the parent process in unpredictable ways.
SunOS 5.10 26 Mar 2001 preap(1)