#!/bin/bash

#perl -pi -e "s/^[0-9]{3}\.[0-9]{3}\.[0-9]{1,3}\.[0-9]{1,3}\s*yourname-laptop.cs.binghamton.edu\s*\S*/`ifconfig eth1 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'`	yourname-laptop.cs.binghamton.edu yourname-laptop/g" ~/hosts
perl -pi -e "s/^[0-9]{3}\.[0-9]{3}\.[0-9]{1,3}\.[0-9]{1,3}\s*`hostname -s`\S*\s*\S*/`ifconfig eth1 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'`	yourname-laptop.cs.binghamton.edu yourname-laptop/g" /etc/hosts

