Created
August 17, 2024 10:50
-
-
Save benjamincrozat/110558cd0960e2b30ad05b58602ba8bb to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Define the output file | |
output_file="combined.md" | |
# Remove the output file if it exists to avoid including it in the search | |
if [ -f "$output_file" ]; then | |
rm "$output_file" | |
fi | |
# Find all Markdown files in subfolders, exclude the output file path, and concatenate them into one file | |
find . -type f -name '*.md' ! -path "./$output_file" -exec echo "Adding {} to $output_file" \; -exec cat {} + >> $output_file | |
echo "All Markdown files have been concatenated into $output_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment