On Thu, Mar 22, 2012 at 12:06:24PM +, Tim Dickson wrote:
> 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
No, a script is by definition a non-interactive shell.
> *ec
On Thu, Mar 22, 2012 at 2:06 PM, Tim Dickson wrote:
> 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.
It's not
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