This is the mail archive of the cygwin@cygwin.com 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: Beginnings of a patch: /etc/hosts


On Wed, 11 Sep 2002, Joe Buehler wrote:

> Paul Johnston wrote:
>
> > if [ "$OS" = "Windows_NT" ]
> > then
> >   WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc
> >   FILES="hosts protocol services"
> > fi
> >
> > for FILE in $FILES
> > do
> >   if [ ! -e /etc/$FILE ]
> >   then
> >     /bin/ln -s $VERBOSE ${WINETC}/$FILE /etc/$FILE
> >   fi
> > done
>
> Not likely to happen here, but... beware of whitespace in
> $SYSTEMROOT / $WINETC.
>
> I generally double-quote variable references as a matter of course
> in shell scripts so I don't run into bugs resulting from white
> space in the contents.
>
> Joe Buehler

A very good point.  Another patch (against my previous post) and the new
script are attached.  The new version fixes variable quoting and some
other minor things and incorporates Corinna's suggestion.
(Aside: should I be posting the actual scripts, or can people follow the
trail of patches?)

TODO: The sed script strikes me as a bit inelegant.  Also, I still can't
think of a way to make sure the case of the paths is correct.
Suggestions?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file

Attachment: make-etc-links.sh-0.3-diff
Description: Text document

Attachment: make-etc-links.sh
Description: Text document

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]