Re: IFS/read dash bug (was Re: Problems with the new base-files-4.0-5?)

2011-03-21 Thread Eric Blake
On 03/20/2011 08:54 AM, Cyrille Lefevre wrote: > fixed in git depot as of : > > 2010-05-27 Herbert Xu[VAR] Do not poplocalvars prematurely on > regular utilitie > http://git.kernel.org/?p=utils/dash/dash.git;a=snapshot;h=1d806ac1fbafb867f6252e184e1be05c0829ab71;sf=tgz > how about to updat

Re: IFS/read dash bug (was Re: Problems with the new base-files-4.0-5?)

2011-03-20 Thread Cyrille Lefevre
Le 19/03/2011 23:34, Cyrille Lefevre a écrit : Le 18/03/2011 14:46, David Sastre a écrit : [ -e "${p}" ]&& IFS=',' read -r PRINTER dummy< "${p}" Works in bash, posh, mksh and zsh, but fails (at least for me) in dash. regarding SUSv3, read is not a special builtin, so, should work under e

IFS/read dash bug (was Re: Problems with the new base-files-4.0-5?)

2011-03-19 Thread Cyrille Lefevre
Le 18/03/2011 14:46, David Sastre a écrit : [ -e "${p}" ]&& IFS=',' read -r PRINTER dummy< "${p}" Works in bash, posh, mksh and zsh, but fails (at least for me) in dash. regarding SUSv3, read is not a special builtin, so, should work under every shell, if that fails under dash, it should

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread David Sastre
On Fri, Mar 18, 2011 at 04:41:49PM +, Andy Koppe wrote: > On 18 March 2011 16:23, David Sastre wrote: > > On Fri, Mar 18, 2011 at 02:17:14PM +, Andy Koppe wrote: > >> On 18 March 2011 13:46, David Sastre wrote: > >> > All [[, have been changed to a portable [ test. > >> > I've changed `test

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread Andy Koppe
On 18 March 2011 16:23, David Sastre wrote: > On Fri, Mar 18, 2011 at 02:17:14PM +, Andy Koppe wrote: >> On 18 March 2011 13:46, David Sastre wrote: >> > All [[, have been changed to a portable [ test. >> > I've changed `test -a' for a portable `test -e', and the -a operator >> > in the user's

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread David Sastre
On Fri, Mar 18, 2011 at 11:14:09AM -0500, Nellis, Kenneth wrote: > While you're at it, it would probably be a good idea to: > $ unset p > when you're done with it. Indeed. Already applied. In fact, there was another one (fDest, used in a loop to copy skel files). Thanks. -- Huella de clave pri

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread David Sastre
On Fri, Mar 18, 2011 at 02:17:14PM +, Andy Koppe wrote: > On 18 March 2011 13:46, David Sastre wrote: > > All [[, have been changed to a portable [ test. > > I've changed `test -a' for a portable `test -e', and the -a operator > > in the user's home ownership test to a chained test: > > > > eli

RE: Problems with the new base-files-4.0-5?

2011-03-18 Thread Nellis, Kenneth
From: David Sastre > On Fri, Mar 18, 2011 at 12:46:26AM +0100, Cyrille Lefevre wrote: > > > > Le 17/03/2011 23:43, Angelo Graziosi a écrit : > > > > >p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows > > >NT/CurrentVersion/Windows/Device' > > > > > >[ -e "${p}" ] && read -r PRINTER < "

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread Andy Koppe
On 18 March 2011 13:46, David Sastre wrote: > All [[, have been changed to a portable [ test. > I've changed `test -a' for a portable `test -e', and the -a operator > in the user's home ownership test to a chained test: > > elif [ ! -O "${HOME}" ] && [ "${HOME#/home/}" != "${HOME}" ]; then ... Eve

Re: Problems with the new base-files-4.0-5?

2011-03-18 Thread David Sastre
On Fri, Mar 18, 2011 at 12:46:26AM +0100, Cyrille Lefevre wrote: > > Le 17/03/2011 23:43, Angelo Graziosi a écrit : > > >p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows > >NT/CurrentVersion/Windows/Device' > > > >[ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} >

RE: Problems with the new base-files-4.0-5?

2011-03-18 Thread Nellis, Kenneth
> From: David Sastre > Please test if > > [ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} > > works as expected. No, it doesn't work, probably due to bash subshell or something, as separating the final assignment from the command line *does* work: $ [ -e "${p}" ] && read -r

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Cyrille Lefevre
Le 17/03/2011 23:43, Angelo Graziosi a écrit : p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' [ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} read -r "$p" returns 1 bcoz "The return code is zero, unless end-of-file is enc

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Christopher Faylor
On Fri, Mar 18, 2011 at 12:07:43AM +0100, David Sastre wrote: >On Thu, Mar 17, 2011 at 11:43:26PM +0100, Angelo Graziosi wrote: >> David Sastre wrote: >> >Please test if >> > >> >[ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} >> >> No, I think. >> >> I get: >> >> $ cat test_

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread David Sastre
On Thu, Mar 17, 2011 at 11:43:26PM +0100, Angelo Graziosi wrote: > David Sastre wrote: > >Please test if > > > >[ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} > > No, I think. > > I get: > > $ cat test_pr.sh > #!/bin/bash > > p='/proc/registry/HKEY_CURRENT_USER/Software/Mic

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Angelo Graziosi
David Sastre wrote: Please test if [ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=${PRINTER%%,*} No, I think. I get: $ cat test_pr.sh #!/bin/bash p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' [ -e "${p}" ] && read -r PRINTER < "${p

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread David Sastre
On Thu, Mar 17, 2011 at 04:10:27PM -0500, Nellis, Kenneth wrote: > > From: Eric Blake > > On 03/17/2011 12:59 PM, Angelo Graziosi wrote: > > > Il 17/03/2011 19.00, Angelo Graziosi ha scritto: > > >> I have just updated Cygwin, and now starting a console (Cygwin.bat > > or > > >> MinTTY) prints: > >

RE: Problems with the new base-files-4.0-5?

2011-03-17 Thread Nellis, Kenneth
> From: Eric Blake > On 03/17/2011 12:59 PM, Angelo Graziosi wrote: > > Il 17/03/2011 19.00, Angelo Graziosi ha scritto: > >> I have just updated Cygwin, and now starting a console (Cygwin.bat > or > >> MinTTY) prints: > >> > >> -bash: ${p}: ambiguous redirect > >> > >> and PRINTER variable isn't s

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Charles Wilson
On 3/17/2011 3:21 PM, Eric Blake wrote: > On 03/17/2011 12:59 PM, Angelo Graziosi wrote: >> Perhaps you need this: >> >> - ([[ -e ${p} ]] && read -r PRINTER < ${p}) && PRINTER=${PRINTER%%,*} >> + ([[ -e ${p} ]] && read -r PRINTER < "${p}") && PRINTER=${PRINTER%%,*} > > /etc/profile is using [[ ]]?

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Eric Blake
On 03/17/2011 12:59 PM, Angelo Graziosi wrote: > Il 17/03/2011 19.00, Angelo Graziosi ha scritto: >> I have just updated Cygwin, and now starting a console (Cygwin.bat or >> MinTTY) prints: >> >> -bash: ${p}: ambiguous redirect >> >> and PRINTER variable isn't set. >> >> Reverting to base-files-4.0

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Christopher Faylor
On Thu, Mar 17, 2011 at 07:59:11PM +0100, Angelo Graziosi wrote: >Il 17/03/2011 19.00, Angelo Graziosi ha scritto: >> I have just updated Cygwin, and now starting a console (Cygwin.bat or >> MinTTY) prints: >> >> -bash: ${p}: ambiguous redirect >> >> and PRINTER variable isn't set. >> >> Reverting

Re: Problems with the new base-files-4.0-5?

2011-03-17 Thread Angelo Graziosi
Il 17/03/2011 19.00, Angelo Graziosi ha scritto: I have just updated Cygwin, and now starting a console (Cygwin.bat or MinTTY) prints: -bash: ${p}: ambiguous redirect and PRINTER variable isn't set. Reverting to base-files-4.0-4 works just fine and PRINTER is set correctly to my default printe

Problems with the new base-files-4.0-5?

2011-03-17 Thread Angelo Graziosi
I have just updated Cygwin, and now starting a console (Cygwin.bat or MinTTY) prints: -bash: ${p}: ambiguous redirect and PRINTER variable isn't set. Reverting to base-files-4.0-4 works just fine and PRINTER is set correctly to my default printer. In 4.0-5 it seems something is broken in /e