Re: logical XOR

2007-06-29 Thread Chet Ramey
Robert Millan [ackstorm] wrote: >>> There's bitwise AND and bitwise OR, and logical AND and logical OR, but >>> for XOR there's only the bitwise version. Would be nice if the logical >>> XOR would also be present (^^). >> (!a) != (!b) >> >> should work acceptably for the situations su

Re: Evaluate expression every time directory changes

2007-06-29 Thread Bob Proulx
bash_user wrote: > That is correct. > I would like to understand what triggers the shell to re-evaluate > PROMPT_COMMAND every time > directory / clock change occur. The documentation for bash says: PROMPT_COMMAND If set, the value is executed as a command prior to issuin

Re: Evaluate expression every time directory changes

2007-06-29 Thread bash_user
That is correct. I would like to understand what triggers the shell to re-evaluate PROMPT_COMMAND every time directory / clock change occur. THANKS FOR REPLY! Dave Rutherford-2 wrote: > > On 6/28/07, bash_user <[EMAIL PROTECTED]> wrote: >> Lets say I would like to update environment vari

Re: Evaluate expression every time directory changes

2007-06-29 Thread Dave Rutherford
On 6/28/07, bash_user <[EMAIL PROTECTED]> wrote: Lets say I would like to update environment variable based on ${PWD} should I clobber my prompt generation routine or there is a better way. Something like this? PROMPT_COMMAND='eval NEWPWD="\$PWD"' Dave __

Evaluate expression every time directory changes

2007-06-29 Thread bash_user
Hello, Lets say I would like to update environment variable based on ${PWD} should I clobber my prompt generation routine or there is a better way. THANKS! Nashi -- View this message in context: http://www.nabble.com/Evaluate-expression-every-time-directory-changes-tf3996206.html#a11349158

Re: logical XOR

2007-06-29 Thread Stephane Chazelas
On Fri, Jun 29, 2007 at 12:08:22PM +0200, Robert Millan [ackstorm] wrote: > On Fri, Jun 29, 2007 at 10:16:18AM +0100, Stephane Chazelas wrote: > > > > Do you mean that for instance, you'd like a third command to be > > executed if either but not both of two commands succeed? > > > > cmd1; a=$? >

Re: bash: no job control in this shell

2007-06-29 Thread JimK
Bob Proulx wrote: > > >>Does this java applet set up a master-slave pty for bash's input and >>output? This is what the 'expect' program and similar usually do. > > Yep, I drop down into C to use openpty() to set up the master/slave and > pass the > file IDs back up into java.I Use input/out

Re: logical XOR

2007-06-29 Thread Andreas Schwab
"Robert Millan [ackstorm]" <[EMAIL PROTECTED]> writes: > I'm not sure what you mean. The following: > > (true && ! false) || (false && ! true) > echo $? > > works, whereas the following: > > (! true) != (! false) > echo $? > > shows syntax error. true and false are not nu

Re: logical XOR

2007-06-29 Thread Robert Millan [ackstorm]
On Fri, Jun 29, 2007 at 10:16:18AM +0100, Stephane Chazelas wrote: > > Do you mean that for instance, you'd like a third command to be > executed if either but not both of two commands succeed? > > cmd1; a=$? > cmd2; b=$? > (( !a != !b )) && cmd3 > > should do. Thank you, that works. Although

Re: logical XOR

2007-06-29 Thread Stephane Chazelas
On Fri, Jun 29, 2007 at 10:21:01AM +0200, Robert Millan [ackstorm] wrote: [...] > > > There's bitwise AND and bitwise OR, and logical AND and logical OR, but > > > for XOR there's only the bitwise version. Would be nice if the logical > > > XOR would also be present (^^). > > > > (!a) != (!

Re: logical XOR

2007-06-29 Thread Robert Millan [ackstorm]
On Thu, Jun 28, 2007 at 06:58:25PM -0400, Chet Ramey wrote: > ackstorm wrote: > > Configuration Information [Automatically generated, do not change]: > > Machine: i486 > > OS: linux-gnu > > Compiler: gcc > > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > > -DCONF_OSTYPE='linux-gnu'