shell脚本
2020-07-25 本文已影响0人
魔芋辣椒
一、脚本运行
- bash方式
$mkdir bin;cd bin
$vim hello.sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo -e "hello world! \a \n"
exit 0
- 直接执行
chmod a+x hello.sh;./hello.sh
此类方法相当于开辟子bash,在子bash中运行,不影响父bash,若想在父bash中运行,则 source hello.sh