Mail Archives: cygwin/2002/09/11/14:14:38
---559023410-456208845-1031768066=:1269
Content-Type: TEXT/PLAIN; charset=US-ASCII
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 AT cs DOT nyu DOT edu
ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT 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
---559023410-456208845-1031768066=:1269
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="make-etc-links.sh-0.3-diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine DOT GSO DOT 4 DOT 44 DOT 0209111414260 DOT 1269 AT slinky DOT cs DOT nyu DOT edu>
Content-Description:
Content-Disposition: attachment; filename="make-etc-links.sh-0.3-diff"
LS0tIG1ha2UtZXRjLWxpbmtzLnNoLW9yaWcJMjAwMi0wOS0xMCAxNTozOToz
Ny4w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M9YC9iaW4v
Y3lncGF0aCAkU1lTVEVNUk9PVGAvc3lzdGVtMzIvZHJpdmVycy9ldGMgOzsN
Ci0gICBDWUdXSU5fOSopIFdJTkVUQz1gL2Jpbi9jeWdwYXRoICRXSU5CT09U
RElSYCA7Ow0KKyAgIENZR1dJTl9OVCopIFdJTkVUQz0iJFdJTkhPTUUiL3N5
c3RlbTMyL2RyaXZlcnMvZXRjIDs7DQorICAgQ1lHV0lOXzkqKSBXSU5FVEM9
IiRXSU5IT01FIiA7Ow0KICAgICopIGVjaG8gIlVua25vd24gc3lzdGVtIHR5
cGUgJE9TTkFNRTsgZXhpdGluZyIgPiYyOyBleGl0IDEgOzsNCiBlc2FjDQot
RklMRVM9Imhvc3RzIHByb3RvY29sIHNlcnZpY2VzIG5ldHdvcmtzIg0KK0ZJ
TEVTPSJob3N0cyBwcm90b2NvbHMgc2VydmljZXMgbmV0d29ya3MiDQogDQog
Zm9yIEZJTEUgaW4gJEZJTEVTDQogZG8NCi0gIGlmIFsgISAtZSAvZXRjLyRG
SUxFIF0NCisgIGlmIFsgISAtZSAiL2V0Yy8kRklMRSIgXQ0KICAgdGhlbg0K
LSAgICAvYmluL2xuIC1zICRWRVJCT1NFICR7V0lORVRDfS8kRklMRSAvZXRj
LyRGSUxFDQorICAgICMgV2luZG93cyBvbmx5IHVzZXMgdGhlIGZpcnN0IDgg
Y2hhcmFjdGVycw0KKyAgICBXRklMRT1gZWNobyAkRklMRSB8IHNlZCAncy9e
XCguXHswLDhcfVwpLiovXDEvJ2ANCisgICAgL2Jpbi9sbiAtcyAkVkVSQk9T
RSAiJFdJTkVUQy8kV0ZJTEUiICIvZXRjLyRGSUxFIg0KICAgZmkNCiBkb25l
DQogDQo=
---559023410-456208845-1031768066=:1269
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="make-etc-links.sh"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine DOT GSO DOT 4 DOT 44 DOT 0209111414261 DOT 1269 AT slinky DOT cs DOT nyu DOT edu>
Content-Description:
Content-Disposition: attachment; filename="make-etc-links.sh"
IyEvYmluL3NoDQojLS0NCiMgQ3JlYXRlcyBzeW1ib2xpYyBsaW5rcyBmcm9t
IHNvbWUgL2V0YyBmaWxlcyB0byB0aGVpciB3aW5kb3dzIGVxdWl2YWxlbnRz
DQojDQojIFZlcnNpb246IDAuMw0KIw0KIyBDaGFuZ2VMb2c6DQojICAgIHYw
LjMgSWdvciBQZWNodGNoYW5za2kgPHBlY2h0Y2hhIGF0IGNzLm55dS5lZHU+
Og0KIyAgICAgICBRdW90ZSB2YXJpYWJsZSByZWZlcmVuY2VzDQojICAgICAg
IFVzZSBgY3lncGF0aCAtV2AgaW5zdGVhZCBvZiAiJFNZU1RFTVJPT1QiDQoj
ICAgICAgIENoYW5nZSBwcm90b2NvbCB0byBwcm90b2NvbHMgb24gY3lnd2lu
DQojICAgICAgIEFkZCBDaGFuZ2VMb2cNCiMgICAgdjAuMiBJZ29yIFBlY2h0
Y2hhbnNraSA8cGVjaHRjaGEgYXQgY3Mubnl1LmVkdT46DQojICAgICAgIFVz
ZSBgdW5hbWUgLXNgIGluc3RlYWQgb2YgIiRPUyINCiMgICAgICAgQWRkIFdp
bjl4IHN1cHBvcnQNCiMgICAgICAgQWRkIG5ldHdvcmtzIGZpbGUNCiMgICAg
djAuMSBQYXVsIEpvaG5zdG9uIDxwYWogYXQgcGFqaG9tZS5vcmcudWs+Og0K
IyAgICAgICBJbml0aWFsIHZlcnNpb24NCiMtLQ0KDQpWRVJCT1NFPS12DQoN
Ck9TTkFNRT1gL2Jpbi91bmFtZSAtc2ANCldJTkhPTUU9YC9iaW4vY3lncGF0
aCAtV2ANCg0KY2FzZSAiJE9TTkFNRSIgaW4NCiAgIENZR1dJTl9OVCopIFdJ
TkVUQz0iJFdJTkhPTUUiL3N5c3RlbTMyL2RyaXZlcnMvZXRjIDs7DQogICBD
WUdXSU5fOSopIFdJTkVUQz0iJFdJTkhPTUUiIDs7DQogICAqKSBlY2hvICJV
bmtub3duIHN5c3RlbSB0eXBlICRPU05BTUU7IGV4aXRpbmciID4mMjsgZXhp
dCAxIDs7DQplc2FjDQpGSUxFUz0iaG9zdHMgcHJvdG9jb2xzIHNlcnZpY2Vz
IG5ldHdvcmtzIg0KDQpmb3IgRklMRSBpbiAkRklMRVMNCmRvDQogIGlmIFsg
ISAtZSAiL2V0Yy8kRklMRSIgXQ0KICB0aGVuDQogICAgIyBXaW5kb3dzIG9u
bHkgdXNlcyB0aGUgZmlyc3QgOCBjaGFyYWN0ZXJzDQogICAgV0ZJTEU9YGVj
aG8gJEZJTEUgfCBzZWQgJ3MvXlwoLlx7MCw4XH1cKS4qL1wxLydgDQogICAg
L2Jpbi9sbiAtcyAkVkVSQk9TRSAiJFdJTkVUQy8kV0ZJTEUiICIvZXRjLyRG
SUxFIg0KICBmaQ0KZG9uZQ0KDQo=
---559023410-456208845-1031768066=:1269
Content-Type: text/plain; charset=us-ascii
--
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/
---559023410-456208845-1031768066=:1269--
- Raw text -