home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / programm / 7692 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.2 KB  |  47 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!vac249f
  3. From: vac249f@monu6.cc.monash.edu.au (Robert D. Nicholson)
  4. Subject: Re: csh and files
  5. Message-ID: <1992Dec11.212402.11725@monu6.cc.monash.edu.au>
  6. Keywords: search text script
  7. Organization: Monash University, Caulfield Campus
  8. References: <1992Dec11.045138.3553@niftyneato.com> <10376@vtserf.cc.vt.edu>
  9. Date: Fri, 11 Dec 1992 21:24:02 GMT
  10. Lines: 35
  11.  
  12. Heres a solution note strictly the oldname should be ^HOSTNNAME=hostname but
  13. im lazy :-)
  14.  
  15. newhostname="steffi"
  16.  
  17. sed 's/HOSTNAME=hostname/HOSTNAME=steffi/g' /etc/hostconfig
  18.  
  19. #or 
  20.  
  21. sed "s/HOSTNAME=hostname/HOSTNAME=${newhostname}/g" /etc/hostconfig
  22.  
  23. the file /etc/hostconfig contains
  24.  
  25.  
  26. #
  27. #    -AUTOMATIC-    Configure automatically
  28. #    -YES-        Turn a feature on
  29. #    -NO-        Leave a feature off or do not configure
  30. #
  31. HOSTNAME=hostname
  32. INETADDR=#########
  33. ROUTER=-NO-
  34. IPNETMASK=
  35. IPBROADCAST=-AUTOMATIC-
  36. NETMASTER=-YES-
  37. YPDOMAIN=-NO-
  38. TIME=-AUTOMATIC-
  39.  
  40. #NOte the output is only to standard output you have to do something like
  41.  
  42. save oldhostconfig
  43. sed blablabla > newhostconfig
  44. cp newhostconfig to hostconfig etc etc
  45.  
  46. Hope this helps, any discounts on hardware??? :-))))))))
  47.