3 ms·
Off Topic — Which one is better? $ stat `which stat` $ stat $(which stat)
by guessmyname 10y ago
Off Topic — Which one is better?
$ stat `which stat`
$ stat $(which stat)
- striking 10y agoBackticks if lazy, parenthetical for complicated command lines.
- hmpc 10y agoBackticks are discouraged for any new scripts, since they complicate nesting, quoting, and escaping, besides being graphically less explicit. See also http://mywiki.wooledge.org/BashFAQ/082 http://mywiki.wooledge.org/BashFAQ/082. The Open Group also discourages backticks: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_....
- __michaelg 10y ago$ stat "$(which stat)" shellcheck or its online version http://www.shellcheck.net/ http://www.shellcheck.net/ help a lot
- aelleth 10y ago$(...) doesn't trip Shellcheck and is slightly more readable and less error-prone in complex statements, e.g. if you have to nest commands.
- rascul 10y agowhich probably isn't the best tool to use here. http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then http://unix.stackexchange.com/questions/85249/why-not-use-wh...