Add a "shebang" at the top of your file:
#!/bin/bash
And make your file executable (chmod +x script.sh
).
Finally, modify your path to add the directory where your script is located:
export PATH=$PATH:/appropriate/directory
(typically, you want $HOME/bin
for storing your own scripts)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…