Created
February 8, 2025 02:27
-
-
Save brunogama/d123ab784518422460e7e9e7e642df01 to your computer and use it in GitHub Desktop.
puts all content from files with extension to clipboard
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 characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <file_extension>" | |
exit 1 | |
fi | |
EXTENSION="$1" | |
TMP_FILE="/tmp/temp.txt" | |
find . -type f -name "*.${EXTENSION}" -print0 | xargs -0 cat > "$TMP_FILE" | |
pbcopy < "$TMP_FILE" | |
rm -f "$TMP_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment