My first bash at Bash

06/14/2020

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:

  • ifconfig.me 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 ifconfig.me) && echo $todays_ip && whois $todays_ip | grep "address:"'

Leave a Reply:

Your email address will not be published. Required fields are marked *

19 − fourteen =