Friday, December 14, 2018

Bash scripts and Tricks

awk -v ORS=, -F ':' '{print $1}' /tmp/hosts.txt
# Colors
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"
 
echo -e "$COL_RED This is red $COL_RESET"
echo -e "$COL_BLUE This is blue $COL_RESET"
echo -e "$COL_YELLOW This is yellow $COL_RESET"


~/cloud/cloudworks-tools @ sbutler-mbp(sbutler): head /tmp/hosts.txt
airselangor: 5 active ASGs - Started jenkins job
techbureau: 7 active ASGs - Started jenkins job
yumpizzahut: 5 active ASGs - Started jenkins job
finra: 7 active ASGs - Started jenkins job
webmd: 6 active ASGs - Started jenkins job
nvda-ngc: 6 active ASGs - Started jenkins job
precisiondx: 5 active ASGs - Started jenkins job
acadian-asset: 5 active ASGs - Started jenkins job
stcharleshealth: 6 active ASGs - Started jenkins job
skytap: 5 active ASGs - Started jenkins job

No comments: