[bug] Bash translates >&$var into &>$var for exported functions.

2012-01-22 Thread Dan Douglas
Hello, In the case of exported functions, Bash interprets a copy descriptor followed by an expansion as the >& synonym for &>, resulting in the output going to a file named as the value of the FD it's given. This only applies to ">&$var" and not "<&$var". I've tested various quoting, Is there s

Re: Cross compile crapout

2012-01-22 Thread Jonathan Andrews
On Sat, 2012-01-21 at 19:45 -0500, Chet Ramey wrote: > On 1/21/12 11:13 AM, Jonathan Andrews wrote: > > > I found the fix here, but it would be nice if it could work its way into > > the source for the next release. > > > > http://lists.gnu.org/archive/html/bug-bash/2011-09/msg00039.html > > T

Re: Bash readline remap ESC insert/command mode key

2012-01-22 Thread Chet Ramey
On 1/22/12 7:35 AM, Roger wrote: >> On Sat, Jan 21, 2012 at 09:17:32PM -0500, Chet Ramey wrote: >> >> I could look at putting in some sort of inter-character timeout, but I >> don't know yet how well the code structure lends itself to that. Pretty easily, as it turns out. The attached patch adds

Re: test if shell is interactive

2012-01-22 Thread Bob Proulx
tapczan wrote: > Bob Proulx wrote: > > Shell scripts are not interactive. So what you are seeing above is > > correct. > > So, is there any way to test if script (a.sh) was invoked from interactive > session (human) or not (e.g. from cron)? I usually check if the standard input file descriptor i

Re: test if shell is interactive

2012-01-22 Thread Chris F.A. Johnson
On Sun, 22 Jan 2012, tapczan wrote: Bob Proulx wrote: Shell scripts are not interactive. So what you are seeing above is correct. So, is there any way to test if script (a.sh) was invoked from interactive session (human) or not (e.g. from cron)? Test whether it is attached to a tty: if

Re: test if shell is interactive

2012-01-22 Thread tapczan
Bob Proulx wrote: > > Shell scripts are not interactive. So what you are seeing above is > correct. > So, is there any way to test if script (a.sh) was invoked from interactive session (human) or not (e.g. from cron)? -- View this message in context: http://old.nabble.com/test-if-shell-is-

Re: test if shell is interactive

2012-01-22 Thread Bob Proulx
tapczan wrote: > #!/bin/bash > echo $- > > Execution: > > # ./a.sh > hB > > There is no 'i' so the session is non-interactive? > It was invoked from interactive. > Am I missing something? Shell scripts are not interactive. So what you are seeing above is correct. Bob

Re: test if shell is interactive

2012-01-22 Thread tapczan
DJ Mills wrote: > > This is the correct way to test. What makes you say it's not working for > you? > Variable $- value: # echo $- himBH character 'i' meens is interactive, ok. I have script a.sh: #!/bin/bash echo $- Execution: # ./a.sh hB There is no 'i' so the session is non-interactiv

Re: test if shell is interactive

2012-01-22 Thread DJ Mills
On Sun, Jan 22, 2012 at 9:39 AM, tapczan wrote: > 1. > case "$-" in >    *i*)    echo This shell is interactive ;; >    *)    echo This shell is not interactive ;; > esac > This is the correct way to test. What makes you say it's not working for you?

test if shell is interactive

2012-01-22 Thread tapczan
Simple script a.sh: #!/bin/bash echo "PS1: $PS1" Variable $PS1 is present: # echo $PS1 \[\033[01;32m\]$USER@\h \[\033[00m\]\A \[\033[01;34m\]\w\[\033[00m\]\$ Variable $PS1 is environment: # env | grep PS1 PS1=\[\033[01;32m\]$USER@\h \[\033[00m\]\A \[\033[01;34m\]\w\[\033[00m\]\$ Executing scri

Re: Bash readline remap ESC insert/command mode key

2012-01-22 Thread Roger
> On Sat, Jan 21, 2012 at 09:17:32PM -0500, Chet Ramey wrote: > >I could look at putting in some sort of inter-character timeout, but I >don't know yet how well the code structure lends itself to that. Ditto. VIM times-out after a (less then) 1 second pause after nothing else is typed. Readline