From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id DAA07990 for ; Tue, 7 Nov 1995 03:22:47 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA05466; Mon, 6 Nov 1995 11:08:02 -0500 Resent-Date: Mon, 6 Nov 1995 16:39:06 +0100 (MET) Old-Return-Path: From: Zoltan Hidvegi Message-Id: <199511061539.QAA07497@bolyai.cs.elte.hu> Subject: Re: Expansion/quoting quirks To: zsh-workers@math.gatech.edu (zsh-workers) Date: Mon, 6 Nov 1995 16:39:06 +0100 (MET) In-Reply-To: <951105102637.ZM28524@zyrcon.z-code.com> from "Barton E. Schaefer" at Nov 5, 95 10:26:37 am X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"HODAg2.0.KL1.XBZdm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/536 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > This one seems really strange to me. Why is $(foo) different from `foo` > in ksh? I think I prefer zsh's behavior, even if it isn't compatible. > > $ echo $(echo '\$x') > \$x > $ echo `echo '\$x'` > $x > $ > > Look, ksh isn't even consistent about it! Why should that $ cause a > magically different behavior? > > $ echo $(echo '\x') > \x > $ echo `echo '\x'` > \x > $ Here is the relevant part from the ksh93 manual: Command Substitution. The standard output from a command enclosed in parentheses preceded by a dollar sign ( $() ) or a pair of grave accents (``) may be used as part or all of a word; trail- ing new-lines are removed. In the second (obsolete) form, the string between the quotes is processed for special quoting characters before the command is executed (see Quoting below). The command substitution $(cat file) can be replaced by the equivalent but faster $(