what r the drawbacks of echo command? can u plz suggest some enhancements in echo command.
what r the drawbacks of echo command? can u plz suggest some enhancements in echo command.
Hum... interesting question. Echo is a simple program, with plenty of options already (man echo for details ^_^).
So I guess it is quite complete already. I never encountered snaggs with echo.
gr8linux wrote:
what r the drawbacks of echo command? can u plz suggest some enhancements in echo command.
I personally prefer to use printf, b/c I like the greater flexibility it has in string formatting, etc.
[b]
I personally prefer to use printf, b/c I like the greater flexibility it has in string formatting, etc.
can u plz gv me some examples of why u prefer printf and how it is more flexible than echo.......i m looking for that. i wanna know what uses r missing in echo.
gr8linux wrote:
[quote][b]
I personally prefer to use printf, b/c I like the greater flexibility it has in string formatting, etc.
can u plz gv me some examples of why u prefer printf and how it is more flexible than echo.......i m looking for that. i wanna know what uses r missing in echo.[/quote]
make some nice columns in output:
printf "%-20s%s\\n" meh blah
printf "%-20s%s\\n" foo bar
round up to a whole number:
printf '%0.f\\n' 1.5
convert hex to decimal:
printf '%d\\n' 0x100000000
The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.
Join / Linux Training / Board