Sponsored Content
Full Discussion: comparing PIDs in shell..
Top Forums Shell Programming and Scripting comparing PIDs in shell.. Post 302152271 by marconi on Wednesday 19th of December 2007 10:17:58 AM
Old 12-19-2007
comparing PIDs in shell..

Hi,

There is a file having a list of running PIDs and another file having a list of registered PIDs. How can we check if the number of running PIDs are less or more than the registered PIDs, comparing the total no. in each and also each value.

Request you to pls give your inputs.

Thanks a lot in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing 2 dates in Bourne shell

HI, I am able to find days difference using FIND command. However it is comparing between today and the last time it was modified. I now need to find the difference between a date specified by myself and the last time the file was modified. Is there a command which I can use or I have to... (1 Reply)
Discussion started by: scmay
1 Replies

2. Shell Programming and Scripting

Shell Script for PIDs

I am trying to write a Shell script wherein the shell needs to read a list of PID in the File $stat/bin/Process and compare it to the PID of the processes running on a server. Also the script should return KO(not OK) with corresponding label :- a) When an environmental variable not... (2 Replies)
Discussion started by: marconi
2 Replies

3. Shell Programming and Scripting

Comparing PIDs in a Shell...

Hi, There is a file having a list of running PIDs (pid_process) and another file having a list of registered PIDs (pid_regieter). I want to check if:- a) there is at least one running PID that does not correspond to a registered PID (listing the PID not registered in the file) ... (1 Reply)
Discussion started by: marconi
1 Replies

4. Shell Programming and Scripting

Comparing each of the value in a column with the known value - in Shell

I have the column as 2.14% 1.42% 0.64% 0.50% 0.44% 0.38% 0.38% 0.36% 0.35% 0.35% 0.32% 0.32% 0.31% 0.30% 0.30% I want to find out if any of these values is greater than 75%, is yes then print that value. (2 Replies)
Discussion started by: Santosh251982
2 Replies

5. Solaris

Conflict with PIDs

I am trying to determine the root cause of a java process that dies trying to startup during it's cron job. I did go ahead and change the time that it starts up in the cron file and now it starts successfully. However is there a way to determine what PID a process was attempting to get when... (5 Replies)
Discussion started by: vedder191
5 Replies

6. Shell Programming and Scripting

Comparing 2 file use c shell script

Hi all, I got 2 file : file1: file2: output: But , must write out in C shell.Anybody can help solve? (6 Replies)
Discussion started by: proghack
6 Replies

7. Shell Programming and Scripting

comparing 2 files in shell script

I have 2 files config1h.txt ----------------- BFMU=ENABLE,ID=PM THR=OFF,REP=ALL,CON=IACM,TIM=OFF;GPON collection strategy 1.3.6.1.2.1.2.2:8 1.3.6.1.2.1.2.2:7 1.3.6.1.4.1.637.61.1.35.11.4:4 1.3.6.1.4.1.637.61.1.35.11.4:3 1.3.6.1.4.1.637.61.1.35.10.1:2 1.3.6.1.4.1.637.61.1.35.10.1:43... (7 Replies)
Discussion started by: LavanyaP
7 Replies

8. Shell Programming and Scripting

Need help to kill pids

Hi there !!! I am writing a script to kill the pids on different linux boxes :cool: the output of my command gives the pids running on that box, but how can I kill all the pids without looping? :confused: Code: ssh $i ps -fu $USER | grep ManServer | grep -v grep | awk '{print $2}' | kill ... (4 Replies)
Discussion started by: prany_cool
4 Replies

9. Shell Programming and Scripting

Comparing dates in shell script

Hi All, I have a date variable say dt="2014-01-06 07:18:38" Now i need to use this variable to search a log and get the entries which occured after that time. (1 Reply)
Discussion started by: Girish19
1 Replies

10. Shell Programming and Scripting

Get all associated pids

im looking for a portable way to get the PID of the script that is running, and to get every other PIDs that are spawned from it. and by ever other PIDs, i presume, that would be "child processes". however, i want to shy away from using any command that is not available on every single unix... (1 Reply)
Discussion started by: SkySmart
1 Replies
PSTREE(1)							   User Commands							 PSTREE(1)

NAME
pstree - display a tree of processes SYNOPSIS
pstree [-a, --arguments] [-c, --compact] [-h, --highlight-all, -Hpid, --highlight-pid pid] [-g] --show-pgids] [-l, --long] [-n, --numeric-sort] [-N, --ns-sortns [-p, --show-pids] [-s, --show-parents] [-S, --ns-changes] [-u, --uid-changes] [-Z, --security-con- text] [-A, --ascii, -G, --vt100, -U, --unicode] [pid, user] pstree -V, --version DESCRIPTION
pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown. pstree visually merges identical branches by putting them in square brackets and prefixing them with the repetition count, e.g. init-+-getty |-getty |-getty `-getty becomes init---4*[getty] Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g. icecast2---13*[{icecast2}] If pstree is called as pstree.x11 then it will prompt the user at the end of the line to press return and will not return until that has happened. This is useful for when pstree is run in a xterminal. Certain kernel or mount parameters, such as the hidepid option for procfs, will hide information for some processes. In these situations pstree will attempt to build the tree without this information, showing process names as question marks. OPTIONS
-a Show command line arguments. If the command line of a process is swapped out, that process is shown in parentheses. -a implicitly disables compaction for processes but not threads. -A Use ASCII characters to draw the tree. -c Disable compaction of identical subtrees. By default, subtrees are compacted whenever possible. -G Use VT100 line drawing characters. -h Highlight the current process and its ancestors. This is a no-op if the terminal doesn't support highlighting or if neither the current process nor any of its ancestors are in the subtree being shown. -H Like -h, but highlight the specified process instead. Unlike with -h, pstree fails when using -H if highlighting is not available. -g Show PGIDs. Process Group IDs are shown as decimal numbers in parentheses after each process name. -p implicitly disables com- paction. If both PIDs and PGIDs are displayed then PIDs are shown first. -l Display long lines. By default, lines are truncated to the display width or 132 if output is sent to a non-tty or if the display width is unknown. -n Sort processes with the same ancestor by PID instead of by name. (Numeric sort.) -N Show individual trees for each namespace of the type specified. The available types are: ipc, mnt, net, pid, user, uts. Regular users don't have access to other users' processes information, so the output will be limited. -p Show PIDs. PIDs are shown as decimal numbers in parentheses after each process name. -p implicitly disables compaction. -s Show parent processes of the specified process. -S Show namespaces transitions. Like -N, the output is limited when running as a regular user. -u Show uid transitions. Whenever the uid of a process differs from the uid of its parent, the new uid is shown in parentheses after the process name. -U Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54 and above, UTF-8 mode is entered on the console with echo -e ' 33%8' and left with echo -e ' 33%@' -V Display version information. -Z (SELinux) Show security context for each process. This flag will only work if pstree is compilied with SELinux support. FILES
/proc location of the proc file system BUGS
Some character sets may be incompatible with the VT100 characters. SEE ALSO
ps(1), top(1). psmisc 2012-07-28 PSTREE(1)
All times are GMT -4. The time now is 01:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy