Read .md files as well as .txt

This commit is contained in:
Alex
2023-04-15 20:08:48 -06:00
parent 00fbe3ab5b
commit 95198963db

View File

@@ -1714,14 +1714,17 @@ function txt_files_function() {
DIR="/opt/unetlab/addons/qemu/$FOLDERNAME"
EXTENSION=".txt"
EXTENSIONS=(".txt" ".md")
for ELEMENT in "$DIR"/*; do
if [[ "${ELEMENT: -4}" == "$EXTENSION" ]]; then
for EXTENSION in "${EXTENSIONS[@]}"; do
if [[ "${ELEMENT: -${#EXTENSION}}" == "$EXTENSION" ]]; then
echo -e "\nReading file: $ELEMENT\n"
cat "$ELEMENT"
echo -e
break
fi
done
done
}