🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2018

Re: csh and files

#2018
From: Robert D. Nicholson
Date: Fri, 11 Dec 1992 21:24
35 lines
1255 bytes
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??? :-))))))))
Technical Details
Message-ID: <1992Dec11.212402.11725@monu6.cc.monash.edu.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!vac249f
References: <1992Dec11.045138.3553@niftyneato.com> <10376@vtserf.cc.vt.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!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