My first bash at Bash


Not sure why I haven’t got around to writing any shell commands / scripts in the past… here’s my first Bash :p

Here’s an alias to check which country my VPN is connected to in 3 steps:

  • call to set IP address to a variable
    • shows the IP address
  • checks the IP variable on whois
  • truncates the output to the ‘address’ output to see location

alias whoami='todays_ip=$(curl && echo $todays_ip && whois $todays_ip | grep "address:"'