Re: setting a variable from a function called from PS1

2010-08-25 Thread Greg Wooledge
On Wed, Aug 25, 2010 at 11:20:28AM -0500, E R wrote: I've been trying to get a function called from PS1 to set a variable, e.g.: num=1 function xyz { ((num++)) date; echo num: $num } PS1=\$(xyz): The problem here is that the command substitution (the $(...) bit) creates a

Re: setting a variable from a function called from PS1

2010-08-25 Thread Dennis Williamson
PROMPT_COMMAND doesn't create a subshell. xyz () { ((num++)); date; echo -n num: $num; } PROMPT_COMMAND='xyz' PS1=' ' On Wed, Aug 25, 2010 at 11:20 AM, E R pc88m...@gmail.com wrote: I've been trying to get a function called from PS1 to set a variable, e.g.: num=1 function xyz {  ((num++))

Re: login shell crash on Mac OS X while closing file descriptors

2010-08-25 Thread Rainer Müller
On 2010-08-24 15:59 , Chet Ramey wrote: Well, if they cause bash to crash, I suppose removing that code (or removing the #define) is a good place to start. That code has been there for a very long time. Maybe if you changed it to turn on the FD_CLOEXEC bit instead of closing the fd we could