How do I execute a bash script in Terminal?

后端 未结 9 2066
無奈伤痛
無奈伤痛 2020-12-12 11:50

I have a bash script like:

#!/bin/bash

echo Hello world!

How do I execute this in Terminal?

9条回答
  •  -上瘾入骨i
    2020-12-12 12:21

    Yet another way to execute it (this time without setting execute permissions):

    bash /path/to/scriptname
    

提交回复
热议问题