[linux] Re: Wat nou? bash veranderd?
Robert M. Stockmann
stock op stokkie.net
Do Jan 3 05:34:55 CET 2008
On Thu, 3 Jan 2008, Robert M. Stockmann wrote:
> Date: Thu, 3 Jan 2008 05:26:54 +0100 (CET)
> From: Robert M. Stockmann <stock op stokkie.net>
> Reply-To: linux op lists.nllgg.nl
> To: linux op lists.nllgg.nl
> Subject: [linux] Re: Wat nou? bash veranderd?
>
> On Wed, 2 Jan 2008, Hans Paijmans wrote:
>
> > Date: Wed, 02 Jan 2008 19:25:25 +0100
> > From: Hans Paijmans <j.j.paijmans op uvt.nl>
> > Reply-To: linux op lists.nllgg.nl
> > To: linux op lists.nllgg.nl
> > Subject: [linux] Wat nou? bash veranderd?
> >
> > gegeven het volgende scriptje:
> >
> > #!/bin/sh
> >
> > function help()
> > {
> > echo "kut"
> > }
> > help
> >
> > Op bash 3.2.25(3.2 geeft dit een foutmelding (unexpected '(').
> > /Dat/ is leuk...
>
> I denk dat er toch iets anders aan de hand is :
>
> [jackson:stock]:(~/src/bash)$ gcc -v
> Reading specs from /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/specs
> Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --with-slibdir=/lib64 --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++,ada,f77,objc,java --host=x86_64-mandrake-linux-gnu --with-system-zlib
> Thread model: posix
> gcc version 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)
> [jackson:stock]:(~/src/bash)$ ls
> bash32-001 bash32-006 bash32-011 bash32-016 bash32-021 bash-3.2.tar.gz
> bash32-002 bash32-007 bash32-012 bash32-017 bash32-022 bash.patch
> bash32-003 bash32-008 bash32-013 bash32-018 bash32-023 tt.sh
> bash32-004 bash32-009 bash32-014 bash32-019 bash32-024
> bash32-005 bash32-010 bash32-015 bash32-020 bash32-025
> [jackson:stock]:(~/src/bash)$ tar xzf bash-3.2.tar.gz
> [jackson:stock]:(~/src/bash)$ cd bash-3.2
> [jackson:stock]:(~/src/bash/bash-3.2)$ echo $BASH_VERSION
> 3.00.16(1)-release
> [jackson:stock]:(~/src/bash)$ tar xzf bash-3.2.tar.gz
> [jackson:stock]:(~/src/bash)$ cd bash-3.2
> [jackson:stock]:(~/src/bash/bash-3.2)$ for i in ../bash32-0??; do patch -p0 < $i; echo $i; done
> patching file parse.y
> patching file patchlevel.h
> ../bash32-001
> patching file po/ru.po
> patching file patchlevel.h
> ../bash32-002
> patching file parse.y
> patching file patchlevel.h
> ../bash32-003
> patching file subst.c
> patching file tests/new-exp.right
> patching file patchlevel.h
> ../bash32-004
> patching file builtins/printf.def
> patching file lib/sh/snprintf.c
> patching file patchlevel.h
> ../bash32-005
> patching file lib/readline/display.c
> patching file patchlevel.h
> ../bash32-006
> patching file jobs.c
> patching file patchlevel.h
> ../bash32-007
> patching file findcmd.c
> patching file patchlevel.h
> ../bash32-008
> patching file lib/sh/snprintf.c
> patching file patchlevel.h
> ../bash32-009
> patching file pathexp.h
> patching file pathexp.c
> patching file subst.c
> patching file execute_cmd.c
> patching file patchlevel.h
> ../bash32-010
> patching file configure.in
> patching file config-bot.h
> patching file builtins/common.c
> patching file configure
> patching file patchlevel.h
> ../bash32-011
> patching file config.h.in
> patching file builtins/printf.def
> patching file patchlevel.h
> ../bash32-012
> patching file lib/readline/display.c
> patching file patchlevel.h
> ../bash32-013
> patching file array.c
> patching file array.h
> patching file subst.c
> patching file patchlevel.h
> ../bash32-014
> patching file execute_cmd.c
> patching file subst.c
> Hunk #1 succeeded at 4166 (offset 15 lines).
> Hunk #2 succeeded at 4221 (offset 15 lines).
> Hunk #3 succeeded at 4742 (offset 23 lines).
> patching file subst.h
> patching file patchlevel.h
> ../bash32-015
> patching file lib/readline/display.c
> patching file patchlevel.h
> ../bash32-016
> patching file lib/readline/display.c
> patching file patchlevel.h
> ../bash32-017
> patching file jobs.c
> patching file patchlevel.h
> ../bash32-018
> patching file lib/readline/complete.c
> patching file lib/readline/input.c
> patching file lib/readline/isearch.c
> patching file lib/readline/misc.c
> patching file lib/readline/readline.c
> patching file lib/readline/text.c
> patching file lib/readline/vi_mode.c
> patching file patchlevel.h
> ../bash32-019
> patching file sig.c
> patching file sig.h
> patching file builtins/common.c
> patching file subst.c
> patching file arrayfunc.c
> patching file expr.c
> patching file variables.c
> patching file patchlevel.h
> ../bash32-020
> patching file parse.y
> patching file patchlevel.h
> ../bash32-021
> patching file builtins/read.def
> patching file patchlevel.h
> ../bash32-022
> patching file subst.c
> patching file patchlevel.h
> ../bash32-023
> patching file lib/readline/display.c
> patching file patchlevel.h
> ../bash32-024
> patching file lib/readline/input.c
> patching file patchlevel.h
> ../bash32-025
> [jackson:stock]:(~/src/bash/bash-3.2)$ ./configure
> [jackson:stock]:(~/src/bash/bash-3.2)$ make
> bison -y -d ./parse.y
> conflicts: 1 shift/reduce
> touch parser-built
> rm -f mksyntax
> gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -o mksyntax ./mksyntax.c
> rm -f syntax.c
> ./mksyntax -o syntax.c
> /bin/sh ./support/mkversion.sh -b -S . -s release -d 3.2 -o newversion.h \
> && mv newversion.h version.h
> gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -DBUILDTOOL -c -o buildversion.o ./version.c
> gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' -DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -o bashversion ./support/bashversion.c buildversion.o
>
> ***********************************************************
> * *
> * GNU bash, version 3.2.25(1)-release (x86_64-unknown-linux-gnu)
> * *
> ***********************************************************
>
> -rwxr-xr-x 1 stock stock 1768570 Jan 3 05:23 bash
> size bash
> text data bss dec hex filename
> 747024 43760 22504 813288 c68e8 bash
> [jackson:stock]:(~/src/bash/bash-3.2)$
> [jackson:stock]:(~/src/bash/bash-3.2)$ ll bash
> -rwxr-xr-x 1 stock stock 1768570 Jan 3 05:23 bash*
> [jackson:stock]:(~/src/bash/bash-3.2)$ ./bash
> [jackson:stock]:(~/src/bash/bash-3.2)$ echo $BASH_VERSION
> 3.2.25(1)-release
> [jackson:stock]:(~/src/bash/bash-3.2)$ cat ../tt.sh
> #!/bin/sh
>
> function help()
> {
> echo "kut"
> }
> help
> [jackson:stock]:(~/src/bash/bash-3.2)$
> [jackson:stock]:(~/src/bash/bash-3.2)$ ./bash ../tt.sh
> kut
> [jackson:stock]:(~/src/bash/bash-3.2)$
Als ik #!/bin/sh eruit haal krijg ik nog steeds de fout van Paai
niet:
[jackson:stock]:(~/src/bash/bash-3.2)$ echo $BASH_VERSINFO
3
[jackson:stock]:(~/src/bash/bash-3.2)$ echo $BASH_VERSION
3.2.25(1)-release
[jackson:stock]:(~/src/bash/bash-3.2)$ cat ../tt.sh
function help()
{
echo "kut"
}
help
[jackson:stock]:(~/src/bash/bash-3.2)$ ./bash
bash bashbug bashversion
[jackson:stock]:(~/src/bash/bash-3.2)$ ./bash ../tt.sh
kut
[jackson:stock]:(~/src/bash/bash-3.2)$
Er is dus wat anders aan de hand. Welke versie van Linux
wordt er gebruikt? SuSE 10.3?
Vr.gr.
Robert
--
Robert M. Stockmann - RHCE
Network Engineer - UNIX/Linux Specialist
crashrecovery.org stock op stokkie.net
More information about the Linux
mailing list