Re: Patch to fix a memory leak in pat_subst

2016-08-24 Thread Chet Ramey
On 8/23/16 8:34 PM, Dmitry Goncharov wrote: > Good morning. > > This patch fixes a leak in pat_subst. Thanks for the report and fix. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@cas

Re: Patch to fix a leak in split_at_delims.

2016-08-24 Thread Chet Ramey
On 8/23/16 8:39 PM, Dmitry Goncharov wrote: > regards, Dmitry Thanks for the report and fix. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet

Re: a patch to fix sh_stat on SunOS

2016-08-24 Thread Chet Ramey
On 8/23/16 8:28 PM, Dmitry Goncharov wrote: > On Mon, Aug 22, 2016 at 11:04:24AM -0400, Chet Ramey wrote: >> I'd rather it were done via an explicit switch to configure. I'd look at >> a patch to do that. >> > The patch in the attachment is against the top of master of > git://git.savannah.gnu.org

[PATCH] tests/getopts5.sub: Update interpreter

2016-08-24 Thread kai . 7 . kang
From: Kai Kang The interpreter of tests/getopts5.sub is /local/bin/bash which is obsolete, replace with /bin/bash. Signed-off-by: Kai Kang --- tests/getopts5.sub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/getopts5.sub b/tests/getopts5.sub index c6e3888..0616b6d 1

Re: Intriguing error with arithmetic evaluation

2016-08-24 Thread Stephane Chazelas
2016-08-23 12:26:37 -0400, Greg Wooledge: [...] > > ksh -c '((0)); echo X' > > > > outputs X > > You forgot the -e. Here's ksh88: > > $ ksh -e -c '((0)); echo X' > $ uname -a > HP-UX imadev B.10.20 A 9000/785 2008897791 two-user license [...] Oops. I did test with -e on Solaris though $ Vers

Re: redirection inside a process-substitution

2016-08-24 Thread Chet Ramey
On 8/23/16 5:00 PM, Helmut Karlowski wrote: > Now extending Pierre's example: > > exec 3>tb.err > echo 3>&1 > >(echo 1 1>&3) > echo + > cat tb.err > echo - > echo 3>&1 > >(echo 11 1>&3) > echo + > cat tb.err > echo - > echo > >(echo 2 1>&3) 3>&1 > echo + > echo - > cat tb.

Re: [PATCH] tests/getopts5.sub: Update interpreter

2016-08-24 Thread Chet Ramey
On 8/24/16 5:51 AM, kai.7.k...@gmail.com wrote: > From: Kai Kang > > The interpreter of tests/getopts5.sub is /local/bin/bash which is > obsolete, replace with /bin/bash. Thanks. This doesn't matter, since the file is run as an argument to the just-built version of bash that's being tested. Ch

Re: Open pipe passed to child process

2016-08-24 Thread Adam Danischewski
I was expecting it to be the pts. On Tue, Aug 23, 2016 at 4:58 PM, Chet Ramey wrote: > On 8/23/16 2:28 PM, Adam Danischewski wrote: > > I'm not sure if this is a bug, or a feature but I had to debug some code > as > > a result so I'd like to bring it to your attention, and if you know of a > > b

Re: Intriguing error with arithmetic evaluation

2016-08-24 Thread Greg Wooledge
On Wed, Aug 24, 2016 at 03:01:09PM +0100, Stephane Chazelas wrote: > Possibly HP-UX changed it? Sounds more likely than > Solaris changing it the other way round. > > What version of ksh is it based on? $ strings /bin/ksh | grep Version | tail -2 @(#)Version 11/16/88 (That command came from htt

Re: Open pipe passed to child process

2016-08-24 Thread Chet Ramey
On 8/24/16 12:09 PM, Adam Danischewski wrote: > I was expecting it to be the pts. OK. That's just not how it works. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww

Re: Open pipe passed to child process

2016-08-24 Thread Adam Danischewski
Let's put aside the fs type for second and talk about what data should be there and what should and shouldn't happen. When a parent script kicks off a child process, and the child process reads from fd0 I don't expect the child to be capable of manipulating the parents pipe data on fd0. An error p

Re: Open pipe passed to child process

2016-08-24 Thread Greg Wooledge
On Wed, Aug 24, 2016 at 02:52:01PM -0400, Adam Danischewski wrote: > When a parent script kicks off a child process, and the child process reads > from fd0 I don't expect the child to be capable of manipulating the parents > pipe data on fd0. An error potentially but not quietly eating up the > par

Re: Open pipe passed to child process

2016-08-24 Thread Adam Danischewski
Actually I misspoke before, there *is *this issue on Solaris 10. I didn't update the logic sufficiently to detect it at first. So it looks like this is could be a potentially more significant issue -- affecting enterprise user markets. I think the bottom line question is, should a child process be

Re: Open pipe passed to child process

2016-08-24 Thread Greg Wooledge
On Wed, Aug 24, 2016 at 05:04:17PM -0400, Adam Danischewski wrote: > be allowed, since I do not want things like a squirrely child process > eating up parent pipe data in my while/read loops. http://mywiki.wooledge.org/BashFAQ/089

Re: Open pipe passed to child process

2016-08-24 Thread Chet Ramey
On 8/24/16 5:04 PM, Adam Danischewski wrote: > Actually I misspoke before, there /is /this issue on Solaris 10. I didn't > update the logic sufficiently to detect it at first. So it looks like this > is could be a potentially more significant issue -- affecting enterprise > user markets. I sugges