From 1e62b03ab0070dce0efcb285c5c09fb7655b2e91 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sat, 15 Dec 2018 21:24:42 -0800 Subject: [PATCH] Change shebang, close when curl is not present --- getweather.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/getweather.sh b/getweather.sh index becdc29..a405038 100755 --- a/getweather.sh +++ b/getweather.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/bash # Obtain a weather forecast printHelp() { @@ -32,6 +32,7 @@ while true; do esac done +[[ ! -x '/usr/bin/curl' ]] && echo 'curl is required for this script' && exit 1 [[ -z "${@}" ]] && echo "Please enter a location" >&2 && exit 1 xargs --no-run-if-empty -I {} curl wttr.in/{} <<< "${@}"