Re: exec/read -s bug?

2018-08-19 Thread Lars Schneider
> On Aug 19, 2018, at 8:45 PM, Lars Schneider wrote: > > >> On Aug 19, 2018, at 6:33 PM, Lars Schneider wrote: >> >> Hi, >> >> consider this script: >> >> #!/bin/bash >> [ "`whoami`" = "root" ] || { >>exec sudo -u root "$0" "$@" >> } >> read -s -p "enter stuff:

Re: Add sleep builtin

2018-08-19 Thread Jaren Stangret
Additionally, for simple uses, using: read -t Works for pseudo built-in sleep. Not easy to use in subshells, or with any forks. On Sun, Aug 19, 2018, 12:12 PM konsolebox wrote: > On Mon, Aug 20, 2018 at 12:26 AM, Clint Hepner > wrote: > > > >> On Aug 19, 2018, at 10:25 AM, konsolebox wrote: >

Re: exec/read -s bug?

2018-08-19 Thread Lars Schneider
> On Aug 19, 2018, at 6:33 PM, Lars Schneider wrote: > > Hi, > > consider this script: > > #!/bin/bash > [ "`whoami`" = "root" ] || { > exec sudo -u root "$0" "$@" > } > read -s -p "enter stuff: " stuff > > If I run the script as normal user (not root!) and I

exec/read -s bug?

2018-08-19 Thread Lars Schneider
Hi, consider this script: #!/bin/bash [ "`whoami`" = "root" ] || { exec sudo -u root "$0" "$@" } read -s -p "enter stuff: " stuff If I run the script as normal user (not root!) and I abort the "read -s -p" call with "ctrl-c", then my shell is still in si

Re: Add sleep builtin

2018-08-19 Thread konsolebox
On Mon, Aug 20, 2018 at 12:26 AM, Clint Hepner wrote: > >> On Aug 19, 2018, at 10:25 AM, konsolebox wrote: >> >> Hi Chet, >> >> The sleep command is often used in loops and using the external sleep >> is expensive. > > Expensive is relative, as the time spent actually sleeping probably dwarfs >

Re: Add sleep builtin

2018-08-19 Thread Clint Hepner
> On Aug 19, 2018, at 10:25 AM, konsolebox wrote: > > Hi Chet, > > The sleep command is often used in loops and using the external sleep > is expensive. Expensive is relative, as the time spent actually sleeping probably dwarfs the startup time. If not, you probably want to find an alterna

Re: Assignment of associative arrays through braces

2018-08-19 Thread konsolebox
On Wed, Aug 1, 2018 at 12:53 AM, konsolebox wrote: > On Tue, Jul 31, 2018 at 10:31 PM, Chet Ramey wrote: >> On 7/27/18 7:13 PM, konsolebox wrote: >>> Hi Chet, >>> >>> I wonder if you can allow bash to have another syntax to allow simpler >>> declaration and/or definition of associative arrays. T

Add sleep builtin

2018-08-19 Thread konsolebox
Hi Chet, The sleep command is often used in loops and using the external sleep is expensive. Perhaps we can add the sleep builtin but have it disabled by default to avoid syntax conflict with the external one. Users who would want the builtin version can simply run: [[ BASH_VERSINFO -ge 5 ]] &&