I have a repository of SQL files where each represents a stored procedure . These files are inside a directory organized in other subdirectories.
Example of my directory structure:
stored-procedures
---d1
------sd1
---------sp1.sql
---------sp2.sql
---------sp3.sql
------sd2
---------sp4.sql
---------sp5.sql
------sd3
---d2
------sd4
---------sp6.sql
---d3
------sd5
------sd6
The command I use to execute each stored-procedure separately is as follows:
mysql -uuser -psenha bd < sp1.sql --force
How can I do this on Linux through the command line or creating a script ?