2
I’m trying to get all the files .sql
of my project and change the extension to .md
.
I’ve been able to do this, however, the files are being moved to the system root, 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
Has the command
rename
also, take a look https://www.computerhope.com/unix/rename.htm– Felipe Nogaroto Gonzalez