./test.sh:
#!/bin/bash
echo "http://c.biancheng.net/shell/"
- 赋予脚本可执行权限:
$ cd demo #切换到 test.sh 所在的目录 $ chmod +x ./test.sh #使脚本具有执行权限 $ ./test.sh #执行脚本
- 使用 . :
$ . ./test.sh http://c.biancheng.net/shell/
- 使用source:
$ source test.sh http://c.biancheng.net/shell/
-
作为解释器参数:
$ /bin/bash test.sh http://c.biancheng.net/shell/