Created
September 9, 2016 14:03
Revisions
-
RyanPossible created this gist
Sep 9, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/bin/bash toUpgrade=('git' 'node' 'wget' 'openssl') array_contains () { local array="$1[@]" local seeking=$2 local in=1 for element in "${!array}"; do if [[ $element == $seeking ]]; then in=0 break fi done return $in } echo "Good Morning Mr. Schumacher!" echo "Updating Brew:" brew update OUTDATED="$(brew outdated)" IFS=' ' read -ra FORMULAES <<< "$OUTDATED" for FORMULAE in "${FORMULAES[@]}"; do array_contains toUpgrade "$FORMULAE" && echo "$(brew upgrade $FORMULAE)" done echo "Have a good day Mr. Schumacher!"