Re: check_dev_tty - What does it do?
On Fri, Jun 23, 2006 at 02:54:04PM +1200, John Carter wrote: > > Here is the bash-3.1 code from general.c for check_dev_tty. > > It is invoked shortly after main... > > void > check_dev_tty () > { > int tty_fd; > char *tty; > > tty_fd = open ("/dev/tty", O_RDWR|O_NONBLOCK); > > if (tty_fd < 0) > { > tty = (char *)ttyname (fileno (stdin)); > if (tty == 0) > return; > tty_fd = open (tty, O_RDWR|O_NONBLOCK); > } > close (tty_fd); > } > > It seems to open and close /dev/tty and return nothing. > > This seems very strange to me. > > Why is it doing this? [...] A rough guess: It may be that, if bash is the session leader and no session is attached to the terminal open on stdin, the open would attach the terminal to the session. Bash would become the controlling process. I guess it might happen when you boot Linux with init=/bin/bash for instance. It may not be the reason for it, though. And I'm not sure it is right for bash to do so. -- Stephane ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
cannot rebind Control-u
Configuration Information [Automatically generated, do not change]: Machine: i586 OS: linux Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i586-suse-linux' -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g -fbranch-probabilities uname output: Linux gaston 2.6.16.13-4 #1 SMP Thu Jun 22 17:44:56 CEST 2006 i686 i686 i386 GNU/Linux Machine Type: i586-suse-linux Bash Version: 3.1 Patch Level: 17 Release Status: release Description: In my $HOME/.inputrc I have the line Control-u: undo This used to work well with earlier versions of bash, but now, the C-u key cannot be removed from the function unix-line-discard. Repeat-By: bind Control-i:undo bind -P | grep undo ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Segmentation fault on AIX 5.1
Configuration Information [Automatically generated, do not change]: Machine: powerpc OS: aix4.3.2.0 Compiler: cc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' -DCONF_OSTYPE='aix4.3.2.0' -DCONF_MACHTYPE='powerpc-ibm-aix4.3.2.0' -DCONF_VENDOR='ibm' -DSHELL -DHAVE_CONFIG_H -I/usr/local/include -I. -I. -I./include -I./lib -I/usr/local/include -O -qmaxmem=8192 uname output: AIX aix 1 5 000641284C00 Machine Type: powerpc-ibm-aix4.3.2.0 Bash Version: 2.04 Patch Level: 0 Release Status: release Description: hi, I try to build bash... it build without any problem but the exe dies with segmentation fault. Any help would be appreciated... Repeat-By: start build exe Fix: I do not have a fix so far :( Best regards, Zoltan Arpadffy ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Re: Segmentation fault on AIX 5.1
Z the root wrote: > Configuration Information [Automatically generated, do not change]: > Machine: powerpc > OS: aix4.3.2.0 > Compiler: cc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' > -DCONF_OSTYPE='aix4.3.2.0' -DCONF_MACHTYPE='powerpc-ibm-aix4.3.2.0' > -DCONF_VENDOR='ibm' -DSHELL -DHAVE_CONFIG_H -I/usr/local/include -I. -I. > -I./include -I./lib -I/usr/local/include -O -qmaxmem=8192 > uname output: AIX aix 1 5 000641284C00 > Machine Type: powerpc-ibm-aix4.3.2.0 > > Bash Version: 2.04 > Patch Level: 0 > Release Status: release Please try building the latest version of bash, which is 3.1.17. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/ ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Re: cannot rebind Control-u
[EMAIL PROTECTED] wrote: > Bash Version: 3.1 > Patch Level: 17 > Release Status: release > > Description: > In my $HOME/.inputrc I have the line > Control-u: undo > This used to work well with earlier versions of bash, but now, > the C-u key cannot be removed from the function unix-line-discard. Readline binds the tty special characters to their readline equivalents by default. You can turn this off with the `bind-tty-special-chars' readline variable. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/ ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
process redirection: syntax error after while loop
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: cygwin Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS -I. -I/tmp/bash-3.1 -I/tmp/bash-3.1/include -I/tmp/bash-3.1/lib -O2 uname output: CYGWIN_NT-5.1 tom 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin Machine Type: i686-pc-cygwin Bash Version: 3.1 Patch Level: 17 Release Status: release Description: All these work fine: cat <~/.bash_history cat <(cat ~/.bash_history) while read f; do echo $f; done <~/.bash_history But, this fails: while read f; do echo $f; done <(cat ~/.bash_history) bash: syntax error near unexpected token `<(cat ~/.bash_history) This is important when the operations in the loop need to affect the current shell environment (as contrasted with a | pipe) Also duplicated error on linux bash 3.00.16(1)-release (i386-redhat-linux-gnu) Repeat-By: See description. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Re: process redirection: syntax error after while loop
Marvin Greenberg wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i686 > OS: cygwin > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' > -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' > -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H > -DRECYCLES_PIDS -I. -I/tmp/bash-3.1 -I/tmp/bash-3.1/include > -I/tmp/bash-3.1/lib -O2 > uname output: CYGWIN_NT-5.1 tom 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin > Machine Type: i686-pc-cygwin > > Bash Version: 3.1 > Patch Level: 17 > Release Status: release > > Description: > All these work fine: > cat <~/.bash_history > cat <(cat ~/.bash_history) > while read f; do echo $f; done <~/.bash_history > > But, this fails: >while read f; do echo $f; done <(cat ~/.bash_history) >bash: syntax error near unexpected token `<(cat ~/.bash_history) That's not a redirection; it's process substitution. Process substitution is a shell expansion that results in a filename. Once you realize this, you should understand why it fails and how you can make it work. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/ ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash