Writes to screen or redirected output or error stream.
echo [ <options> ] [ <argument> [ <argument> ... ] ]
-e Write to error stream. With this option, the output of echo command
is written to the error stream. Without this option, the output is
written to output stream.
This option is very useful for inserting debugging messages in scripts.
The following is an example.
echo -e "DEBUG: Processing file " $fileName
-h Writes output in hexadecimal format. With this option, each byte in the output
is converted to two hexadecimal digits. All control characters, such as
newline, tab, are converted also.
A constant, a variable, an expression, a function call, an inline function,
or any combination of these using operators.
Contents of all arguments are produced, if -e option is NOT present.
Any errors are listed here. Also, contents of all arguments are produced here,
if -e option IS present.
This command lists the contents of various types of arguments.
If multiple arguments are specified, contents of each argument is
No formatting is used when listing output. This allows you to formt the output
to the way you desire. Use formatting characters such as "\t" (tab), "\n" (newline),
" " (space), etc. Use double quotes when using formatting characters.
If -h (hex) option is used, the output is written in hex format (using hexadecimal
Use of parentheses and double quotes is highly recommended. Parentheses specify
to the command TO EVALUATE the expression within the parentheses. Double quotes
specify to the command NOT TO EVALUATE the text within double quotes.
There is NO LIMIT on how many parentheses you can use.
Further, there is NO LIMIT on how many levels of parentheses
you can use.
Expressions must be enclosed in parentheses.
Will display the value of variable x.
echo "The value of variable x is\n" $x
Will write the words "The value of variable x is", then a newline, the the value of $x.
var int i
Will display the value of $i plus 5. The value of variable i itself, will remain unaffected.
echo -h "Hello, world"
Will display the string "Hello, world" in its hexadecimal representation.
echo -h $x > "/temp/x.txt"
Will write the value of variable x, in its hexadecimal representation, to file
var int i
Will produce error. Parentheses must be used around expressions.
The following will work.
© 2008-2013, biterScripting.com. All rights reserved.
biterScripting, biterScript, biterBrowser, biterMobile, biterScripting.com, FVA (Forward Variable Assignment) are trademarks of biterScripting.com. Is it biterScripting-compatible ? is a service mark of biterScripting.com.
Explorer, Unix, Windows are trademarks, service marks or other forms of intellectual property of their respective owners.