shell基础
运行shhll
第一种方法:不指定,根据脚本第一行定shell
chmod +x ./test.sh #使脚本具有执行权限
第二种方法,指定shell
/bin/sh test.sh
工具:gitbash
linux环境下
vim text.sh
#! /bin/bash
echo "hello wordl"
wq!保存
./text.sh 运行
报错,需要赋权
第二种方式:
指定bash
注意:
当用第二种方式的时候,sh脚本里面的第一行就不生效了