Sponsored Content
Full Discussion: Return vs. Echo
Top Forums Shell Programming and Scripting Return vs. Echo Post 302283648 by cfajohnson on Tuesday 3rd of February 2009 05:44:03 PM
Old 02-03-2009
There is no similarity between them: echo prints its arguments to stdout; return sets a return code which may be tested directly (by if or a control operator, && or ||) or indirectly in the contents of $?.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

2. UNIX for Advanced & Expert Users

Return the last echo in remsh !!!!

Hi, I have a question: the script A run in the HostA call the script B on the HostB: ex.. ksh:B ....... ........ ........ remsh HostB ec........ ...... ...... the prog.B on the host B make more function but the last command is echo of srting : ex ksk script B .... ...... (0 Replies)
Discussion started by: ZINGARO
0 Replies

3. Shell Programming and Scripting

echo 2 txt files to screen no carraige return

I have two text files, each of then only containing ONE line and NO carraige return or white space at the end...how do I echo both of these text files to the screen without putting an extra line? I want to do this from the command line. file1.txt: this is file1.txt 1 file2.txt: this is... (4 Replies)
Discussion started by: ajp7701
4 Replies

4. 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

5. 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

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. AIX

Return code 1 when echo to pipe

Hello, Our AIX box has recently been upgraded to TL12 (oslevel -s = 5300-12-04-1119). Now one of our ksh scripts is returning 1 when writing to a pipe, the command to write to the pipe is: echo "A" "B" "C" >> /usr/Pipe.Pipe Anyone have any ideas? Thanks (2 Replies)
Discussion started by: dendright
2 Replies

8. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

9. Shell Programming and Scripting

If echo statement return false

I have this code that sometimes return a false value and the code inside the if statement gets executed and error out. Any idea why? thanks. So I set a debug and see what the value for $ScriptElapsedTime Here is the value I got ScriptElapsedTime='03:20'. Base on this value the if... (10 Replies)
Discussion started by: nugent
10 Replies

10. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
cprof(3erl)						     Erlang Module Definition						       cprof(3erl)

NAME
cprof - A simple Call Count Profiling Tool using breakpoints for minimal runtime performance impact. DESCRIPTION
The cprof module is used to profile a program to find out how many times different functions are called. Breakpoints similar to local call trace, but containing a counter, are used to minimise runtime performance impact. Since breakpoints are used there is no need for special compilation of any module to be profiled. For now these breakpoints can only be set on BEAM code so s cannot be call count traced. The size of the call counters is the host machine word size. One bit is used when pausing the counter, so the maximum counter value for a 32-bit host is 2147483647. The profiling result is delivered as a term containing a sorted list of entries, one per module. Each module entry contains a sorted list of functions. The sorting order in both cases is of decreasing call count. Call count tracing is very lightweight compared to other forms of tracing since no trace message has to be generated. Some measurements indicates performance degradation in the vicinity of 10 percent. EXPORTS
analyse() -> {AllCallCount, ModAnalysisList} analyse(Limit) -> {AllCallCount, ModAnalysisList} analyse(Mod) -> ModAnlysis analyse(Mod, Limit) -> ModAnalysis Types Limit = integer() Mod = atom() AllCallCount = integer() ModAnalysisList = [ModAnalysis] ModAnalysis = {Mod, ModCallCount, FuncAnalysisList} ModCallCount = integer() FuncAnalysisList = [{{Mod, Func, Arity}, FuncCallCount}] Func = atom() Arity = integer() FuncCallCount = integer() Collects and analyses the call counters presently in the node for either module Mod , or for all modules (except cprof itself), and returns: FuncAnalysisList : A list of tuples, one for each function in a module, in decreasing FuncCallCount order. ModCallCount : The sum of FuncCallCount values for all functions in module Mod . AllCallCount : The sum of ModCallCount values for all modules concerned in ModAnalysisList . ModAnalysisList : A list of tuples, one for each module except cprof , in decreasing ModCallCount order. If call counters are still running while analyse/0..2 is executing, you might get an inconsistent result. This happens if the process executing analyse/0..2 gets scheduled out so some other process can increment the counters that are being analysed, Calling pause() before analysing takes care of the problem. If the Mod argument is given, the result contains a ModAnalysis tuple for module Mod only, otherwise the result contains one Mod- Analysis tuple for all modules returned from code:all_loaded() except cprof itself. All functions with a FuncCallCount lower than Limit are excluded from FuncAnalysisList . They are still included in ModCallCount , though. The default value for Limit is 1 . pause() -> integer() Pause call count tracing for all functions in all modules and stop it for all functions in modules to be loaded. This is the same as (pause({'_','_','_'})+stop({on_load})) . See also pause/1..3 below. pause(FuncSpec) -> integer() pause(Mod, Func) -> integer() pause(Mod, Func, Arity) -> integer() Types FuncSpec = Mod | {Mod,Func,Arity}, {FS} Mod = atom() Func = atom() Arity = integer() FS = term() Pause call counters for matching functions in matching modules. The FS argument can be used to specify the first argument to erlang:trace_pattern/3 . See erlang(3erl). The call counters for all matching functions that has got call count breakpoints are paused at their current count. Return the number of matching functions that can have call count breakpoints, the same as start/0..3 with the same arguments would have returned. restart() -> integer() restart(FuncSpec) -> integer() restart(Mod, Func) -> integer() restart(Mod, Func, Arity) -> integer() Types FuncSpec = Mod | {Mod,Func,Arity}, {FS} Mod = atom() Func = atom() Arity = integer() FS = term() Restart call counters for the matching functions in matching modules that are call count traced. The FS argument can be used to specify the first argument to erlang:trace_pattern/3 . See erlang(3erl). The call counters for all matching functions that has got call count breakpoints are set to zero and running. Return the number of matching functions that can have call count breakpoints, the same as start/0..3 with the same arguments would have returned. start() -> integer() Start call count tracing for all functions in all modules, and also for all functions in modules to be loaded. This is the same as (start({'_','_','_'})+start({on_load})) . See also start/1..3 below. start(FuncSpec) -> integer() start(Mod, Func) -> integer() start(Mod, Func, Arity) -> integer() Types FuncSpec = Mod | {Mod,Func,Arity}, {FS} Mod = atom() Func = atom() Arity = integer() FS = term() Start call count tracing for matching functions in matching modules. The FS argument can be used to specify the first argument to erlang:trace_pattern/3 , for example on_load . See erlang(3erl). Set call count breakpoints on the matching functions that has no call count breakpoints. Call counters are set to zero and running for all matching functions. Return the number of matching functions that has got call count breakpoints. stop() -> integer() Stop call count tracing for all functions in all modules, and also for all functions in modules to be loaded. This is the same as (stop({'_','_','_'})+stop({on_load})) . See also stop/1..3 below. stop(FuncSpec) -> integer() stop(Mod, Func) -> integer() stop(Mod, Func, Arity) -> integer() Types FuncSpec = Mod | {Mod,Func,Arity}, {FS} Mod = atom() Func = atom() Arity = integer() FS = term() Stop call count tracing for matching functions in matching modules. The FS argument can be used to specify the first argument to erlang:trace_pattern/3 , for example on_load . See erlang(3erl). Remove call count breakpoints from the matching functions that has call count breakpoints. Return the number of matching functions that can have call count breakpoints, the same as start/0..3 with the same arguments would have returned. SEE ALSO
eprof(3erl), fprof(3erl), erlang(3erl), User's Guide Ericsson AB tools 2.6.6.3 cprof(3erl)
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy