From owner-freebsd-questions@FreeBSD.ORG Mon Feb 21 02:49:50 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68C8106564A for ; Mon, 21 Feb 2011 02:49:50 +0000 (UTC) (envelope-from 839273@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 583B98FC0A for ; Mon, 21 Feb 2011 02:49:50 +0000 (UTC) Received: by yie19 with SMTP id 19so2403337yie.13 for ; Sun, 20 Feb 2011 18:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=IyxopzHu7Ui/DHF6VZS79ZDTdd+29OHtrZfg0S+e1xg=; b=N4NoV4MzdhVrsaVPD6HgpPk+I72Yy43hinJUSNuZRvTs+Glldc+aAed2cAFfMcBxnk 5y1uDP7yLCLN+bi4HK/sk5N5uTCshKQoBGVD/sg3t0evtpgsbJOcQ6XjlB10K8+V2umT p9lCVLMCbc4KBwsyUgTCNLPO7Ui3Zq/LZD7D8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ipuc0DD5IJFGXqda3rMumo03vm9E9j/2E5mbPK31J34LVv7TWM68HdJsU1mVzwF39c KiHOaz8YhwHJPWBHvw54VcsosOC+Cj4sp4YMXRHhFv46Jjb85c7mGBnx9zEqyrzUWKK6 i6uRTCibW47bylHRUfgbzsWCxCiMCC9oWsAH0= MIME-Version: 1.0 Received: by 10.151.95.4 with SMTP id x4mr1054766ybl.230.1298256589359; Sun, 20 Feb 2011 18:49:49 -0800 (PST) Sender: 839273@gmail.com Received: by 10.151.110.10 with HTTP; Sun, 20 Feb 2011 18:49:49 -0800 (PST) In-Reply-To: <4D61599E.4040008@gmail.com> References: <4D61599E.4040008@gmail.com> Date: Sun, 20 Feb 2011 22:19:49 -0430 X-Google-Sender-Auth: bGqNeU0DDD_3yokNinfErmNr7TM Message-ID: From: Andres Perera To: David Demelier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: Backtick versus $() X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: 839273@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2011 02:49:50 -0000 On Sun, Feb 20, 2011 at 1:42 PM, David Demelier 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" >