Skip to content

Instantly share code, notes, and snippets.

@hatak
Last active December 17, 2015 07:48
Show Gist options
  • Save hatak/5575221 to your computer and use it in GitHub Desktop.
Save hatak/5575221 to your computer and use it in GitHub Desktop.
#!/bin/bash
sed -i -r 's/# (force_color_prompt=yes)/\1/g' ~/.bashrc
HOSTNAME=`gawk -F. '{print $1"."$2}' /etc/hostname`
sed -i -r "s/\\\u@.+(\\\[\\\033\[00m\\\])?\:/\\\u@${HOSTNAME}\1\:/g" ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment