对于一段包含cd 命令的shell脚本(test.sh):
#!/bin/bash
cd ..
mkdir ./test
运行:
sh ./test.sh
脚本运行时无法在上级目录建立test文件
此时用
. ./test.sh
即可
标签:shell 运行时 body gpo test down dir blog cd命令
对于一段包含cd 命令的shell脚本(test.sh):
#!/bin/bash
cd ..
mkdir ./test
运行:
sh ./test.sh
脚本运行时无法在上级目录建立test文件
此时用
. ./test.sh
即可
标签:shell 运行时 body gpo test down dir blog cd命令
原文地址:https://www.cnblogs.com/jerry323/p/8645411.html