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: regtool quoting variations on output


On Tue, 21 Sep 2004, luke.kendall wrote:

> A script broke today because regtool reported a key's value with
> extra double quotes around it.
>
> I also observed that whether or not a path was reported with a trailing
> "\" varied from one machine to the other.  Both were using regtool ver
> 1.8.
>
> "stout" is Windows XP, "percy" is Windows 2000.

I would guess that the quotes would be always present on 2000 and never
present on XP -- can that be verified?

> luke@STOUT /cygdrive/x/cygnus/cisra
> $ regtool -q get "\\HKLM\\SOFTWARE\\Microsoft\\Office\\10.0\\Word\\InstallRoot\\Path"
> C:\Program Files\Microsoft Office\Office10\
>
> mdias@PERCY ~
> $ regtool -q get "\\HKLM\\SOFTWARE\\Microsoft\\Office\\8.0\\Word\\InstallRoot\\Path"
> "C:\Program Files\Microsoft Office\Office"

An aside: if you used single quotes, you wouldn't need to double the
backslashes...

> Visual inspection of the above key in regedit on percy (W2K) showed that
> its value had no double-quotes in the registry.  Visual inspection on
> stout (WXP) also showed no double-quotes around the path (though it did
> have the trailing backslash, just as regtool reported).

Do they have the same key type?  If not, the above could be the behavior
of ExpandEnvironmentStrings(), and you'll just have to deal with it.
AFAICS, regtool itself does not add double quotes anywhere.

> I can change my script to pipe the output from regtool through
> sed 's/^"//;s/"$//', but that seems like a kludge to me.

If you want the script to be robust, I don't see how this is much of a
kludge.

> Does anyone have any idea what might be going on here?
> luke

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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