home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / protocol / nfs / 2229 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.4 KB  |  48 lines

  1. Newsgroups: comp.protocols.nfs
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.de!chx400!bernina!hanke
  3. From: hanke@nessie.cs.id.ethz.ch (Norbert Hanke)
  4. Subject: Re: How can I define a USER environment variable with PC-NFS 4.0a
  5. Message-ID: <1992Sep4.065856.24103@bernina.ethz.ch>
  6. Keywords: PC-NFS Envirnonment Variables
  7. Sender: news@bernina.ethz.ch (USENET News System)
  8. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  9. References: <1992Sep3.180455.3605@ohpspd.com>
  10. Date: Fri, 4 Sep 1992 06:58:56 GMT
  11. Lines: 35
  12.  
  13. In article <1992Sep3.180455.3605@ohpspd.com> faashb@ohpspd.com (Fe A. Ashburner) writes:
  14. >We are running over 100 Pc's networked using PC-NFS 4.0a. I would like to
  15. >be able to set a USER and HOSTNAME environment variable to the correct username
  16. >and hostname of the PC.
  17. >
  18. >The information is available by the NET NAME command but I do not know how to
  19. >extract the usename and hostname from the NET NAME output and then set the
  20. >apporiate environment labels.
  21. >
  22.  
  23. We do this using GNU SED to process the output of a NET NAME command. SED
  24. produces a batchfile that sets the environment variable to the user name.
  25.  
  26.  
  27. batch file to execute NET NAME and SED:
  28.  
  29. c:\nfs\net name | c:\utils\sed -f c:\nfs\netname.sed >nettmp.bat
  30. call nettmp.bat
  31. del nettmp.bat
  32.  
  33.  
  34. command file for SED (named netname.sed for the example above):
  35.  
  36. 1 d
  37. 2 d
  38. 3 d
  39. 4 d
  40. 5 d
  41. 6 s/.*as /set USER=/
  42. s/,.*//
  43. q
  44.  
  45.  
  46. Norbert Hanke
  47. ETH Zurich, Switzerland
  48.