《问》How to create a shell script on Ubuntu/MacOS?

《问》

How to create a shell script on Ubuntu/MacOS?


create a bash script

nvim hello.sh

edit the file "hello.sh"

#!/bin/bash
echo "Hello, World!" 
echo "Knowledge is power."

set execute permission for this script hello.sh

chmod +x hello.sh

run the script

./hello.sh

Comments

Popular posts from this blog

Ruby语言的设计思想

Ruby语言比较讲座:单引号和双引号的比较

Ruby语言经典代码讲座:理解方法