02-24-2011
Help us to help you : please give more clue and give a representative sample of
input and expected output
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My supervisor keep getting "stdin not tty" or something like that when he pipe or redirect input into a program. Others
don't seem to get this message. Is there some way I can help him to fix or turn this off?
Thx in advance (1 Reply)
Discussion started by: Micz
1 Replies
2. Shell Programming and Scripting
can you redirect STDIN with command arguments?
I have tried this approach:
# ./script -option <argument1> <argument2> 0<$2
# $2: ambiguous redirect
Is this possible? (4 Replies)
Discussion started by: prkfriryce
4 Replies
3. Programming
For windows was pretty simple to redirect the std in a and out of a
child process for "cmd.exe " command prompt terminal to a socket using connected pipes passed to a new process in the STARTUPINFO structure.
BOOL b = ::CreatePipe((LPHANDLE)h_stdInRead,(LPHANDLE)hsdtInWriteTmp, &SecAttrib,... (1 Reply)
Discussion started by: gyula
1 Replies
4. Shell Programming and Scripting
Hi:
I have the next script on ksh
#!/usr/bin/ksh
cd $FUENTES
qdesign <<-!
\$/opt/cognos/ph843e/bin/qtp <<-!
\$/opt/cognos/ph843e/bin/quiz <<-!
!
!
!
This script is very simple, i want to nest three process quiz into qtp, and this into qdesign.
When I run it , i receive the... (5 Replies)
Discussion started by: ct2marer
5 Replies
5. UNIX for Advanced & Expert Users
Hi:
I have the next script on ksh
#!/usr/bin/ksh
cd $FUENTES
qdesign <<-!
\$/opt/cognos/ph843e/bin/qtp <<-!
\$/opt/cognos/ph843e/bin/quiz <<-!
!
!
!
This script is very simple, i want to nest three process quiz into qtp, and this into qdesign.
When I run it , i receive the next... (2 Replies)
Discussion started by: ct2marer
2 Replies
6. Shell Programming and Scripting
I am unable to use STDIn redirection with < (commands)
When I do the following, both approaches work and give the same results:
1.
$ printf "aaa\nbbb\n" > file1
$ printf "111\n222\n" > file2
$ cat file1 file2
aaa
bbb
111
2222.
$ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n")
aaa... (8 Replies)
Discussion started by: metaltree
8 Replies
7. UNIX for Dummies Questions & Answers
Hi,
i know how to
a) redirect stdout and stderr to one file,
b) and write to two files concurrently with same output using tee command
Now, i want to do both the above together.
I have a script and it should write both stdout and stderr in one file and also write the same content to... (8 Replies)
Discussion started by: ysrini
8 Replies
8. Shell Programming and Scripting
Hi,
I am working on a project where I have to generate and execute nasm code on-the-fly. I generate the code in a file program.asm and then execute it.This output is to stdout which i redirect to an output file which i read back to compare results:
system("nasm -f elf program.asm >... (5 Replies)
Discussion started by: doc_cypher
5 Replies
9. Shell Programming and Scripting
Hi
Im trying to do the following:
grep -H Date: out/* | sed 's/':'/ /' | awk '$4 ~ /^/ {print $1}' | while read VARIABLE; do
awk '{print $1,$3,$2}' $VARIABLE | sed (take stdin and replace a string in $VARIABLE)
done
What this is basically doing is finding all files with Date: in... (11 Replies)
Discussion started by: duonut
11 Replies
10. Shell Programming and Scripting
Hi there,
I need to execute a command in the bash. The program prints some standard (output and) error and then wants the user to choose one of several options and type the according input. I am trying to solve this issue in a bash script but also running into some circular dependency. How can I... (7 Replies)
Discussion started by: fredestet
7 Replies
LEARN ABOUT MOJAVE
sample
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