Can I create a stored procedure in mysql using a txt file?
If you can execute SQL and you have sufficient privileges to create a stored procedure then you can create the stored procedure.

I'm assuming you can execute SQL with the .sh file above since you are currently using it to run jobs.  Since it looks like you are using this to perform maintenance on a scheduled basis I am going to further assume that you want to update the database/deploy changes using the same mechanism.  If this is true I would caution against this plan.  While it might seem nice to automate a deployment at midnight while you're sleeping if anything goes wrong, you won't enjoy the fallout when your boss/customer/angry person X wakes you up because the world is on fire....