Question about testing with variable operators

2011-06-10 Thread Steven W. Orr
I am using arithmetic tests where the test operator is passed in as an arg and it works just fine. foo() { (( $1 $2 $3 )) } foo 5 '>' 7 But I figured that if this works for arithmetic, it should also work with the test operator. It seems to not work: 514 > bar() > { > [[ $1 $2 ]] ba

Re: pushd, popd and dirs of different bash processes communicate by an external file

2011-06-10 Thread Steven W. Orr
On 6/9/2011 11:42 PM, Peng Yu wrote: Hi, I'm wondering if there is a way that different bash processes share the same stack. One way of doing so is to use a file to save the stack. It is not difficult to implement this function myself, but I'm just wondering if there is any simpler solution or a

Re: Question about testing with variable operators

2011-06-10 Thread Andreas Schwab
"Steven W. Orr" writes: > As a work around, I can use eval or the builtin test, but my question is > this: Is this a bug or is there a reason that it should work for > arithmetic but not for the test [[ operator? [[ is a reserved word like if, which triggers special parsing rules, so you cannot

Re: Question about testing with variable operators

2011-06-10 Thread Jan Schampera
Andreas Schwab wrote: "Steven W. Orr" writes: As a work around, I can use eval or the builtin test, but my question is this: Is this a bug or is there a reason that it should work for arithmetic but not for the test [[ operator? [[ is a reserved word like if, which triggers special parsing r