一、脚本运行
- 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
网友评论