4 ms·
$( allows any syntax until a non-escaped ). It's Command Substitution[1], and they run in "subshells". echo hello "$( echo hello \ | sed 's
by thisacctforreal 8y ago
$( allows any syntax until a non-escaped ). It's Command Substitution[1], and they run in "subshells".
echo hello "$(
echo hello \
| sed 's,hello,world,g'
)"
[ is an actual binary file that gets invoked, called test. You can "man [" or "man test" to learn about all of its uses.
I use [ exclusively, but with && and ||, instead of -a and -o respectfully.
e.g. [ -e "$file" ] && [ -w "$file" ] instead of [ -e "$file" -a -w "$file" ].
[1] http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03 http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu...