Re: NOT changing global variables

2006-12-29 Thread Andrew Stitt
On Fri, Dec 29, 2006 at 11:43:14PM +0100, Frans de Boer wrote: > Yes, I did expected such an answer of using a subshell, and yes I can > get the return value, but I don need it. I need the output fed into > another (maybe local) variable. I was under the impression that BASH was > modeled after 'C'

Re: Bash - various feature requests

2006-12-29 Thread Richard Neill
5)An enhancement to read/readline, such that one can specify the initial value with which the buffer is filled. Currently, we can do: read -ep 'Enter your name: ' NAME and I might type "Richad Neill". #Note the deliberate typo. If the script recognises this as invalid, the best it ca

Re: Bash - various feature requests

2006-12-29 Thread William Park
On Wed, Dec 27, 2006 at 11:03:31PM +, Richard Neill wrote: > 1)substr support for a negative length argument. > For example, > stringZ=abcdef > echo ${stringZ:2:-1} #prints cde > > i.e. ${string:x:y} > returns the string, from start position x for y characters. > but, if x is negative

Re: bad test for sys_siglist

2006-12-29 Thread Chet Ramey
Alexander E. Patrakov wrote: > > so this is caused by mismatch of HAVE_DECL_SYS_SIGLIST vs > SYS_SIGLIST_DECLARED (which is used exactly once in the > ./configure script, in this ifndef line, and thus is never > defined) Thanks. It seems that AC_DECL_SYS_SIGLIST no longer define

Re: NOT changing global variables

2006-12-29 Thread Frans de Boer
Yes, I did expected such an answer of using a subshell, and yes I can get the return value, but I don need it. I need the output fed into another (maybe local) variable. I was under the impression that BASH was modeled after 'C', so I started using the functions as such. My mistake. I have the conf

Re: Bash - various feature requests

2006-12-29 Thread Richard Neill
Dear Grzegorz, Thanks for your helpful reply. Grzegorz Adam Hankiewicz wrote: On 2006-12-27, Richard Neill <[EMAIL PROTECTED]> wrote: 1)substr support for a negative length argument. For example, stringZ=abcdef echo ${stringZ:2:-1} #prints cde i.e. ${string:x:y} returns the string, fro

Re: bash -x $'' hexadecimal

2006-12-29 Thread Chet Ramey
Dan Jacobson wrote: > I notice bash -x prints some messages in octal, > $'\345\226\256\350\252\236\345\214\226' > I bet there's no way to get it to print them in hexadecimal. There is not. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No

Re: Bash - various feature requests

2006-12-29 Thread Grzegorz Adam Hankiewicz
On 2006-12-29, Andreas Schwab <[EMAIL PROTECTED]> wrote: > Read the second last sentence of the paragraph. Makes sense. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

Re: Bash - various feature requests

2006-12-29 Thread Chet Ramey
Grzegorz Adam Hankiewicz wrote: > However, if I use echo ${f:-3} I don't get the expected result. I wonder > if this is a bug of my bash version: Please read the Bash FAQ, question E12. ${parameter:-word} already means something else. Chet -- ``The lyf so short, the craft so long to lerne.''

Re: Bash - various feature requests

2006-12-29 Thread Andreas Schwab
Grzegorz Adam Hankiewicz <[EMAIL PROTECTED]> writes: > See "Parameter Expansion" in the bash manual. Interestingly that same > section tells for '${parameter:offset}' expansion: > > "If offset evaluates to a number less than zero, the value > is used as an offset from the end of

Re: Bad tokenisation inside backticks

2006-12-29 Thread Chet Ramey
Adam Sampson wrote: > 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='i686-pc-linux-gnu' > -DCONF_VENDOR='pc' -DLOCALEDIR

Re: Bash - various feature requests

2006-12-29 Thread Grzegorz Adam Hankiewicz
On 2006-12-27, Richard Neill <[EMAIL PROTECTED]> wrote: > 1)substr support for a negative length argument. > For example, > stringZ=abcdef > echo ${stringZ:2:-1} #prints cde > > i.e. ${string:x:y} > returns the string, from start position x for y characters. > but, if x is negative, start

Re: NOT changing global variables

2006-12-29 Thread Andreas Schwab
Frans de Boer <[EMAIL PROTECTED]> writes: > Okay, the function tries to alter the global var1 integer. But, the > result is that var1 is NOT changed. Yes, because the function is executed in a subshell. > So, the result of the first echo > will be 0 > However, the next echo displays the changed

Re: Calling external programs in bash script

2006-12-29 Thread Bob Proulx
Ramprasad B wrote: > I need a help in calling external programs from shell script. A shell script and specifically a bash script automically calls external programs. > For example a java class or methods and c functions from a shell script. Those programs need to be turned into a standalone exec

Re: Feature request for the 'local' builtin command - passthrough return status

2006-12-29 Thread Bob Proulx
Daniel Webb wrote: > First off, please CC me on any replies because there are no instructions on > the FSF bash page (http://directory.fsf.org/bash.html) to tell me how to > subscribe to this list. All of the mailing lists accept subscription commands by mail to the -request address. The followin

Calling external programs in bash script

2006-12-29 Thread Ramprasad B
Hi, I need a help in calling external programs from shell script. For example a java class or methods and c functions from a shell script. Thanks in advance for your help ! - Ramprasad B __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

Bash - various feature requests

2006-12-29 Thread Richard Neill
Dear All, I hope I'm posting this in the right place, since it it's really a feature request, rather than a bug report. However, here are a few things which I think would be nice to have in bash, and easy to implement: 1)substr support for a negative length argument. For example, stringZ=ab

[REPOST] bad test for sys_siglist

2006-12-29 Thread Alexander E. Patrakov
Sorry if this is a duplicate, my earlier post didn't show up in bash-bug archives. Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE

bad test for sys_siglist

2006-12-29 Thread Alexander E. Patrakov
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='b

Feature request for the 'local' builtin command - passthrough return status

2006-12-29 Thread Daniel Webb
First off, please CC me on any replies because there are no instructions on the FSF bash page (http://directory.fsf.org/bash.html) to tell me how to subscribe to this list. My request is to add a new switch to the 'local' builtin which tells it to not modify the return status (I use the -p switch

bash -x $'' hexadecimal

2006-12-29 Thread Dan Jacobson
I notice bash -x prints some messages in octal, $'\345\226\256\350\252\236\345\214\226' I bet there's no way to get it to print them in hexadecimal. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

Bad tokenisation inside backticks

2006-12-29 Thread Adam Sampson
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='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/opt/share/locale' -DPACKAGE='ba

NOT changing global variables

2006-12-29 Thread Frans de Boer
My example problem using Bash 3.00.16 (Suse 9.3) #! declare -i var1=2 function dowhat () { local -i i=0 . . var1=$((var1+1)) echo $i } iretval=$(dowhat argument) echo $var1 dowhat argument echo $var1 - Okay, the function tries to alter the global var1 integer. But