Re: redirection inside a process-substitution

2016-08-23 Thread Pierre Gaston
On Mon, Aug 22, 2016 at 10:38 PM, wrote: > When doing redirection inside a sub-process to a descriptor that is > redirected to a file the output of the subshell goes into the file. > > Now when the same descriptor is again redirected to another descriptor for > this whole > command-list, the outp

Re: Syslog output from bash

2016-08-23 Thread Piotr Grzybowski
On 23 Aug 2016, at 08:08, Bob Proulx wrote: > Richard Lohman wrote: >> Problem is, I'd like the output to resemble other syslog messages: >> Mmm dd HH:MM:SS hostname bash[pid]: command >> And ultimately drop the username in as well. Since only bash is logging in > > I suggest using the 'logger'

Re: Syslog output from bash

2016-08-23 Thread Chet Ramey
On 8/22/16 4:10 PM, Richard Lohman wrote: > Hey all: > > In my attempts to log commands from bash via syslog, I've come upon a snag. > The output is of the form: > Mmm dd HH:MM:SS hostname -bash: command > This was obtained by uncommenting the define in config-top.h and changing > the call to

Re: redirection inside a process-substitution

2016-08-23 Thread Chet Ramey
On 8/22/16 3:38 PM, helmut.karlow...@ish.de wrote: > When doing redirection inside a sub-process to a descriptor that is > redirected to a file the output of the subshell goes into the file. Child processes created to run subshells inherit open file descriptors from their parent. > Now when the s

Re: Intriguing error with arithmetic evaluation

2016-08-23 Thread Stephane Chazelas
2016-08-12 14:22:32 -0400, Chet Ramey: [...] > The relevant change was probably the change in the set of commands to which > `set -e' applies. The (( command (among others) was added to that list > in bash-4.1. The change was the result of Posix changing the semantics > of the errexit option and

Re: Syslog output from bash

2016-08-23 Thread Richard Lohman
That was exactly it. I kept thinking of openlog as opening a pointer to a file. Thanks, all for you insights. On Aug 23, 2016 9:44 AM, "Chet Ramey" wrote: > On 8/22/16 4:10 PM, Richard Lohman wrote: > > Hey all: > > > > In my attempts to log commands from bash via syslog, I've come upon a > sna

Re: Intriguing error with arithmetic evaluation

2016-08-23 Thread Greg Wooledge
On Tue, Aug 23, 2016 at 05:15:25PM +0100, Stephane Chazelas wrote: > POSIX doesn't specify ((...)) (explicitely leaves it > unspecified), so is out of POSIX scope anyway. > > It was introduced by ksh88. > > There and in ksh93 (but not pdksh nor zsh) > > ksh -c '((0)); echo X' > > outputs X You

Open pipe passed to child process

2016-08-23 Thread Adam Danischewski
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 better way to read from pipes please let me know. #!/bin/bash numstr=${1} rdlnk=$(readlink /proc/$$/fd/0) function get_input() { ## echo "PID: $$, P

Bash-4.4-rc2 available

2016-08-23 Thread Chet Ramey
The second release candidate of bash-4.4 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-4.4-rc2.tar.gz and via git from http://git.savannah.gnu.org/cgit/bash.git/?h=bash-4.4-testing This tar file includes the formatted documentation (you should be able to generate updated versio

Re: Bash completion sometimes meshes up my terminal

2016-08-23 Thread Chet Ramey
On 8/22/16 9:43 AM, Jaro Punta wrote: > I am not sure this is a bug but I cannot find an explanation why this > happens. Sometimes when I execute certain commands, and I press the > Tab key while I am typing the command, then after the commands > finishes, the terminal is left in a abnormal state (

Re: Open pipe passed to child process

2016-08-23 Thread Chet Ramey
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 > better way to read from pipes please let me know. Just so I'm not confused: you mean that you don

Re: redirection inside a process-substitution

2016-08-23 Thread Helmut Karlowski
Am 23.08.2016, 17:00 Uhr, schrieb Chet Ramey: It has to do when things are processed. Process substitution is not a command or a redirection: it is a word expansion that expands to a file name. Word expansions are performed before redirections. Sure: similar to command-substitution as mentio

Patch to fix a memory leak in pat_subst

2016-08-23 Thread Dmitry Goncharov
Good morning. This patch fixes a leak in pat_subst. regards, Dmitry diff --git a/subst.c b/subst.c index 3958237..673376b 100644 --- a/subst.c +++ b/subst.c @@ -6682,6 +6682,7 @@ pat_subst (string, pat, rep, mflags) mstr[x] = s[x]; mstr[mlen] = '\0'; rstr = strcr

Patch to fix a leak in split_at_delims.

2016-08-23 Thread Dmitry Goncharov
regards, Dmitry diff --git a/subst.c b/subst.c index 673376b..09fc915 100644 --- a/subst.c +++ b/subst.c @@ -2019,8 +2019,10 @@ split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) long as those characters are delimiters. */ for (i = 0; member (string[i], d) && spctabnl (stri