- Update the function example in option -j to use POSIX command substitution $()
The backquotes are still used by many many people. Many people don't even know that you can also use $().
The wcd function is very simple, no nesting of commands or so.
Old shells don't support $()
Backquotes will stay supported by all shells.
> Don't even know that you can also use $(). The wcd function is very
> simple, no nesting of commands or so. Old shells don't support $()
> Backquotes will stay supported by all shells.
It is good for documentation to use the recommended ways, especially
in the year od 2010. There are several other benefits besides
nesting,; e.g. improved legibilit (Case: read manual pages with
variety of fonts, resolutions, small Netbooks etc). The likelyhood to
for users not to have a POSIX shell for interactive shell is minimal.
No-one is likely to run non-POSIX /bin/sh as their interactive command
shell where they use wcd.
POSIX standard IEEE Std 1003.1: 2.6.3 Command Substitution
Bash manual: "...old-style backquote" in section "3.5.4 Command Substitution"
BashFAQ: Why is $(...) preferred over `...` (backticks)?
Advanced Bash-Scripting Guide: "...The $(...) form has
superseded backticks for command substitution."
I think I will first recommend the POSIX version for POSIX compliant shells, and the existing one for older or non POSIX compliant shells.
It's only a manual. The user himself (or the package maintainer) installs the function. People who have sleepless nights because their shell resource file is not POSIX compliant will change the function anyway.
Also remember that the world is very big and old stuff doesn't go away that easy. See also
The use of backquotes is so wide spread that if they would remove it from bash, hell would break loose.
Use of $() is advised first.
backquotes version is also listed.