[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
interactive test faulty
From: |
Tim Dickson |
Subject: |
interactive test faulty |
Date: |
Thu, 22 Mar 2012 12:06:24 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0 |
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
- interactive test faulty,
Tim Dickson <=