Skip to content

Instantly share code, notes, and snippets.

@lawvs
Created April 12, 2018 16:04
Show Gist options
  • Save lawvs/6e2f2852fd7df00c1ebdd9ca8ede490f to your computer and use it in GitHub Desktop.
Save lawvs/6e2f2852fd7df00c1ebdd9ca8ede490f to your computer and use it in GitHub Desktop.
bash color
#!/bin/bash
red='\e[91m'
green='\e[92m'
yellow='\e[93m'
magenta='\e[95m'
cyan='\e[96m'
none='\e[0m'
# Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment