Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created March 12, 2024 03:34
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 guitarrapc/06ca73a5e962bb74d2b978a7ac04b051 to your computer and use it in GitHub Desktop.
Save guitarrapc/06ca73a5e962bb74d2b978a7ac04b051 to your computer and use it in GitHub Desktop.
Enumerable files under
#!/bin/bash
set -e
extension="txt"
result=$(find . -type f -name "*.${extension}" | cut -d / -f 2 | sort -u)
if [[ -n "$result" ]]; then
while read -r item; do
echo "$PWD/$item"
done <<< "$result"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment