Skip to content

Instantly share code, notes, and snippets.

@Elijas
Last active April 17, 2025 16:30
Show Gist options
  • Save Elijas/57597b80cafbb4b6d1aede8269db2a4d to your computer and use it in GitHub Desktop.
Save Elijas/57597b80cafbb4b6d1aede8269db2a4d to your computer and use it in GitHub Desktop.
copy_file_content.sh
#!/bin/bash
while IFS= read -r -d '' file; do
full_path=$(realpath "$file")
echo "=============================="
echo "START OF FILE: $full_path"
echo "=============================="
echo
cat "$full_path" 2>/dev/null
echo
echo "=============================="
echo "END OF FILE: $full_path"
echo "=============================="
echo
done < <(find . -type f -not -empty -not -name '*.ipynb' -not -path '*/\.*' -not -path '*LICENSE*' -not -path '*/__pycache__/*' -not -path '*/baml_src/*' -not -path '*/generated_code/*' -not -path '*/data/*' -not -path '*/.cache/*' -not -name '*.lock' -not -name 'lcov.info' -not -name '__init__.py' -print0) | pbcopy
@Elijas
Copy link
Author

Elijas commented Apr 17, 2025

bash -c "$(curl -fsSL https://gist.githubusercontent.com/Elijas/57597b80cafbb4b6d1aede8269db2a4d/raw/677dfbffb72e810c63278824dd2d36e5c710e2b9/copy_file_content.sh)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment