#!/bin/bash wttr_cache="${HOME}/.cache/wttr.json" if [[ ! $(find "${wttr_cache}" -cmin -60 -print 2>/dev/null) ]]; then # echo "File ${wttr_cache} exists and is younger than 60min" #else # echo "File ${wttr_cache} does not exists or is younger than 60min" curl --silent wttr.in/Eugene?format=j1 > "${wttr_cache}" fi cat "${wttr_cache}"