This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 < "${p}" && PRINTER=${PRINTER%%,*}
> >
> > read -r "$p" returns 1 bcoz "The return code is zero, unless
> > end-of-file is encountered"...
> >
> > alternative :
> >
> > [ -e "${p}" ] && IFS=',' read -r PRINTER dummy < "${p}"
> 

While you're at it, it would probably be a good idea to:
$ unset p
when you're done with it.

--Ken Nellis

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]