Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
Created March 23, 2016 11:02
Show Gist options
  • Save willmendesneto/a41e6eb06c84e3ef0118 to your computer and use it in GitHub Desktop.
Save willmendesneto/a41e6eb06c84e3ef0118 to your computer and use it in GitHub Desktop.
Shell: reading files in a specific directory
# Load ".cli" folder content
if [ -d ~/.cli ]; then
CLI_FILES=$(find ~/.cli -maxdepth 2 -type f)
while read -r line; do
source $line
done <<< "$CLI_FILES"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment