Quote:
Originally Posted by
Peasant
If i'm not mistaken backquotes are still the lowest common denominator for command substitution if you wish your scripts to work anywhere without touching
This is an interesting argument.
IMHO the "gold standard" of portability is POSIX: if something is POSIX, then it can (and should) be used, if it not, it should be handled with extreme care (and eventually not be used in absence of compelling reasons why it should).
The construct
$(..) now
is in fact the POSIX-standard for doing this (subshells) and backticks
`...` are deprecated. This is why i use the former rather than the latter and recommend this practice to others.
For the same reason i write i.e.
tail -n 5 instead of
tail -5. The former is POSIX, the latter deprecated. It may be that there is some (really old) system out there which would not recognise the new syntax but only the old one. This risk i am willing to take because, on the the other hand, there might be a really new system which has cut off old behaviorisms and only understands the current syntax.
I hope this helps.
bakunin
Moderator's Comments:
|
|
PS: this discussion is very interesting but we are getting off topic in relation the threads original theme. If anyone wants to continue this i suggest to split this thread and carry on in a new one. Just post here if you want to contribute and i will take care of the splitting if there are any takers.
|
|