Definition of BASH_LINENO/FUNCNAME

2007-10-03 Thread marty leisner
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -D_GNU_SOURCE 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables
uname output: Linux dell2.home 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 
i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
Confusion in manual or bug about BASH_LINENO

The manual says:
`BASH_LINENO'
 An array variable whose members are the line numbers in source
 files corresponding to each member of FUNCNAME.
 `${BASH_LINENO[$i]}' is the line number in the source file where
 `${FUNCNAME[$i]}' was called.  The corresponding source file name
 is `${BASH_SOURCE[$i]}'.  Use `LINENO' to obtain the current line
 number.

It seeams ${FUNCNAME[$i]} is matched by ${BASH_LINENO[$i-1]} as a pair.

Repeat-By:

   : [EMAIL PROTECTED] 02:28:01;nl -b a bug.sh
 1  #! /bin/bash
 2
 3  function fail
 4  {
 5  echo Fatal Failure in ${FUNCNAME[1]}:${BASH_LINENO[0]}:  $*
 6  exit 1
 7  }
 8
 9  function bar
10  {
11  echo [EMAIL PROTECTED]
12  echo [EMAIL PROTECTED]
13  fail "this is confusing"
14
15
16  }
17
18  function foo
19  {
20  bar
21  }
22
23  foo
: [EMAIL PROTECTED] 02:28:33;bash ./bug.sh
bar foo main
20 23 0
Fatal Failure in bar:13: this is confusing


Fix:
Change the manual.  Or this may be a bug?




Re: Any plans to integrate an XML parser

2007-10-03 Thread Chet Ramey
> In our bash scripts, we often access XML files. Are there any plans to
> integrate an XML parser in bash?

No.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://tiswww.tis.case.edu/~chet/




Re: Offset error (when using PS1 with colors and newline)

2007-10-03 Thread Matthew Woehlke

dAniel hAhler wrote:

Can you reproduce the bug with PS1="\n\[\033[0m\]" (which seems to be
valid as far as I can see)?


Yes... I was able to reproduce on bash 3.2.9, but not bash 3.0.15 or 
bash 3.2.5. Good chance that makes one of four patches the culprit :-).


--
Matthew
"Passion is inversely proportional to the amount of real information 
available." -- Benford's Law of Controversy

http://en.wikipedia.org/wiki/Benford%27s_law_of_controversy