if [ -t 0 ] ; then # If stdout is a terminal INTERACTIVE=1 fi polite_curl() { if [ $INTERACTIVE ] ; then CURL_ARGS="--progress-bar" else CURL_ARGS="-fsS" fi curl $CURL_ARGS $* }