I'm trying to get all the .sql
files from my project and change the extension to .md
.
I've already been able to do this, however, the files are being moved to the root of the system, which is the path where the shell script is. How to rename keeping the original file in the same directory?
#!/bin/bash
shopt -s globstar
for file in ./**/*.sql; do
mv "$file" "$(basename "$file" .sql).md"
done