-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Bothwick wrote:
> Note you can also nest commands when using $(), which you can't do with
> backticks.

You can nest commands with ``, it's just less intuitive; each of the
following are equivalent:

  echo $(echo $(echo $(echo $(echo foo))))
  echo $(echo $(echo $(echo `echo foo`)))
  echo $(echo $(echo `echo \`echo foo\``))
  echo $(echo `echo \`echo \\\`echo foo\\\`\``)
  echo `echo \`echo \\\`echo \\\\\\\`echo foo\\\\\\\`\\\`\``

Yes, that is a *lot* of backslashes in the last one, which is why no one
nests that far with `` (personally, I always use $() instead of ``, but
that's mainly because I switched my escape for GNU screen from ^A to `).

- --
Jonathan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrOnkwACgkQOypDUo0oQOqo4QCaA5iPSgyefVeK/clv3Tmb4bZh
QHcAnRbc/wufJ7NZlVfy7f3sACQm1ZoY
=ewZb
-----END PGP SIGNATURE-----

Reply via email to