Skip to content

Instantly share code, notes, and snippets.

@justinc1
Last active April 22, 2018 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinc1/d65f3df3d8b3b0b1601f05d71c406342 to your computer and use it in GitHub Desktop.
Save justinc1/d65f3df3d8b3b0b1601f05d71c406342 to your computer and use it in GitHub Desktop.
Execute bash in net namespace, with informative promt
#!/bin/bash
set -eu
NS=$1
export PS1="[\u@\h \W] ($NS) \$ "
sudo ip netns exec $NS bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment