set -e, but test return not honoured _conditionally_

2011-02-22 Thread Steffen Daode Nurpmeso
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin10.0 Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='darwin10.0' -DCONF_MACHTYPE='i386-apple-darwin10.0' -DCONF_VENDOR='apple' -DLOCALEDIR='/usr/share/locale' -D

Question. Autocomplete paths starting with %.

2011-02-22 Thread d...@ucore.info
Hi, I'm not subscribed to this list so please make sure to CC me if you want me to receive the reply. I'd like to hack some solution based on: http://www.huyng.com/bashmarks-directory-bookmarks-for-the-shell/ but to be able to use saved bookmarks in other commands (explanation below). So if I h

Strange bug in arithmetic function

2011-02-22 Thread Marcel de Reuver
In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if the week number is even. Only in week 08 the error is: bash: 08: value too great for base (error token is "08") the same in week 09, all others are Ok... GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu) Copyright (C) 200

Re: Strange bug in arithmetic function

2011-02-22 Thread Davide Brini
On Monday 21 Feb 2011 09:13:54 Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base > (error token is "08") the same in week 09, all others are Ok... It's not a

Re: set -e, but test return not honoured _conditionally_

2011-02-22 Thread Greg Wooledge
On Fri, Feb 18, 2011 at 04:36:06PM +0100, Steffen Daode Nurpmeso wrote: > I am not a sophisticated shell programmer, but i really think this > time it's a shell fault. You think *what* is the shell's fault? > You may invoke the code snippet via 'script test1 test3' or so. > > #!/bin/sh >

Re: set -e, but test return not honoured _conditionally_

2011-02-22 Thread Pierre Gaston
On Fri, Feb 18, 2011 at 5:36 PM, Steffen Daode Nurpmeso < sdao...@googlemail.com> wrote: > > Configuration Information [Automatically generated, do not change]: > Machine: i386 > OS: darwin10.0 > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' > -DCONF_OSTYPE='darwin10

Re: Strange bug in arithmetic function

2011-02-22 Thread Pierre Gaston
On Mon, Feb 21, 2011 at 11:13 AM, Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base > (error token is "08") the same in week 09, all others are Ok... > > GNU

Re: set -e, but test return not honoured _conditionally_

2011-02-22 Thread Pierre Gaston
On Tue, Feb 22, 2011 at 3:46 PM, Greg Wooledge wrote: > On Fri, Feb 18, 2011 at 04:36:06PM +0100, Steffen Daode Nurpmeso wrote: > > I am not a sophisticated shell programmer, but i really think this > > time it's a shell fault. > > You think *what* is the shell's fault? > > > You may invoke the c

Re: Strange bug in arithmetic function

2011-02-22 Thread Eric Blake
On 02/21/2011 02:13 AM, Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base > (error token is "08") the same in week 09, all others are Ok... 08 is an invalid

Re: no way to give 'select' a default value

2011-02-22 Thread Greg Wooledge
On Mon, Feb 21, 2011 at 04:05:34PM +0800, jida...@jidanni.org wrote: > There is no way to give the 'select' command a default value, so all the > user does is need to hit return. > $ help select > ... If the line is empty, WORDS and the prompt are redisplayed. `select' is extremely limited. I

Re: no way to give 'select' a default value

2011-02-22 Thread Clark J. Wang
On Tue, Feb 22, 2011 at 9:53 PM, Greg Wooledge wrote: > On Mon, Feb 21, 2011 at 04:05:34PM +0800, jida...@jidanni.org wrote: > > There is no way to give the 'select' command a default value, so all the > > user does is need to hit return. > > $ help select > > ... If the line is empty, WORDS

Re: Patterns of dynamic scoping and nested routines.

2011-02-22 Thread Chet Ramey
On 2/21/11 11:11 PM, Steven W. Orr wrote: > It has been an exciting weekend for me. I studied the dynamic vs static > scoping rules and I think I have a better handle on things, but I have a > few questions. > > It seems that there's no reason why we are not allowed to write nested > functions. Ne

Re: Strange bug in arithmetic function

2011-02-22 Thread Chris Jones
On Mon, Feb 21, 2011 at 04:13:54AM EST, Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base > (error token is "08") the same in week 09, all others are ok...

document factors influencing select's number of columns

2011-02-22 Thread jidanni
The 'select' documentation should also document the perhaps complex way $LINES $COLUMNS the number of items the length of the longest item interact to determine if the items will be displayed in rows/columns, etc.

Re: Strange bug in arithmetic function

2011-02-22 Thread jellybean stonerfish
On Mon, 21 Feb 2011 10:13:54 +0100, Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base (error > token is "08") the same in week 09, all others are Ok... > >

Patch: Corrupt display for history search in vi-mode, 256-color prompt

2011-02-22 Thread Micah Cowan
This bug affects both readline and bash (however, it is expected that this bug is far more likely to affect bash than other typical readline-using applications). It was experienced on bash 4.1-2ubuntu4 (on Ubuntu 10.10, "Maverick Meercat"), but I checked the sources for readline 6.2 and bash 4.2, a

Re: Patch: Corrupt display for history search in vi-mode, 256-color prompt

2011-02-22 Thread Dennis Williamson
2011/2/22 Micah Cowan : > This bug affects both readline and bash (however, it is expected that > this bug is far more likely to affect bash than other typical > readline-using applications). It was experienced on bash 4.1-2ubuntu4 > (on Ubuntu 10.10, "Maverick Meercat"), but I checked the sources

How to match pattern in bash?

2011-02-22 Thread Peng Yu
Suppose that I have a variable $x, I want to test if the content of $x match the pattern 'abc*'. If yes, then do something. (The operator == doesn't match patterns, if I understand it correctly.) Is there such a build-in feature in bash? Or I have to rely on some external program such as perl to t

Re: How to match pattern in bash?

2011-02-22 Thread Clark J. Wang
On Wed, Feb 23, 2011 at 11:24 AM, Peng Yu wrote: > Suppose that I have a variable $x, I want to test if the content of $x > match the pattern 'abc*'. If yes, then do something. (The operator == > doesn't match patterns, if I understand it correctly.) > > Reread the bash manual about [[ == ]]. >

Re: How to match pattern in bash?

2011-02-22 Thread Eric Blake
On 02/22/2011 08:24 PM, Peng Yu wrote: > Suppose that I have a variable $x, I want to test if the content of $x > match the pattern 'abc*'. If yes, then do something. (The operator == > doesn't match patterns, if I understand it correctly.) > > Is there such a build-in feature in bash? Or I have t

Re: How to match pattern in bash?

2011-02-22 Thread Micah Cowan
On 02/22/2011 07:24 PM, Peng Yu wrote: > Suppose that I have a variable $x, I want to test if the content of $x > match the pattern 'abc*'. If yes, then do something. (The operator == > doesn't match patterns, if I understand it correctly.) > > Is there such a build-in feature in bash? Or I have t

Re: Question. Autocomplete paths starting with %.

2011-02-22 Thread Clark J. Wang
On Sat, Feb 19, 2011 at 9:20 PM, d...@ucore.info wrote: > > I can script in Bash quite well, but I've never did anything that > fancy with completion and I don't know how to plug my function to > handle this. I understand that I should register something (function > named like _bookmarkcomp) to h