-
-
Save heartshare/c9e54736358add4b369457ccdc9a09dc to your computer and use it in GitHub Desktop.
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 | |
# 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