Well, Before I decided to post this I have tried all the solutions provided here that are related to my issue. And I know it's a simple but this is my first time ever dealing with Bash .. so please bear with me a little
I have this Script
FILES=*.html
for f in $FILES
do
# extension="${f##*.}"
filename="${f%.*}"
echo "Converting $f to $filename.md"
`pandoc $f -t markdown -o $filename.md`
rm $f
done
This script was created to convert a directory full of Html files into markdown equivalents. It uses Pandoc to do the conversion.
The issue is this script will convert the file in the same exact folder only, and I want to convert all the files in subfolders like this:
Folder1/Folder2/folder3/index.html
So any ideas on how I could do this?
find
available? – bu5hman Nov 15 '19 at 12:22find
appears to be bundled. Am not sure but you could try changingsh
tobash
as your shell – bu5hman Nov 15 '19 at 12:28-execdir
would be useful here. Also chaining therm
with&&
so the original is only removed if the conversion succeeds. The-print0
seems superfluous.` – steeldriver Nov 15 '19 at 12:29