![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NIM host name change | kimyo | AIX | 2 | 11-12-2008 07:29 AM |
| How to delete the files from local host to remote host | krishna176 | SUN Solaris | 3 | 03-24-2007 04:48 PM |
| Hosts.allow and hosts.deny | huddlestonsnk | UNIX for Dummies Questions & Answers | 1 | 10-18-2006 12:34 PM |
| hosts.allow & hosts.deny | Sorrento | UNIX for Dummies Questions & Answers | 2 | 08-18-2005 10:25 PM |
| QNX host cannot ping SCO host, vice versa | gavon | IP Networking | 2 | 08-20-2001 09:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Change $HOST in /etc/hosts
I want to change the following lines in /etc/hosts on FreeBSD: Code:
::1 localhost localhost.my.domain 127.0.0.1 localhost localhost.my.domain into the following lines Code:
::1 localhost foo.example.com 127.0.0.1 localhost foo.example.com I have the following script to do that: Code:
# set subdomain in hosts file sed -i '' -e 's/localhost.my.domain/$HOST/' /etc/hosts in an attempt to use the prepopulated environment variable $HOST for that. But the result is as follows: Code:
::1 localhost $HOST 127.0.0.1 localhost $HOST What can I do to correct this? Thanks in advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|