home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.protocols.nfs
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.de!chx400!bernina!hanke
- From: hanke@nessie.cs.id.ethz.ch (Norbert Hanke)
- Subject: Re: How can I define a USER environment variable with PC-NFS 4.0a
- Message-ID: <1992Sep4.065856.24103@bernina.ethz.ch>
- Keywords: PC-NFS Envirnonment Variables
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <1992Sep3.180455.3605@ohpspd.com>
- Date: Fri, 4 Sep 1992 06:58:56 GMT
- Lines: 35
-
- In article <1992Sep3.180455.3605@ohpspd.com> faashb@ohpspd.com (Fe A. Ashburner) writes:
- >We are running over 100 Pc's networked using PC-NFS 4.0a. I would like to
- >be able to set a USER and HOSTNAME environment variable to the correct username
- >and hostname of the PC.
- >
- >The information is available by the NET NAME command but I do not know how to
- >extract the usename and hostname from the NET NAME output and then set the
- >apporiate environment labels.
- >
-
- We do this using GNU SED to process the output of a NET NAME command. SED
- produces a batchfile that sets the environment variable to the user name.
-
-
- batch file to execute NET NAME and SED:
-
- c:\nfs\net name | c:\utils\sed -f c:\nfs\netname.sed >nettmp.bat
- call nettmp.bat
- del nettmp.bat
-
-
- command file for SED (named netname.sed for the example above):
-
- 1 d
- 2 d
- 3 d
- 4 d
- 5 d
- 6 s/.*as /set USER=/
- s/,.*//
- q
-
-
- Norbert Hanke
- ETH Zurich, Switzerland
-