If you want to run the script by simply typing its name, a workaround is to create an alias and transfer it to your .bashrc , for example:
alias scriptName="bash /pathToTheScript/yourScript.sh"
Or you can create a script inside your .bashrc and make it accessible through a function:
source /pathToTheScript/yourScript.sh
where is the script:
#!/bin/bash function your_function() { yourCode }
source share