On Thu, 2003-08-14 at 23:00, Jan Trippler wrote:
On Don, 14 Aug 2003 at 16:01 (+0200), Ralf Corsepius wrote: [`` vs. $()]
=> Ich sehe keinen grundsätzlichen Vorteil. Beide werden von POSIX unterstützt.
(Der eigentliche Vorteil von $() gegenüber `` ist die Schachtelbarkeit von $()).
Auch `` kann man schachteln: deepest_dir=`basename \`dirname $pfad\``
Theoretisch ja, doch beachte \` vs. ` SUSV3 sagt dazu: ... Command substitution can be nested. To specify nesting within the backquoted version, the application shall precede the inner backquotes with backslashes, for example: \`command\` If the command substitution consists of a single subshell, such as: $( (command) ) a conforming application shall separate the "$(" and '(' into two tokens (that is, separate them with white space). ... In der Praxis jedoch gibt es auch hier wieder Fälle in denen es nicht geht. info autoconf deutet dies in einer Randbemerkung zu $() an: ... `$(COMMANDS)' This construct is meant to replace ``COMMANDS`'; they can be nested while this is impossible to do portably with back quotes. ... Mir sind Fälle in denen es nicht geht allerdings auch noch nicht persönlich untergekommen - Ich vermeide sie in der Regel allerdings auch ;) Ralf