Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to display only the first 5 running process using top in shell scripting? Post 302986160 by Meeran Rizvi on Monday 21st of November 2016 06:00:08 AM
Old 11-21-2016
Hey Rudic,
its working as expected,but why we need to give n1?
without giving n1 is also giving the same output
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How Can I Have Top Display The Top 20 Processes??

how can i do that in a script withough havin the script halt at the section where the top command is located. am writign a script that will send me the out put of unx commands if the load average of a machine goes beyond the recommended number. top -n 20 i want to save this output to a file... (1 Reply)
Discussion started by: TRUEST
1 Replies

2. UNIX for Advanced & Expert Users

Top running process

Hi, I have an oracle process running on top for a week now, but I couldnt see the same process with in oracle. how do I know what this process is? -GK P.S: when I say i didn't see within oracle, what I mean is I didn't see this process through oracle utility which shows all the oracle process (1 Reply)
Discussion started by: caprikar
1 Replies

3. UNIX for Dummies Questions & Answers

top ten utilities in shell scripting?

Let's get some feedback about the top ten ute's you guys use in writing your scripts - I mean yeah it depends on the job and what you're trying to accomplish, but there ARE those commands (sed, grep, awk, cut, etc.) that most will use time and again... ...so, what do you use? (3 Replies)
Discussion started by: diego
3 Replies

4. UNIX for Dummies Questions & Answers

Shell scripting adding text to top of file

Hi this is quite simple i am sure but without using awk or sed i need to add text to the top of a file this is what i have got so far #!bin/bash echo "Add text to top of file" read line echo $line >> file1 This adds the text to the bottom of the file can some1 please help cheers (7 Replies)
Discussion started by: meadhere
7 Replies

5. UNIX for Dummies Questions & Answers

perl scripting for checking if a process is running

Hi All, I am new to perl and have been trying to write a short script to check a process.Though i havent reached to the stage where i can match the output. I am trying to pass a variable x with value /opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar and then pass another variable... (2 Replies)
Discussion started by: pistachio
2 Replies

6. Shell Programming and Scripting

Shell script to display top 5 process (per cpu consumption)

Hello, I have to create shell script being myself real novice in scripting... I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success. For exemple total number of... (2 Replies)
Discussion started by: mr_awd
2 Replies

7. Shell Programming and Scripting

How to calculate months and display in shell scripting

I just want to know, how do we calculate the months in shell scripting. If i give the input as 20-01-2011, the output should be 20-02-2011, 20-03-2011 or 20-04-2011........ How do i get this ? Cheers. (6 Replies)
Discussion started by: sachin24
6 Replies

8. Shell Programming and Scripting

Display the First and Last name from a file using shell scripting

I am new to shell scripting and doing a similar thing @ work Stan:Smith:Detroit:MI Jim:Jones:Farmington Hills:MI Jack:Frost:Denver:CO Sue:Apple:New York:NY Cindy:Thompson:Battle Creek:MI John:Smith:Denver:CO George:Jones:New York:NY Need to create a shell script This script will display... (1 Reply)
Discussion started by: jakemathew
1 Replies

9. Shell Programming and Scripting

Need help in shell Scripting to display a output from a command

Please find my below requirement and see if you can help me on this. I am looking for a shell script which can provide me the below output. Manuall steps which i am doing now 1) First I source the File $ . ./WC_env.sh 2) Execute the command $ /app/oracle/product/mos/bin/mosotl -url... (2 Replies)
Discussion started by: sudheshpn@gmail
2 Replies

10. Shell Programming and Scripting

Display current directory for a running process for script

I'm trying to create a ksh script to do the following: 1) Ask the user what process they want to search for. 2) Have the script read the input as a variable and use it to search for the process. 3) Display the current time & date, the working directory of the process, and finally display the... (6 Replies)
Discussion started by: seekryts15
6 Replies
elf_version(3ELF)					       ELF Library Functions						 elf_version(3ELF)

NAME
elf_version - coordinate ELF library and application versions SYNOPSIS
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> unsigned elf_version(unsigned ver); DESCRIPTION
As elf(3ELF) explains, the program, the library, and an object file have independent notions of the latest ELF version. elf_version() lets a program query the ELF library's internal version. It further lets the program specify what memory types it uses by giving its own working version, ver, to the library. Every program that uses the ELF library must coordinate versions as described below. The header <libelf.h> supplies the version to the program with the macro EV_CURRENT. If the library's internal version (the highest version known to the library) is lower than that known by the program itself, the library may lack semantic knowledge assumed by the program. Accordingly, elf_version() will not accept a working version unknown to the library. Passing ver equal to EV_NONE causes elf_version() to return the library's internal version, without altering the working version. If ver is a version known to the library, elf_version() returns the previous (or initial) working version number. Otherwise, the working version remains unchanged and elf_version() returns EV_NONE. EXAMPLES
Example 1 A sample display of using the elf_version() function. The following excerpt from an application program protects itself from using an older library: if (elf_version(EV_CURRENT) == EV_NONE) { /* library out of date */ /* recover from error */ } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
elf(3ELF), elf32_xlatetof(3ELF), elf_begin(3ELF), libelf(3LIB), attributes(5) NOTES
The working version should be the same for all operations on a particular ELF descriptor. Changing the version between operations on a descriptor will probably not give the expected results. SunOS 5.11 11 Jul 2001 elf_version(3ELF)
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy