Re: t0005-signals.sh fails with ksh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



evgeny <illumsoft.org@xxxxxxxxx> 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....

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]