09-23-04 02:13 PM
2004-09-23, 11:33(-00), SM Ryan:
[...]
> #!/bin/sh
> root=`ls -ld /`
> echo ---------------------------
> st=$?
You get echo status there.
[...]
> For ksh and derivatives, you can use nestable $(...) as well as `...`.
[...]
`...` are nestable too, but in a less convenient way:
echo `echo \`echo \\\`echo foo\\\`\``
$(...) is better that `...` not that much because they are
nestable but because they don't interfer with backslash
processing.
ls '\'
for instance, lists the '\' file when outside backticks, but
lists the '' file when inside:
$ ls '\'
\\: No such file or directory
$ : `ls '\'`
\: No such file or directory
$ : $(ls '\')
\\: No such file or directory
--
Stephane
[ Post a follow-up to this message ]
|