Jan Schampera wrote:
> Well, I guess intuitively expected that it evaluates to 0, like for
> example:
>
> $ test=string
> $ echo $((test))
> 0
In that case it is like the 'atoi(3)' routine. A non-numeric has no
number value and is evaluated to be zero. A single zero is a valid
arithmetic expres
[EMAIL PROTECTED] wrote:
> Hi Bob, a quick question if I could as I am trying to determine if my bash
> thinks it has a tty device or not and therefore is interactive or not.
Internally bash will use the libc isatty(3) routine to determine if
the input/output files are tty devices. In the shell
Begin forwarded message:
Date: Mon, 2 Jul 2007 18:32:49 +0200
From: Jan Schampera <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] (Bob Proulx)
Subject: Re: Arithmetic expressions and parameters with newlines breaks
On Mon, 2 Jul 2007 10:08:08 -0600
[EMAIL PROTECTED] (Bob Proulx) wrote:
> What behav
Jan Schampera <[EMAIL PROTECTED]> writes:
> Description:
> Parameters inside arithmetic contexts like $(()) and (()) break
> the expression parsing when they contain a newline
>
> Repeat-By:
> $ foo="12
> > 34"
>
> $ echo $((foo))
> bash: 12
>
Jan Schampera wrote:
> Parameters inside arithmetic contexts like $(()) and (()) break
> the expression parsing when they contain a newline
Thank you for your bug report.
> $ foo="12
> > 34"
>
> $ echo $((foo))
> bash: 12
> 34: syntax error
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='bash