The bash executable built from bash-2.05b-r5 seems to be unable to accept arguments that are passed to shell scripts. Have a look at bugs 20271, 20316 and 20317 for the effects of this. Reproducible: Always Steps to Reproduce: 1. 2. 3.
maybe a dupe of bug #20095
Having the same problem; downgrading to bash-2.05b-r3 did not resolve the issue, nor do I see anything in any of the other referenced bugs that solves it. #!/bin/sh for blah do echo "$blah" done This does not pick up any command-line arguments on my system. Unsure if it's a problem with bash or readline (cannot successfully emerge readline now), but whatever it is, it broke in the last week or so and has rendered my system all but useless.
For whatever it may be worth, the problem appears to be yacc/bison (bison for me). Removing the parse.y patch from the bash-2.05b-gentoo.diff 'fixes' the problem, but since that's silly I rebuilt bison and that also corrected the problem. Only thing I can think of would be a really weird problem caused by one of the gcc/glibc updates and my use of the -march-pentium4 CFLAG. (Works fine with that flag now, though.) Hope that helps.
I wonder if byacc might not be a better replacement for bison? Azarah?
-r7 went stable which include several patches some of which might address some of these problems.
Using bash-2.05b-r7 and not sure whether I'm being a dumbass... If the following is run like ./foo bar #!/bin/bash echo $1 exit the output is: bar But if the script is: #!/bin/sh for blah do echo "$blah" done and is run with blah="bar" ./foo or even export blah="bar" ; ./foo no output is printed. If run with ./foo bar bob the output is: bar bob
Andrew, that is the expected output. Were you expecting something else? for arg; do echo "$arg"; done will print all the positional parameters. If there are no positional parameters, as in your second and third examples, nothing will be printed, regardless of the original value of arg.
closing as this seems to be a non-issue now