Skip to content

Instantly share code, notes, and snippets.

@webcoyote
Created February 7, 2020 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webcoyote/24525299fad968a2a1aad5ca000f9f7f to your computer and use it in GitHub Desktop.
Save webcoyote/24525299fad968a2a1aad5ca000f9f7f to your computer and use it in GitHub Desktop.
Bash script to aggregate files into an array for use in a command
#!/usr/bin/env bash
set -euo pipefail
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
declare -a LIBS
while IFS= read -rd $'\0' LIB; do
LIBS+=("$LIB")
done < <(find "$SCRIPT_DIR/bin" -type f -iname '*.dll' -print0)
echo "Count: ${#LIBS[@]}"
echo "${LIBS[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment