Thread View: gnu.bash.bug
3 messages
3 total messages
Started by Bennett Todd
Mon, 17 Jul 1989 19:38
Bash 1.01 IFS doesn't seem to...
Author: Bennett Todd
Date: Mon, 17 Jul 1989 19:38
Date: Mon, 17 Jul 1989 19:38
49 lines
2394 bytes
2394 bytes
I haven't gotten around to putting in 1.02; if this is already fixed please accept my apologies for cluttering the list. I am running Bash 1.01 under SunOS 3.5. Here's what I am complaining about: Script started on Mon Jul 17 15:27:14 1989 bent[1] IFS=: bent[2] while read login passwd uid gid gcos home shell;do > echo -n $gcos > done </etc/passwd script done on Mon Jul 17 15:27:57 1989 Hmmm -- not only did it not print out anything (i.e. IFS didn't work, which was my complaint) the child invocation of Bash within the script exited when EOF was hit on the loop's redirected input, instead of switching back to interactive. That reminds me of another flake I've seen (but haven't been able to reproduce suitably for a separate bug report); on one occasion I set up an intricate loop reading from a file; then discovered a bug during the first iteration of the loop. So, I ^C-ed the loop. Bash then proceeded to attempt to read the remainder of the data file attempting to execute each line as a command, and finally exited when it hit the end of the loop's data file. By contrast, here's another script: Script started on Mon Jul 17 15:35:05 1989 bent[1] sh bent[\#] IFS=: bent[\#] while read login passwd uid gid gcos home shell;do > echo -n $gcos > done </etc/passwd Operator [...list of GCOS fields omitted...]bent[\#] exit bent[2] script done on Mon Jul 17 15:36:02 1989 /bin/sh parsed /etc/passwd using IFS... and didn't exit when the loop reached EOF. Also, while typing this in I stumbled across a *really* minor annoyance; routinely, when entering interactive loops, I attempt to indent the loop bodies (which provides me the same readability advantages it offers in more conventional programming contexts). Bash hangs on the command line when ^I is the first character entered, until I hit ^C. Would it be too much work to disable the completion function of ^I when ^I is the first character entered on a line? -Bennett bet@orion.mc.duke.edu
Bash 1.01 IFS doesn't seem to...
Author: Jeff Kellem
Date: Mon, 17 Jul 1989 22:23
Date: Mon, 17 Jul 1989 22:23
21 lines
1413 bytes
1413 bytes
| Date: Mon, 17 Jul 89 15:38:20 EDT
| From: bet@orion.mc.duke.edu (Bennett Todd)
|
| Also, while typing this in I stumbled across a *really* minor annoyance;
| routinely, when entering interactive loops, I attempt to indent the loop
| bodies (which provides me the same readability advantages it offers in
| more conventional programming contexts). Bash hangs on the command line
| when ^I is the first character entered, until I hit ^C. Would it be too
| much work to disable the completion function of ^I when ^I is the first
| character entered on a line?
Well, all you really need to do is use whatever key sequence is bound to
the function 'tab-insert'. By default, this is Meta-I (or ESC-I). You
can always change it to some other key sequence by editing your ~/.inputrc
file. Enjoy...
-jeff
Jeff Kellem
INTERNET: composer@bu-cs.bu.edu (or composer%bu-cs.bu.edu@bu-it.bu.edu)
UUCP: ...!harvard!bu-cs!composer
Re: Bash 1.01 IFS doesn't seem to...
Author: Chet Ramey
Date: Wed, 19 Jul 1989 18:00
Date: Wed, 19 Jul 1989 18:00
29 lines
1472 bytes
1472 bytes
Bennett Todd writes:
?bent[1] IFS=:
?bent[2] while read login passwd uid gid gcos home shell;do
?> echo -n $gcos
?> done </etc/passwd
?Hmmm -- not only did it not print out anything (i.e. IFS didn't work,
?which was my complaint)
This is a simple typo (or an incomplete change). In builtins.c:read_builtin,
the list_string call should read
words = list_string (input_string, ifs_chars, 0);
For some reason, " \t\n" was hard-coded in there, though the value of $IFS
is assigned to ifs_chars.
?the child invocation of Bash within the script
?exited when EOF was hit on the loop's redirected input, instead of
?switching back to interactive.
I couldn't reproduce this under SunOS 3.5, bash 1.02, gcc-1.35.
Chet Ramey
Chet Ramey "We are preparing to think about contemplating
Network Services Group, CWRU preliminary work on plans to develop a
chet@cwjcc.INS.CWRU.Edu schedule for producing the 10th Edition of
the Unix Programmers Manual." -- Andrew Hume
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads