home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!vac249f
- From: vac249f@monu6.cc.monash.edu.au (Robert D. Nicholson)
- Subject: Re: csh and files
- Message-ID: <1992Dec11.212402.11725@monu6.cc.monash.edu.au>
- Keywords: search text script
- Organization: Monash University, Caulfield Campus
- References: <1992Dec11.045138.3553@niftyneato.com> <10376@vtserf.cc.vt.edu>
- Date: Fri, 11 Dec 1992 21:24:02 GMT
- Lines: 35
-
- Heres a solution note strictly the oldname should be ^HOSTNNAME=hostname but
- im lazy :-)
-
- newhostname="steffi"
-
- sed 's/HOSTNAME=hostname/HOSTNAME=steffi/g' /etc/hostconfig
-
- #or
-
- sed "s/HOSTNAME=hostname/HOSTNAME=${newhostname}/g" /etc/hostconfig
-
- the file /etc/hostconfig contains
-
-
- #
- # -AUTOMATIC- Configure automatically
- # -YES- Turn a feature on
- # -NO- Leave a feature off or do not configure
- #
- HOSTNAME=hostname
- INETADDR=#########
- ROUTER=-NO-
- IPNETMASK=
- IPBROADCAST=-AUTOMATIC-
- NETMASTER=-YES-
- YPDOMAIN=-NO-
- TIME=-AUTOMATIC-
-
- #NOte the output is only to standard output you have to do something like
-
- save oldhostconfig
- sed blablabla > newhostconfig
- cp newhostconfig to hostconfig etc etc
-
- Hope this helps, any discounts on hardware??? :-))))))))
-