Date: Sun, 20 Feb 2011 22:19:49 -0430 From: Andres Perera <andres.p@zoho.com> To: David Demelier <demelier.david@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Backtick versus $() Message-ID: <AANLkTinJKcy8NyFzW9=6yKEY%2BF_payQVM108_=B7Gyjr@mail.gmail.com> In-Reply-To: <4D61599E.4040008@gmail.com> References: <alpine.BSF.2.00.1102201027170.56885@wonkity.com> <4D61599E.4040008@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 20, 2011 at 1:42 PM, David Demelier <demelier.david@gmail.com> wrote: > > I'd prefere $() rather than ``. It's more powerful, for example you can > write a multiple $() but not `` see : that's not true for i in bash dash mksh; do echo $i: $i <<'!' echo `echo 1\`echo 2\\\`echo 3\\\\\\\`echo 4\\\\\\\`\\\`\`` ! done bash: 1234 dash: 1234 mksh: 1234 > > markand@Abricot ~ $ echo $(basename $(which dmesg)) > dmesg > > markand@Abricot ~ $ echo `basename `which dmesg`` > usage: basename string [suffix] > =C2=A0 =C2=A0 =C2=A0 basename [-a] [-s suffix] string [...] > which dmesg > > Of course the example code is useless but shows the limitations of ``. > Nowadays all shells supports $() so I advise you to use it :). no, not all shells support $() > > Cheers, > > -- > David Demelier > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinJKcy8NyFzW9=6yKEY%2BF_payQVM108_=B7Gyjr>