Re: Bash style of if-then-else?

2010-08-23 Thread Chris F.A. Johnson
On Mon, 23 Aug 2010, Dennis Williamson wrote: If you're writing a Bash-specific script then it's preferable to use double square brackets (see http://mywiki.wooledge.org/BashFAQ/031). if [[ -f $file ]] then do something fi I'd avoid non-portable syntax unless it offers a significant

edit-and-execute-command; minus the "execute" part?

2010-08-23 Thread Dabrien 'Dabe' Murphy
Is it possible to "C-xC-e" /without/ immediately executing the resulting command? To my mind, "editing" the buffer and "executing" it are two different things -- the latter having potentially dire consequences... I'd prefer it if, after exiting my $EDITOR, bash simply stuffed the results bac

login shell crash on Mac OS X while closing file descriptors

2010-08-23 Thread Rainer Müller
Hi, I am the maintainer of bash in MacPorts, a package management system for Mac OS X. I am currently debugging crashes with bash 4.1.7 when being run as a login shell under certain conditions. The original report was here: http://trac.macports.org/ticket/25693 Configuration Information [Automat

login shell crash on Mac OS X while closing file descriptors

2010-08-23 Thread Rainer Müller
Hi, I am the maintainer of bash in MacPorts, a package management system for Mac OS X. I am currently debugging crashes with bash 4.1.7 when being run as a login shell under certain conditions. The original report was here: http://trac.macports.org/ticket/25693 Configuration Information [Automat

Re: Bash style of if-then-else?

2010-08-23 Thread Dennis Williamson
If you're writing a Bash-specific script then it's preferable to use double square brackets (see http://mywiki.wooledge.org/BashFAQ/031). if [[ -f $file ]] then do something fi I prefer forms using the fewest number of semicolons, but I really don't think it matters. Consistency is more impor

Re: Bash style of if-then-else?

2010-08-23 Thread Eric Blake
On 08/23/2010 03:29 PM, Peng Yu wrote: Hi, I'm wondering if there is a widely accepted coding style of bash scripts. lug.fh-swf.de/vim/vim-bash/StyleGuideShell.en.pdf I've seen the following style. Which is one is more widely accepted? if [ -f $file]; then do something fi if [ -f $file];

Bash style of if-then-else?

2010-08-23 Thread Peng Yu
Hi, I'm wondering if there is a widely accepted coding style of bash scripts. lug.fh-swf.de/vim/vim-bash/StyleGuideShell.en.pdf I've seen the following style. Which is one is more widely accepted? if [ -f $file]; then do something fi if [ -f $file]; then do something fi -- Regards, Pen