From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
To: Paul Johnston <paj@pajhome.org.uk>
Cc: cygwin@cygwin.com
Subject: Re: Beginnings of a patch: /etc/hosts
Date: Wed, 11 Sep 2002 16:15:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.44.0209111845010.1269-300000@slinky.cs.nyu.edu> (raw)
In-Reply-To: <3D7FC73B.5F877492@pajhome.org.uk>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1377 bytes --]
On Wed, 11 Sep 2002, Paul Johnston wrote:
> > No, I'm not. I'm incorporating Warren Young's suggestion. Unless someone
> > with ME can confirm that 'uname -s' returns CYGWIN_9*? Nicholas?
>
> To me that's a step backwards - uname -s or $OS are the correct ways to
> detect the operating system. Warren's approach would be fooled if a user
> defined $SYSTEMROOT on Win 9x.
Win 9x does not set $OS... At least my Win 98 machine at home doesn't.
Besides, the user can always set $OS to fool the script, by the same
token. I'd prefer 'uname -s'. Pending confirmation from someone with
Win ME...
> Nit picks... FILES=... should probably go nearer the top
Agreed.
> On reflection, I think we'll always want it verbose, so we could lose
> $VERBOSE
Probably. In which case we should also print messages if the OS is not
detected or $WINETC is not found...
> That's gotta be it... in principle this is a very simple script!
Ok, one more iteration (script attached)...
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 #2: Type: TEXT/PLAIN, Size: 1614 bytes --]
#!/bin/sh
#--
# Creates symbolic links from some /etc files to their windows equivalents
#
# Version: 0.5
#
# ChangeLog:
# v0.5 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
# Move FILES to top; removed VERBOSE (thx Paul Johnston)
# Print messages on abnormal exit
# v0.4 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
# Use $SYSTEMROOT and $WINDIR to determine the OS (thx Warren Young)
# Check for existence of $WINETC directory (thx Paul Johnston)
# Use `expr substr` instead of `echo | sed` (thx Joe Buehler)
# v0.3 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
# Quote variable references (thx Joe Buehler)
# Use `cygpath -W` instead of "$SYSTEMROOT" (thx Corinna Vinschen)
# Change protocol to protocols on cygwin
# Add ChangeLog
# v0.2 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
# Use `uname -s` instead of "$OS"
# Add Win9x support
# Add networks file
# v0.1 Paul Johnston <paj at pajhome.org.uk>:
# Initial version
#--
FILES="hosts protocols services networks"
WINHOME=`/bin/cygpath -W`
if [ -n "$SYSTEMROOT" ]
then
WINETC="$WINHOME/system32/drivers/etc"
elif [ -n "$WINDIR" ]
then
WINETC="$WINHOME"
else
echo "Unknown system type; exiting" >&2
exit 0
fi
if [ ! -d "$WINETC" ]
then
echo "Directory $WINETC does not exist; exiting" >&2
exit 0
fi
for FILE in $FILES
do
if [ ! -e "/etc/$FILE" ]
then
# Windows only uses the first 8 characters
WFILE=`expr substr "$FILE" 1 8`
/bin/ln -s -v "$WINETC/$WFILE" "/etc/$FILE"
fi
done
[-- Attachment #3: Type: TEXT/PLAIN, Size: 1327 bytes --]
--- make-etc-links.sh-orig 2002-09-11 18:08:39.000000000 -0400
+++ make-etc-links.sh 2002-09-11 18:57:01.000000000 -0400
@@ -2,9 +2,12 @@
#--
# Creates symbolic links from some /etc files to their windows equivalents
#
-# Version: 0.4
+# Version: 0.5
#
# ChangeLog:
+# v0.5 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
+# Move FILES to top; removed VERBOSE (thx Paul Johnston)
+# Print messages on abnormal exit
# v0.4 Igor Pechtchanski <pechtcha at cs.nyu.edu>:
# Use $SYSTEMROOT and $WINDIR to determine the OS (thx Warren Young)
# Check for existence of $WINETC directory (thx Paul Johnston)
@@ -22,7 +25,7 @@
# Initial version
#--
-VERBOSE=-v
+FILES="hosts protocols services networks"
WINHOME=`/bin/cygpath -W`
@@ -33,12 +36,13 @@ elif [ -n "$WINDIR" ]
then
WINETC="$WINHOME"
else
+ echo "Unknown system type; exiting" >&2
exit 0
fi
-FILES="hosts protocols services networks"
if [ ! -d "$WINETC" ]
then
+ echo "Directory $WINETC does not exist; exiting" >&2
exit 0
fi
@@ -48,7 +52,7 @@ do
then
# Windows only uses the first 8 characters
WFILE=`expr substr "$FILE" 1 8`
- /bin/ln -s $VERBOSE "$WINETC/$WFILE" "/etc/$FILE"
+ /bin/ln -s -v "$WINETC/$WFILE" "/etc/$FILE"
fi
done
[-- Attachment #4: Type: text/plain, Size: 214 bytes --]
--
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/
next prev parent reply other threads:[~2002-09-11 22:58 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 2:45 Suggestion: /etc/hosts Paul Johnston
2002-09-09 5:38 ` Nicholas Wourms
2002-09-09 5:40 ` Marcos Lorenzo de Santiago
2002-09-09 6:51 ` Joe Buehler
2002-09-09 7:32 ` Christopher Faylor
2002-09-10 2:19 ` Paul Johnston
2002-09-11 7:43 ` Jim
2002-09-09 11:25 ` news
[not found] ` <E17oTbC-0001AV-00@quimby.gnus.org>
2002-09-10 9:52 ` Shankar Unni
2002-09-10 11:46 ` Beginnings of a patch: /etc/hosts Paul Johnston
2002-09-10 13:36 ` Igor Pechtchanski
2002-09-11 0:59 ` John Morrison
2002-09-11 2:06 ` Corinna Vinschen
2002-09-11 9:57 ` Joe Buehler
2002-09-11 11:17 ` Igor Pechtchanski
2002-09-11 11:42 ` Joe Buehler
2002-09-11 12:39 ` Igor Pechtchanski
2002-09-11 14:24 ` Paul Johnston
2002-09-11 14:53 ` Warren Young
2002-09-11 15:37 ` Igor Pechtchanski
2002-09-11 15:40 ` Paul Johnston
2002-09-11 16:15 ` Igor Pechtchanski [this message]
2002-09-11 16:35 ` Robert Collins
2002-09-11 17:10 ` Randall R Schulz
2002-09-11 17:26 ` OT " Igor Pechtchanski
2002-09-12 4:33 ` Nicholas Wourms
2002-09-12 4:46 ` Nicholas Wourms
2002-09-11 19:00 ` Christopher Faylor
2002-09-12 8:56 ` Joe Buehler
2002-09-11 23:25 ` Robert Collins
2002-09-12 4:11 ` Nicholas Wourms
2002-09-11 17:14 ` Igor Pechtchanski
2002-09-12 1:27 ` Robert Collins
2002-09-11 17:54 ` Igor Pechtchanski
2002-09-12 4:08 ` Nicholas Wourms
2002-09-12 10:08 ` Warren Young
2002-09-12 10:11 ` Warren Young
2002-09-10 13:54 ` Suggestion: /etc/hosts Warren Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.44.0209111845010.1269-300000@slinky.cs.nyu.edu \
--to=pechtcha@cs.nyu.edu \
--cc=cygwin@cygwin.com \
--cc=paj@pajhome.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).