diff --git a/ShellScripts/Brewapps.sh b/ShellScripts/Brewapps.sh new file mode 100755 index 0000000..4cd994b --- /dev/null +++ b/ShellScripts/Brewapps.sh @@ -0,0 +1,31 @@ +#!/bin/zsh + +# List Selected Application Descriptions +clear +echo "App Descriptions..." +echo " " + +# Array of app names +apps=("btop" "iperf3" "jq" "qlmarkdown" "macdown" "mosh" "speedtest" "balenaetcher" "github" "macvim") + +# Function to check if a line contains an app name +contains_app() { + local line=$1 + for app in "${apps[@]}"; do + if [[ $line == *"$app"* ]]; then + echo "$line" + break + fi + done +} + +# Temporary file to store brew command results + temp_file=$(mktemp) +# Run the command and store output in a temporary file + brew desc --eval-all $(brew list) | awk 'gsub(/^([^:]*?)\s*:\s*/,"&=")' | column -s "=" -t > $temp_file + +# Read file line by line and check for app names +while IFS= read -r line; do + contains_app "$line" +done < $temp_file + diff --git a/ShellScripts/Brewm.sh b/ShellScripts/Brewm.sh index 682470a..38d8d97 100755 --- a/ShellScripts/Brewm.sh +++ b/ShellScripts/Brewm.sh @@ -30,11 +30,11 @@ function viewbrewfile { cat ~/Brewfile echo -en "\n\n\t\t\tHit any key to view App Descriptions" read -k 1 line -# Display Installed Brew File App Descriptions +# Display Selected Brew File App Descriptions clear echo "App Descriptions..." echo " " - cat ~/Brewapps + brewapps.sh } function brewapps {