Bash version 4.1.7(2)
Slackware 13.1.0 (32bit) (2.6.33.4-smp kernel, i686 AMD Athlon II X2 250
processor)
$- does not work as documented
example, from a bash shell
*echo e"$-"*
output is *ehimBH*
put echo "$-" in a oneline bash script called test and make executable
*./test*
output is *ehB*
this should include the "i" in the output as the shell _is_ interactive
*echo hi|./test *
output is *e*
this is as expected input is not from a tty
either the functionality of bash is not correct or the meaning of
interactive is not clear.
eg a script called test2 as follows
#!/bin/bash
echo "type in your name"
read USERNAME
echo "hello $USERNAME"
called via the shell by typing
./test2
is interactive, but $- special variable doe not indicate it is.
regards, Tim