Sponsored Content
Top Forums Shell Programming and Scripting comparing PID values of 2 Files in shell Options Post 302152277 by marconi on Wednesday 19th of December 2007 10:45:38 AM
Old 12-19-2007
comparing PID values of 2 Files in shell Options

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 each value of running
PIDs are less or more than the registered PIDs i.e. comparing the
value of each PID in both the files.


Request you to pls give your inputs.


Thanks a lot in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Comparing CRON PID w/Current PPID

All, I've got a script that needs to check if it was started by cron. The code seems to be right, but it's not running correctly if cron starts it. Am I getting the pid's correctly? I'm not having any luck figuring it out. :confused: Any help is appreciated! CRON_ID=$(ps -aef | grep... (1 Reply)
Discussion started by: GregWold
1 Replies

2. UNIX for Dummies Questions & Answers

shell script for comparing 2 files

Hi, how to read the 2 files and compare each other in shell script? i have 2 files test1 and test2, both files contains 20 character records.we have to compare file 1 records with file2, if exists then reject the record else we have to append it to test2 file. in file test1 around 100 single... (2 Replies)
Discussion started by: prashanth.spl
2 Replies

3. Shell Programming and Scripting

comparing 2 text files to get unique values??

Hi all, I have got a problem while comparing 2 text files and the result should contains the unique values(Non repeatable). For eg: file1.txt 1 2 3 4 file2.txt 2 3 So after comaping the above 2 files I should get only 1 and 4 as the output. Pls help me out. (7 Replies)
Discussion started by: smarty86
7 Replies

4. UNIX for Dummies Questions & Answers

Comparing two files and dividing the values

Hi all, I am new to unix and I am trying hard to get this requirement, but no luck. I am trying to compare two cloumns in two files and if it matches, the last column in file1 must be divided by file2 and the output must be written in a new file. To elaborate the 2nd column in file1 (EUR) must be... (6 Replies)
Discussion started by: smadderla
6 Replies

5. UNIX for Dummies Questions & Answers

Comparing two text files by a column and printing values that do not match

I have two text files where the first three columns are exactly the same. I want to compare the fourth column of the text files and if the values are different, print that row into a new output file. How do I go about doing that? File 1: 100 rs3794811 0.01 0.3434 100 rs8066551 0.01... (8 Replies)
Discussion started by: evelibertine
8 Replies

6. Shell Programming and Scripting

shell script for comparing two files

Hi, I have 2 files as below FILE1.dat co1|co2|co3 abnd|45.56|AZ dkny|30.2|PA sam|.23|VA FILE.CTL FILENAME|FILE1.dat NO OF RECORDS|3 CHECKSUM|75.99 Could you please help me to write a shell script to compare 1. TOTAL RECORDS from FILE1.dat with NO of RECORDS in FILE.CTL 2.... (8 Replies)
Discussion started by: dreamsportsteam
8 Replies

7. UNIX for Dummies Questions & Answers

Comparing two test files and printing out the values that do not match

Hi, I have two text files with matching first columns. Some of the values in the second column do not match. I want to write a script to print out the rows (only the first column) where the values in the second column do not match. Example: Input 1 A 1 B 2 C 3 D 4 Input 2 A 2 B 2... (6 Replies)
Discussion started by: evelibertine
6 Replies

8. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

9. Shell Programming and Scripting

Comparing the values of two files

Hi Am trying to compare the values of two files.. One is a big file that has many values and the other is a small file.. The big file has all values present in small file.. # cat SmallFile 4456602 22347881 7471282 15859891 8257690 21954701 7078068 18219229 2883826 6094959 100000 ... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

10. Shell Programming and Scripting

Comparing same column from two files, printing whole row with matching values

First I'd like to apologize if I opened a thread which is already open somewhere. I did a bit of searching but could quite find what I was looking for, so I will try to explaing what I need. I'm writing a script on our server, got to a point where I have two files with results. Example: File1... (6 Replies)
Discussion started by: mitabrev83
6 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] [-p|--show-pids] [-s|--show-parents] [-u|--uid-changes] [-Z|--security-context] [-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. 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 cur- rent 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.) -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. -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 AUTHORS
Werner Almesberger <werner@almesberger.net> Craig Small <csmall@enc.com.au> BUGS
Some character sets may be incompatible with the VT100 characters. SEE ALSO
ps(1), top(1). Linux 2012-05-20 PSTREE(1)
All times are GMT -4. The time now is 07:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy