From: Junio C Hamano <gitster@pobox.com>
To: evgeny <illumsoft.org@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: t0005-signals.sh fails with ksh
Date: Fri, 08 May 2015 13:34:49 -0700 [thread overview]
Message-ID: <xmqq1tiqkdue.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <31108626.20150508231514@gmail.com> (evgeny's message of "Fri, 8 May 2015 23:15:14 +0300")
evgeny <illumsoft.org@gmail.com> writes:
> expecting success:
> OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
> test "$OUT" -eq 141
>
> t0005-signals.sh[499]: eval: syntax error at line 4: `(' unmatched
> Memory fault
Does this work if you did
OUT=$( ( (large_git ; echo $? 1>&3) | : ) 3>&2 ) &&
instead?
> 'man ksh' reads:
> (list)
> Execute list in a separate environment.
> Note, that if two adjacent open parentheses are needed for nesting,
> a space must be inserted to avoid evaluation as an arithmetic command as
> described above.
Hmm, I cannot see "as described above" in your message, but isn't
that talking about a common mistake of turning cmd1 in this pipeline
x=$(cmd1 | cmd2)
into a series of two commands, e.g. (cmd1a && cmd1b) and saying
x=$((cmd1a && cmd1b) | cmd2)
which does make "$((" interpreted as the beginning of arithmetic
expansion?
And the "OUT=$( ((large..." construct seems to be written in order
to avoid that exact issue (notice the SP after "$(").
Puzzled....
next prev parent reply other threads:[~2015-05-08 20:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 20:15 t0005-signals.sh fails with ksh evgeny
2015-05-08 20:34 ` Junio C Hamano [this message]
2015-05-08 20:55 ` Jeff King
2015-05-08 21:14 ` Jeff King
2015-05-08 21:39 ` Junio C Hamano
2015-05-08 23:43 ` evgeny
2015-05-09 8:20 ` Andreas Schwab
2015-05-08 21:16 ` Junio C Hamano
2015-05-08 21:21 ` Jeff King
2015-05-09 20:01 ` brian m. carlson
2015-05-08 23:05 ` evgeny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1tiqkdue.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=illumsoft.org@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).