Zachary Santer <zsan...@gmail.com> writes: > When messing around in interactive mode to test things I may want to do in > a script, it's nice if it actually behaves the same. There are probably > some other set and possibly shopt things I should have somewhere if that's > what I want.
I checked, and it doesn't seem that there's an explicit way to start bash noninteractively, but running "cat | bash" seems to work. Of course, it's noninteractive, so you get e.g. empty prompt strings! My understanding is that "interactive" directly affects only two things, the startup file(s) read and the initial values of various shell options. You can fix the startup files with explicit options on invocation, and you can fix the shell options that matter to you with commands. Dale