prevent ignore SIGINT for asynchronous commands without enabling job control

2013-04-10 Thread Ilya Basin
Hi. I have a script that creates some background tasks. I want the whole tree to be killed by Ctrl-C. There's a requirement that the script process and its children must belong to the same process group. This is why I can't enable job control. I don't want to use 'trap', because it adds complexit

Re: prevent ignore SIGINT for asynchronous commands without enabling job control

2013-04-10 Thread Dan Douglas
On Wednesday, April 10, 2013 02:43:12 PM Ilya Basin wrote: > Hi. > I have a script that creates some background tasks. > I want the whole tree to be killed by Ctrl-C. "tree"? If a script isn't coordinating with its subprocesses manually, then the only real guaranteed way to kill a process and all

Re: prevent ignore SIGINT for asynchronous commands without enabling job control

2013-04-10 Thread konsolebox
It's actually simple with trap. Just catch SIGINT with a function and call a function to kill the tree: https://www.linuxquestions.org/questions/blog/konsolebox-210384/bash-functions-to-list-and-kill-or-send-signals-to-process-trees-34624/ Note killtree3. And that could be merged as one single fu

Re: Very slow pattern substitution in parameter expansion

2013-04-10 Thread Chet Ramey
On 4/10/13 12:15 AM, Dan Douglas wrote: > On Tuesday, April 09, 2013 10:23:34 PM Chet Ramey wrote: >> On 4/9/13 9:56 PM, Dan Douglas wrote: >>> Erm, here it is in a less unreadable format: >> >> It is pretty slow. You forgot to enable `extglob'. > > D'oh! > > Bad algorithm? I suppose it's lots

RE: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-10 Thread dnade.ext
Sorry to hack the thread, but I was wondering too if there was actually a place/list to announce such contributions. I've recently developped https://github.com/Anvil/bash-argsparse (high level argument parsing library for bash) and wanted to submit it to the "bash community" for review, commen

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-10 Thread Roman Rakus
I think the much better would be to improve getopt command or getopts builtin. RR On 04/10/2013 03:35 PM, dnade@orange.com wrote: Sorry to hack the thread, but I was wondering too if there was actually a place/list to announce such contributions. I've recently developpedhttps://github.co

RE: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-10 Thread dnade.ext
I Agree. And IMHO, it should be more getopts than getopt, since I don't see how you could hook callbacks to getopt. Though, in the meantime, my work is here and according to the people in my work entity using it, it makes their shell-scripting tasks quite easier. WRT getopts, what improvements

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-10 Thread Chet Ramey
On 4/10/13 9:56 AM, dnade@orange.com wrote: > WRT getopts, what improvements can we expect for bash 4.3 (or later) ? There are no changes in getopts between bash-4.2 and bash-4.3. It behaves as Posix specifies. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer