Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Chet Ramey
On 3/15/13 4:01 PM, Linda Walsh wrote: > Perhaps it would be doing a favor to users and allow some minor code > cleanup to simply get rid of the 'rbash'/restricted functionality. It's already an optional feature. You can easily remove it by configuring bash with `--disable-restricted'. That's n

Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Chris Down
On 2013-03-16 12:13, Chet Ramey wrote: > > If it cannot be removed, then some people are using it with the false > > expectation that it provides some increased security. Better to get > > rid of that than have someone think it is worth the extra bytes it takes > > to implement. > > Folks cling ti

Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Pierre Gaston
On Sat, Mar 16, 2013 at 6:28 PM, Chris Down wrote: > On 2013-03-16 12:13, Chet Ramey wrote: >> > If it cannot be removed, then some people are using it with the false >> > expectation that it provides some increased security. Better to get >> > rid of that than have someone think it is worth the

Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Chris Down
On 2013-03-16 23:06, Pierre Gaston wrote: > On Sat, Mar 16, 2013 at 6:28 PM, Chris Down wrote: > > On 2013-03-16 12:13, Chet Ramey wrote: > >> > If it cannot be removed, then some people are using it with the false > >> > expectation that it provides some increased security. Better to get > >> >

Bug/limitation in 'time'

2013-03-16 Thread Bruce Dawson
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='$ uname output: Linux Ubuntu1m 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 18:04:39

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
Hi Bruce, On 2013-03-16 17:41, Bruce Dawson wrote: > I think it's important because when I hit this problem (using $(expr) for > looping in shell scripts is slow) I initially assumed that my task was not > CPU bound, because that is what 'time' told me. This then led me down the > wrong path in my

RE: Bug/limitation in 'time'

2013-03-16 Thread Bruce Dawson
Thanks -- good to know that there is a fast and POSIX compliant method of doing this. I should have included my optimized counting loop -- it's what we switched to when we realized that $(expr) was a problem. Here it is now: # This code performs quite well function BashCount() { i=$1

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
On 2013-03-16 19:33, Bruce Dawson wrote: > Thanks -- good to know that there is a fast and POSIX compliant method of > doing this. I should have included my optimized counting loop -- it's what > we switched to when we realized that $(expr) was a problem. Here it is now: > > # This code performs qu

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
On 2013-03-16 19:18, Bruce Dawson wrote: > Yep, we've changed our loops to use roughly that syntax. Unfortunately a lot > of online resources recommend the $(expr) technique. Unfortunately most online resources on bash are terrible. The only ones I can recommend outside of the official documentati

RE: Bug/limitation in 'time'

2013-03-16 Thread Bruce Dawson
Yep, we've changed our loops to use roughly that syntax. Unfortunately a lot of online resources recommend the $(expr) technique. My understanding is that using $(expr) is more portable, because i-- is bash specific, but I don't really know. -Original Message- From: Chris Down [mailto:ch..

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris F.A. Johnson
On Sun, 17 Mar 2013, Chris Down wrote: Hi Bruce, On 2013-03-16 17:41, Bruce Dawson wrote: I think it's important because when I hit this problem (using $(expr) for looping in shell scripts is slow) I initially assumed that my task was not CPU bound, because that is what 'time' told me. This th

Re: Bug/limitation in 'time'

2013-03-16 Thread William Park
On Sat, Mar 16, 2013 at 10:15:50PM -0400, Chris F.A. Johnson wrote: > On Sun, 17 Mar 2013, Chris Down wrote: > > ExprCount() { > > for (( i = $1 ; i > 0 ; i-- )); do > > : > > done > > echo "$1 iterations" > > } > >Or, in a POSIX-compliant manner: > > ExprCount

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
On 2013-03-17 01:09, William Park wrote: > Are you saying that > > for (( ; ; )) > > is not POSIX? `((' is not POSIX. pgpstbEnn7hm4.pgp Description: PGP signature

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris F.A. Johnson
On Sun, 17 Mar 2013, William Park wrote: On Sat, Mar 16, 2013 at 10:15:50PM -0400, Chris F.A. Johnson wrote: On Sun, 17 Mar 2013, Chris Down wrote: ExprCount() { for (( i = $1 ; i > 0 ; i-- )); do : done echo "$1 iterations" } Or, in a POSIX-compliant manne

Re: Bug/limitation in 'time'

2013-03-16 Thread Pierre Gaston
On Sun, Mar 17, 2013 at 4:33 AM, Bruce Dawson wrote: > Thanks -- good to know that there is a fast and POSIX compliant method of > doing this. I should have included my optimized counting loop -- it's what > we switched to when we realized that $(expr) was a problem. Here it is now: > > # This cod