Browse Source

Added wttr command

master
Josh Wolfe 3 years ago
parent
commit
7796f4f4df
2 changed files with 11 additions and 0 deletions
  1. 1
    0
      .zshrc
  2. 10
    0
      bin/weather

+ 1
- 0
.zshrc View File

@@ -118,6 +118,7 @@ alias :q='exit'
alias less='less -R'
alias grep='grep --color=always'
alias open='xdg-open'
alias wttr='~/bin/weather'
# List directory contents
alias lsa='ls -lah --color'
alias l='ls --color'

+ 10
- 0
bin/weather View File

@@ -0,0 +1,10 @@
#!/bin/bash

if [ "$#" -eq 0 ]; then
curl -s "http://wttr.in/mississauga" | head -n -2
elif [ "$#" -eq 1 ]; then
curl -s "http://wttr.in/"$1 | head -n -2
else
echo "Error"
fi


Loading…
Cancel
Save