Sponsored Content
Top Forums Shell Programming and Scripting if ps -p 1234 reports nothing, echo something Post 302629429 by methyl on Tuesday 24th of April 2012 04:15:23 PM
Old 04-24-2012
There is a lot of variation in the ps command.
Please post a sample command and output for a process which does exist and a process which does not exist. If you can find one on your system, please also post a sample for a zombie process.
The usual problem with processing the output from ps is disposing of the column headings.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

telnet myhost 1234 cant work?

in myhost, i did a telnet myhost 1234, but got the below Trying... Connected to myhost. Escape character is '^]'. and just waits there... in /etc/services i had the following sftp 1234/tcp then in my /etc/inetd.conf i had sftpd stream tcp nowait meuser /usr/sftpd sftpd ... (13 Replies)
Discussion started by: yls177
13 Replies

2. HP-UX

Hp-ux 11.11 and Oracle reports

HI I am battling to find why oracle reports dont work from the Oracle applications and work from the Command line Finally, whern these reports error out in the Oracle apps, I see the error that the x server killed the process. Please let me know if any one has some chi-chi sheet on the os setup... (1 Reply)
Discussion started by: schilukuri
1 Replies

3. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

4. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

5. UNIX for Dummies Questions & Answers

How to find all files containing "1234" in their inode number?

Hi, if there are 3 files with the following inode numbers: 012345 012346 012347 is there a way to find all those files containing "1234" as inode? i found out that i cant use any wildcards. or i just didnt put them in the right way. find . -inum ... ? thanks 4 help. devil (2 Replies)
Discussion started by: daredevil82m
2 Replies

6. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

7. UNIX for Dummies Questions & Answers

sendmail[1234]: [ID 702911 mail.alert] dowork: sl_hrtob failed

When changing my server back as the mail server, I get the following error: sendmail12345]: dowork: sl_hrtob failed When looking at previous posts similar to my issue, none of them work. I do not have DNS and have ensured that the mail domain is correct. Can anyone else help out with... (2 Replies)
Discussion started by: PuterGirl5
2 Replies

8. Red Hat

intodns.com reports old IP

Hello, I have this problem: I have a domain which worked well until my ISP changed my ip. Since then my DNS is not working, and intodns.com reports still the old IP. The DNS remains the same. I made changes in named.conf, in ifcfg-Auto_eth0, I flushed the cache but it;s the same thing. What... (6 Replies)
Discussion started by: doe_ro
6 Replies

9. Shell Programming and Scripting

Add "1234" to specific field in second column

i have this file 073274753,0544901701,20101201,000316 038873722,69647455,20101130,235257 26213399,0545335767,20101201,000930 063330167,0566000101,20101201,000226 026773376,11966,20101130,234429,1194 075431120,0565900600,20101201,000428 75431120,0565900600,20101201,000538... (6 Replies)
Discussion started by: maxim42
6 Replies

10. Shell Programming and Scripting

RSYSLOG reports

I want to create reports using rsyslog in linux,Can someone help me out here ? Report Format must be "Hostname" "Username" "Hostname logged from" "Date" "Time" Regards, Ahmed. ---------- Post updated at 05:24 PM ---------- Previous update was at 05:24 PM ---------- Linux,Shell Script (10 Replies)
Discussion started by: ahmed.vaghar
10 Replies
sample(1)						    BSD General Commands Manual 						 sample(1)

NAME
sample -- Profile a process during a time interval SYNOPSIS
sample pid | partial-executable-name [duration [samplingInterval]] [-wait] [-mayDie] [-fullPaths] [-e] [-file filename] DESCRIPTION
sample is a command-line tool for gathering data about the running behavior of a process. It suspends the process at specified intervals (by default, every 1 millisecond), records the call stacks of all threads in the process at that time, then resumes the process. The analysis done by sample is called ``sampling'' because it only checks the state of the program at the sampling points. The analysis may miss execu- tion of some functions that are not executing during one of the samples, but sample still provides useful data about commonly executing func- tions. At the end of the sampling duration, sample produces a report showing which functions were executing during the sampling. The data is con- densed into a call tree, showing the functions seen on the stack and how they were called. (This tree is a subset of the actual call tree for the execution, since some functions may not have been executing during any of the sampling events.) The tree is displayed textually, with called functions indented one level to the right of the callee. In the call tree, if a function calls more than one function then a vertical line is printed to visually connect those separate children functions, making it easier to see which functions are at the same level. The characters used to draw those lines, such as + | : ! are arbi- trary and have no specific meaning. ARGUMENTS
The user of sample specifies a target process (either by process id, or by name), the duration of the sampling run (in seconds), and a sam- pling rate (in milliseconds). If the sampling duration is not specified, a default of 10 seconds is used. Longer sampling durations provide better data by collecting more samples, but could also be confusing if the target process performs many different types of operations during that period. The default sampling rate is 1 millisecond. Fast sampling rates provide more samples and a better chance to capture all the functions that are executing. -wait tells sample to wait for the process specified (usually as a partial name or hint) to exist, then start sampling that process. This option allows you to sample from an application's launch. -mayDie tells sample to immediately grab the location of symbols from the application, on the assumption that the application may exit or crash at any point during the sampling. This ensures that sample can give information about the call stacks even if the process no longer exists. -fullPaths tells sample to show the full path to the source code (rather than just the file name) for any symbol in a binary image for which debug information is available. The full path was the path to the source code when the binary image was built. -e tells sample to open the output in TextEdit automatically when sampling completes. -file filename tells sample the full path to where the output should be written. If this flag is not specified, results are written to a file in /tmp called <application name>_<date>_<time>.<XXXX>.sample.txt, where each 'X' is replaced by a random alphanumeric character. If neither the -e nor -file flags are given, the output gets written to stdout as well as saved to the file in /tmp. SEE ALSO
filtercalltree(1), spindump(8) The Xcode developer tools also include Instruments, a graphical application that can give information similar to that provided by sample. The Time Profiler instrument graphically displays dynamic, real-time CPU sampling information. BSD
Mar. 16, 2013 BSD
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy