This is the mail archive of the 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
> 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.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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

Description: Text document

Description: Text document

Unsubscribe info:
Bug reporting:

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