arguments to script prefixed with "--" in debug
Hi, I am trying to debug my shell script by bashdb. My script take as argument "--gdb", so I wrote bashdb myscript.sh --gdb However, this way it will produce error that bashdb: unrecognized option '--gdb' If I quote --gdb as bashdb myscript.sh '--gdb' then I will end up with the quotes as part of my argument. How could I fix this problem? Thanks! -- View this message in context: http://www.nabble.com/arguments-to-script-prefixed-with-%22--%22-in-debug-tp9369p9369.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
[PATCH] readline support for FreeBSD-7 and Gentoo/FreeBSD
Hi, FreeBSD 7+ does not have /usr/bin/objformat anymore. The problem is that support/shobj-conf and shlib-install uses it to determine if FreeBSD supports ELF or NOT. Given that FreeBSD 7+ ALWAYS has ELF libraries, that check is useless and dangerous (we have no SONAME in library). I attach a patch to fix that problem and also to support Gentoo/FreeBSD (We use the linux library naming schema). -- Timothy `Drizzt` Redaelli FreeSBIE Developer, Gentoo Developer, GUFI Staff There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. -- Jeremy S. Anderson diff -ur readline-6.0.orig/shlib/Makefile.in readline-6.0/shlib/Makefile.in --- readline-6.0.orig/shlib/Makefile.in 2009-01-06 18:03:22 +0100 +++ readline-6.0/shlib/Makefile.in 2009-02-26 18:48:15 +0100 @@ -50,6 +50,7 @@ SHELL = @MAKE_SHELL@ host_os = @host_os@ +host_vendor = @host_vendor@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -182,13 +183,13 @@ -$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir) install: installdirs $(SHLIB_STATUS) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) @echo install: you may need to run ldconfig uninstall: - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE) @echo uninstall: you may need to run ldconfig clean mostlyclean: force diff -ur readline-6.0.orig/support/shlib-install readline-6.0/support/shlib-install --- readline-6.0.orig/support/shlib-install 2008-07-20 01:16:05 +0200 +++ readline-6.0/support/shlib-install 2009-02-26 18:40:41 +0100 @@ -3,7 +3,7 @@ # shlib-install - install a shared library and do any necessary host-specific # post-installation configuration (like ldconfig) # -# usage: shlib-install [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library +# usage: shlib-install [-D] -O host_os -V host_vendor -d installation-dir [-b bin-dir] -i install-prog [-U] library # # Chet Ramey # c...@po.cwru.edu @@ -15,13 +15,14 @@ LDCONFIG=ldconfig PROGNAME=`basename $0` -USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library" +USAGE="$PROGNAME [-D] -O host_os -V host_vendor -d installation-dir [-b bin-dir] -i install-prog [-U] library" # process options while [ $# -gt 0 ]; do case "$1" in -O) shift; host_os="$1"; shift ;; + -V) shift; host_vendor="$1"; shift ;; -d) shift; INSTALLDIR="$1"; shift ;; -b) shift; BINDIR="$1" ; shift ;; -i) shift; INSTALLPROG="$1" ; shift ;; @@ -115,8 +116,8 @@ # # Create symlinks to the installed library. This section is incomplete. # -case "$host_os" in -*linux*) +case "$host_os-$host_vendor" in +*linux*|freebsd*-gentoo) # libname.so.M -> libname.so.M.N ${echo} ${RM} ${INSTALLDIR}/$LINK2 if [ -z "$uninstall" ]; then @@ -130,7 +131,7 @@ fi ;; -bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|netbsd*) +bsdi4*|*gnu*|darwin*|macosx*|netbsd*) # libname.so.M -> libname.so.M.N ${echo} ${RM} ${INSTALLDIR}/$LINK2 if [ -z "$uninstall" ]; then @@ -153,8 +154,8 @@ ;; -# FreeBSD 3.x and above can have either a.out or ELF shared libraries -freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*) +# FreeBSD 3.x to 6.x can have either a.out or ELF shared libraries +freebsd[3-6]*|freebsdelf[3-6]*|freebsdaout[3-9]*) if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then # libname.so -> libname.so.M ${echo} ${RM} ${INSTALLDIR}/$LINK1 @@ -176,6 +177,15 @@ fi ;; +# FreeBSD 7.x and above has only ELF shared libraries +freebsd[7-9]*|freebsdelf[7-9]*) + # libname.so -> libname.so.M + ${echo} ${RM} ${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi + ;; + hpux1*) # libname.sl -> libname.M ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl diff -ur readline-6.0.orig/support/shobj-conf readline-6.0/support/shobj-conf --- readline-6.0.orig/support/shobj-conf 2009-01-04 20:32:42 +0100 +++ readline-6.0/support/shobj-conf 2009-02-26 18:40:11 +0100 @@ -64,7
Re: bashdb question
On Thursday 26 February 2009 17:36:12 lehe wrote: > I installed bashdb through Synaptic Package Manager of my Ubuntu 8.10 and > it was installed into /usr/share/bashdb/, /usr/bin/, /usr/lib/ etc. Not > sure these could be found by bash. > > How to know if DEBUGGER_START_FILE is defined in pathnames.h and define it > this way if not? > > Also I ried one suggestion found with Google: > "To see if your standard bash executable has bashdb support, execute the > command shown below; if you are not taken to a bashdb prompt then you'll > have to install bashdb yourself. $ bash --debugger -c "set|grep -i dbg" " > I am not taken to bashdb prompt and instead get > "BASH_EXECUTION_STRING='set|grep -i dbg'". So I guess my bashdb is not set > up properly? older versions of bash (<4.0) would install the bashdb files according to the configure script but still hardcode the path to bashdb in /usr/local/ this is fixed with bash-4.0 though. not sure how many distros out there noticed ... Chet's suggestions would tell you real quick if Debian/Ubuntu did ... -mike signature.asc Description: This is a digitally signed message part.
Re: bash-4.0 regression with here documents and multiline subshells
On Thursday 26 February 2009 17:29:18 Chet Ramey wrote: > Mike Frysinger wrote: > > the documentation shows that for <<< here documents, the word must be > > right after the operator (although it doesnt really spell it out). not > > sure if that should be made explicit and to have bash reject it, or to > > fix up this issue so it works again ... > > > > at any rate, this style usage, while seemingly not allowed by the docs, > > works fine with older/current bash: > > echo $(cat <<< "foo") > > > > however, when we go multiline, bash-4.0 gets into a parsing loop: > > $ cat test.sh > > #!/bin/bash > > echo $( > > cat <<< "foo" > > ) > > $ ./test.sh > > ./test.sh: line 2: unexpected EOF while looking for matching `)' > > ./test.sh: line 5: syntax error: unexpected end of file > > > > if we go ahead and remove that whitespace after the <<<, then it works > > fine: $ cat test.sh > > #!/bin/bash > > echo $( > > cat <<<"foo" > > ) > > $ ./test.sh > > foo > > Problem with the $(...) parser not knowing the difference between << and > <<<. The attached patch fixes it. yep, and it fixes against the original large script. thanks! -mike signature.asc Description: This is a digitally signed message part.
Re: bashdb question
lehe wrote: > Thanks, Chet! > > I installed bashdb through Synaptic Package Manager of my Ubuntu 8.10 and it > was installed into /usr/share/bashdb/, /usr/bin/, /usr/lib/ etc. Not sure > these could be found by bash. > > How to know if DEBUGGER_START_FILE is defined in pathnames.h and define it > this way if not? Run $ strings /bin/bash | grep bashdb /usr/local/share/bashdb/bashdb-main.inc to see where the installed bash looks for the debugger start file. If you don't get any output, bash isn't built with debugger support. You have to rebuild bash yourself to change pathnames.h. Or you could just symlink /usr/share/bashdb to /usr/local/share/bashdb. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/
Re: bashdb question
Thanks, Chet! I installed bashdb through Synaptic Package Manager of my Ubuntu 8.10 and it was installed into /usr/share/bashdb/, /usr/bin/, /usr/lib/ etc. Not sure these could be found by bash. How to know if DEBUGGER_START_FILE is defined in pathnames.h and define it this way if not? Also I ried one suggestion found with Google: "To see if your standard bash executable has bashdb support, execute the command shown below; if you are not taken to a bashdb prompt then you'll have to install bashdb yourself. $ bash --debugger -c "set|grep -i dbg" " I am not taken to bashdb prompt and instead get "BASH_EXECUTION_STRING='set|grep -i dbg'". So I guess my bashdb is not set up properly? Thanks! Chet Ramey wrote: > > lehe wrote: >> Hi, >> I am beginning to use bashdb to debug my shell script. There is one >> problems >> here. With "bash --debugger ./myscript.sh" it will run to finish without >> stop, while with "bashdb ./myscript.sh" would stop at the beginning. How >> could I stop in the first usage? Thanks a lot! > > Do you have bashdb installed where bash expects it? Is > DEBUGGER_START_FILE > defined in pathnames.h? > > Chet > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > > Chet Ramey, ITS, CWRUc...@case.edu > http://cnswww.cns.cwru.edu/~chet/ > > > > -- View this message in context: http://www.nabble.com/bashdb-question-tp6555p22235083.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
Re: bash-4.0 regression with here documents and multiline subshells
Mike Frysinger wrote: > the documentation shows that for <<< here documents, the word must be right > after the operator (although it doesnt really spell it out). not sure if > that > should be made explicit and to have bash reject it, or to fix up this issue > so > it works again ... > > at any rate, this style usage, while seemingly not allowed by the docs, works > fine with older/current bash: > echo $(cat <<< "foo") > > however, when we go multiline, bash-4.0 gets into a parsing loop: > $ cat test.sh > #!/bin/bash > echo $( > cat <<< "foo" > ) > $ ./test.sh > ./test.sh: line 2: unexpected EOF while looking for matching `)' > ./test.sh: line 5: syntax error: unexpected end of file > > if we go ahead and remove that whitespace after the <<<, then it works fine: > $ cat test.sh > #!/bin/bash > echo $( > cat <<<"foo" > ) > $ ./test.sh > foo Problem with the $(...) parser not knowing the difference between << and <<<. The attached patch fixes it. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/ *** ../bash-4.0/parse.y 2009-01-08 08:29:12.0 -0500 --- parse.y 2009-02-26 17:22:15.0 -0500 *** *** 3395,3400 else shell_ungetc (peekc); ! tflags |= LEX_HEREDELIM; ! lex_firstind = -1; continue; } --- 3402,3410 else shell_ungetc (peekc); ! if (peekc != '<') ! { ! tflags |= LEX_HEREDELIM; ! lex_firstind = -1; ! } continue; }
Re: Associative array indexes not working as expected in Bash 4.0
AnMaster wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' > -DCONF_VENDOR='unknown' > -DLOCALEDIR='/home/arvid/local/shells/bash/4.0/share/locale' -DPACKAGE='bash' > -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib > -DSYS_BASHRC=/etc/bash/bashrc -DSYS_BASH_LOGOUT=/etc/bash/bash_logout > -DDEFAULT_PATH_VALUE=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin > -pipe -O1 -g > uname output: Linux tux.lan 2.6.27-gentoo-r8-1 #1 Sat Jan 31 04:55:36 CET 2009 > x86_64 AMD Sempron(tm) Processor 3300+ AuthenticAMD GNU/Linux > Machine Type: x86_64-unknown-linux-gnu > > Bash Version: 4.0 > Patch Level: 0 > Release Status: release > > Description: > It seems that associative array indexes are not treated in a consistent way in > bash 4.0. I was testing if associative arrays would work for what I needed > (the > strings I plan to use for indexes are be untrusted and can legally contain > anything except null-bytes, thus I was testing if it was robust with "strange" > data). See "Repeat-By:" below. > > So the issues are: > 1. How do you escape the ] in myarray["a]a"] so that bash handles it the same >way as foo="a]a"; myarray["$foo"]. > 2. While myarray["a]a"] errors out when assigning, reading with >${myarray["a]a"]} doesn't error out, but doesn't return the correct result >either. > 3. I'm not sure what happened in myarray['a]=test2;#a']="def". Did it eval the >single-quoted string? Seems buggy anyway. This patch should correct all of these associative array subscript parsing problems. Let me know how it works for you. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/ *** ../bash-4.0/parse.y 2009-01-08 08:29:12.0 -0500 --- parse.y 2009-02-25 17:25:56.0 -0500 *** *** 2916,2919 --- 2919,2923 #define P_COMMAND 0x08/* parsing a command, so look for comments */ #define P_BACKQUOTE 0x10/* parsing a backquoted command substitution */ + #define P_ARRAYSUB0x20/* parsing a [...] array subscript for assignment */ /* Lexical state while parsing a grouping construct or $(...). */ *** *** 3130,3133 --- 3134,3139 FREE (nestret); } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; } /* Parse an old-style command substitution within double quotes as a *** *** 3146,3149 --- 3152,3156 /* check for $(), $[], or ${} inside quoted string. */ { + parse_dollar_word: if (open == ch) /* undo previous increment */ count--; *** *** 4249,4253 (token_index == 0 && (parser_state&PST_COMPASSIGN { ! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); if (ttok == &matched_pair_error) return -1; /* Bail immediately. */ --- 4256,4260 (token_index == 0 && (parser_state&PST_COMPASSIGN { ! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); if (ttok == &matched_pair_error) return -1; /* Bail immediately. */ *** ../bash-4.0/arrayfunc.c 2009-01-04 14:32:21.0 -0500 --- arrayfunc.c 2009-02-25 07:58:54.0 -0500 *** *** 605,666 } ! /* This function assumes s[i] == '['; returns with s[ret] == ']' if !an array subscript is correctly parsed. */ ! int ! skipsubscript (s, i) ! const char *s; ! int i; ! { ! int count, c; ! #if defined (HANDLE_MULTIBYTE) ! mbstate_t state, state_bak; ! size_t slength, mblength; ! #endif ! ! #if defined (HANDLE_MULTIBYTE) ! memset (&state, '\0', sizeof (mbstate_t)); ! slength = strlen (s + i); ! #endif ! ! count = 1; ! while (count) ! { ! /* Advance one (possibly multibyte) character in S starting at I. */ ! #if defined (HANDLE_MULTIBYTE) ! if (MB_CUR_MAX > 1) ! { ! state_bak = state; ! mblength = mbrlen (s + i, slength, &state); ! ! if (MB_INVALIDCH (mblength)) ! { ! state = state_bak; ! i++; ! slength--; ! } ! else if (MB_NULLWCH (mblength)) ! return i; ! else ! { ! i += mblength; ! slength -= mblength; ! } ! } ! else ! #endif ! ++i; ! ! c = s[i]; ! ! if (c == 0) ! break; ! else if (c == '[') ! count++; ! else if (c == ']') ! count--; ! } ! ! return i; ! } /* This function is called wit
Re: bashdb question
lehe wrote: > Hi, > I am beginning to use bashdb to debug my shell script. There is one problems > here. With "bash --debugger ./myscript.sh" it will run to finish without > stop, while with "bashdb ./myscript.sh" would stop at the beginning. How > could I stop in the first usage? Thanks a lot! Do you have bashdb installed where bash expects it? Is DEBUGGER_START_FILE defined in pathnames.h? Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/
restart debug in Bashdb with Emacs
Hi, I am using Bashdb in Emacs. Everytime when I reach "Debugger finished" at the end of the debugging, do I have to restart all over again from typing "M-x bashdb" if I'd like to debug again? Is it possible to save the typing? Thanks! -- View this message in context: http://www.nabble.com/restart-debug-in-Bashdb-with-Emacs-tp7498p7498.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
bashdb question
Hi, I am beginning to use bashdb to debug my shell script. There is one problems here. With "bash --debugger ./myscript.sh" it will run to finish without stop, while with "bashdb ./myscript.sh" would stop at the beginning. How could I stop in the first usage? Thanks a lot! -- View this message in context: http://www.nabble.com/bashdb-question-tp6555p6555.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
Re: bash stuck in a loop defining arrays
Pierre Gaston wrote: > sorry if this mail arrives twice, but the first mail didn't seem to > made it through. > > Configuration Information [Automatically generated, do not change]: > Machine: i386 > OS: openbsd4.4 > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' > -DCONF_OSTYPE='openbsd4.4' -DCONF_MACHTYPE='i386-unknown-openbsd4.4' > -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' > -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib > -I/usr/local/include -g -O2 > uname output: OpenBSD obsd1 4.4 GENERIC#1021 i386 > Machine Type: i386-unknown-openbsd4.4 > > Bash Version: 4.0 > Patch Level: 0 > > Description: > playing with the associative arrays, bash ends up in what appears > to be a busy loop that I cannot interupt with C-c > > Repeat-By: > > > bash-4.0$ declare -A array > bash-4.0$ declare array["foo[bar"]=bleh > bash-4.0$ array["foo"]=bleh I've attached a patch that fixes both problems. It supersedes what I previously posted, and should be applied to a vanilla bash-4.0 copy of builtins/declare.def. It should be the same as the official patch, when I release the first batch. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/ *** ../bash-4.0/builtins/declare.def2009-01-04 14:32:22.0 -0500 --- builtins/declare.def2009-02-26 11:40:16.0 -0500 *** *** 296,299 --- 296,306 if (t = strchr (name, '[')) /* ] */ { + /* If offset != 0 we have already validated any array reference */ + if (offset == 0 && valid_array_reference (name) == 0) + { + sh_invalidid (name); + assign_error++; + NEXT_VARIABLE (); + } subscript_start = t; *t = '\0'; *** *** 485,489 /* declare -a name[[n]] or declare name[n] makes name an indexed array variable. */ ! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0) var = convert_var_to_array (var); #endif /* ARRAY_VARS */ --- 492,496 /* declare -a name[[n]] or declare name[n] makes name an indexed array variable. */ ! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0 && assoc_p (var) == 0) var = convert_var_to_array (var); #endif /* ARRAY_VARS */
[PATCH] readline support for FreeBSD-7 and Gentoo/FreeBSD
Hi, FreeBSD 7+ does not have /usr/bin/objformat anymore. The problem is that support/shobj-conf and shlib-install uses it to determine if FreeBSD supports ELF or NOT. Given that FreeBSD 7+ ALWAYS has ELF libraries, that check is useless and dangerous (we have no SONAME in library). I attach a patch to fix that problem and also to support Gentoo/FreeBSD (We use the linux library naming schema). -- Timothy `Drizzt` Redaelli FreeSBIE Developer, Gentoo Developer, GUFI Staff There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. -- Jeremy S. Anderson -- Timothy `Drizzt` Redaelli FreeSBIE Developer, Gentoo Developer, GUFI Staff There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. -- Jeremy S. Anderson diff -ur readline-6.0.orig/shlib/Makefile.in readline-6.0/shlib/Makefile.in --- readline-6.0.orig/shlib/Makefile.in 2009-01-06 18:03:22 +0100 +++ readline-6.0/shlib/Makefile.in 2009-02-26 18:48:15 +0100 @@ -50,6 +50,7 @@ SHELL = @MAKE_SHELL@ host_os = @host_os@ +host_vendor = @host_vendor@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -182,13 +183,13 @@ -$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir) install: installdirs $(SHLIB_STATUS) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) @echo install: you may need to run ldconfig uninstall: - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY) - $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY) + $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -V $(host_vendor) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE) @echo uninstall: you may need to run ldconfig clean mostlyclean: force diff -ur readline-6.0.orig/support/shlib-install readline-6.0/support/shlib-install --- readline-6.0.orig/support/shlib-install 2008-07-20 01:16:05 +0200 +++ readline-6.0/support/shlib-install 2009-02-26 18:40:41 +0100 @@ -3,7 +3,7 @@ # shlib-install - install a shared library and do any necessary host-specific # post-installation configuration (like ldconfig) # -# usage: shlib-install [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library +# usage: shlib-install [-D] -O host_os -V host_vendor -d installation-dir [-b bin-dir] -i install-prog [-U] library # # Chet Ramey # c...@po.cwru.edu @@ -15,13 +15,14 @@ LDCONFIG=ldconfig PROGNAME=`basename $0` -USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library" +USAGE="$PROGNAME [-D] -O host_os -V host_vendor -d installation-dir [-b bin-dir] -i install-prog [-U] library" # process options while [ $# -gt 0 ]; do case "$1" in -O) shift; host_os="$1"; shift ;; + -V) shift; host_vendor="$1"; shift ;; -d) shift; INSTALLDIR="$1"; shift ;; -b) shift; BINDIR="$1" ; shift ;; -i) shift; INSTALLPROG="$1" ; shift ;; @@ -115,8 +116,8 @@ # # Create symlinks to the installed library. This section is incomplete. # -case "$host_os" in -*linux*) +case "$host_os-$host_vendor" in +*linux*|freebsd*-gentoo) # libname.so.M -> libname.so.M.N ${echo} ${RM} ${INSTALLDIR}/$LINK2 if [ -z "$uninstall" ]; then @@ -130,7 +131,7 @@ fi ;; -bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|netbsd*) +bsdi4*|*gnu*|darwin*|macosx*|netbsd*) # libname.so.M -> libname.so.M.N ${echo} ${RM} ${INSTALLDIR}/$LINK2 if [ -z "$uninstall" ]; then @@ -153,8 +154,8 @@ ;; -# FreeBSD 3.x and above can have either a.out or ELF shared libraries -freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*) +# FreeBSD 3.x to 6.x can have either a.out or ELF shared libraries +freebsd[3-6]*|freebsdelf[3-6]*|freebsdaout[3-9]*) if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then # libname.so -> libname.so.M ${echo} ${RM} ${INSTALLDIR}/$LINK1 @@ -176,6 +177,15 @@ fi ;; +# FreeBSD 7.x and above has only ELF shared libraries +freebsd[7-9]*|freebsdelf[7-9]*) + # libname.so -> libname.so.M + ${echo} ${RM} ${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi + ;; + hpux1*) # libname.sl -> libname.M ${echo} ${RM} ${INSTALLDIR}/$LINK1
bash-4.0 regression with here documents and multiline subshells
the documentation shows that for <<< here documents, the word must be right after the operator (although it doesnt really spell it out). not sure if that should be made explicit and to have bash reject it, or to fix up this issue so it works again ... at any rate, this style usage, while seemingly not allowed by the docs, works fine with older/current bash: echo $(cat <<< "foo") however, when we go multiline, bash-4.0 gets into a parsing loop: $ cat test.sh #!/bin/bash echo $( cat <<< "foo" ) $ ./test.sh ./test.sh: line 2: unexpected EOF while looking for matching `)' ./test.sh: line 5: syntax error: unexpected end of file if we go ahead and remove that whitespace after the <<<, then it works fine: $ cat test.sh #!/bin/bash echo $( cat <<<"foo" ) $ ./test.sh foo the trouble is that when people write code, they often try to inject whitespace to make it readable. that means using a space between the <<< operator and the string they feed it is common from what i can see. -mike
Re: Problem with function cd in bash 4.0
Chet Ramey wrote: > > Interesting. This happens only on Linux. FreeBSD, MacOS X, and Solaris > all interrupt and return to $PS1. > > Chet > Actually, this was happening for me on Solaris too, so looks like not just a Linux thing. But your patch fixed the issue on Solaris as well. Richard -- View this message in context: http://www.nabble.com/Problem-with-function-cd-in-bash-4.0-tp22171999p0451.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
Re: large exit values (>255)
On Thursday 26 February 2009 03:25:50 Sven Mascheck wrote: > On Wed, Feb 25, 2009 at 01:20:50PM -0500, Mike Frysinger wrote: > > seems there's a way to get bash to report exit values greater than 255 > > ... > > you will find the special error values > in shell.h, for instance > #define EX_SHERRBASE256 /* all special error values are > this. > */ #define EX_BADSYNTAX257 /* shell syntax error */ > #define EX_USAGE258 /* syntax error in usage */ > #define EX_REDIRFAIL259 /* redirection failed */ > #define EX_BADASSIGN260 /* variable assignment error */ > #define EX_EXPFAIL 261 /* word expansion failed */ those dont appear to be documented anywhere ... my bash(1) page mentions standard 0..127 and 128+n (where n is the signal #). > > $ echo ' > > > > $ echo $? > > 386 > > but you haven't mentioned your version. > (I don't see that with bash-3.2.48/4.0.0 on linux 2.6.23/libc2.3.6) i havent, but Chet would have guessed bash-4 since ive e-mailed so many times over the last few days about regressions in it ... -mike
Re: large exit values (>255)
On Wed, Feb 25, 2009 at 01:20:50PM -0500, Mike Frysinger wrote: > seems there's a way to get bash to report exit values greater than 255 ... you will find the special error values in shell.h, for instance #define EX_SHERRBASE256 /* all special error values are > this. */ #define EX_BADSYNTAX257 /* shell syntax error */ #define EX_USAGE258 /* syntax error in usage */ #define EX_REDIRFAIL259 /* redirection failed */ #define EX_BADASSIGN260 /* variable assignment error */ #define EX_EXPFAIL 261 /* word expansion failed */ > $ echo ' > > $ echo $? > 386 but you haven't mentioned your version. (I don't see that with bash-3.2.48/4.0.0 on linux 2.6.23/libc2.3.6)