#!/bin/bash location="Saint Petersburg" if [[ "$location" != "" ]] then location="~${location// /+}" fi forecast=$(curl -s wttr.in/$location?format=1) if [[ ${#forecast} -gt 30 ]] then exit fi echo $forecast