作者:爱你真好958_358 | 来源:互联网 | 2023-01-23 16:48
Imhavingproblemstryingtoemptyafolderinmyscript.我在尝试清空脚本中的文件夹时遇到问题。Thisisworkinginmy
Im having problems trying to empty a folder in my script.
我在尝试清空脚本中的文件夹时遇到问题。
This is working in my command line:
这是在我的命令行中工作:
rm -r Folder1/Folder2/*
But if in my script I do this:
但如果在我的脚本中我这样做:
DIR="Folder1/Folder2/"
rm -r "$DIR*"
It says "rm: Folder1/Folder2/*: No such file or directory", where is the problem?
它说“rm:Folder1 / Folder2 / *:没有这样的文件或目录”,问题出在哪里?
Im running the script in the same folder as I tried the command.
我在尝试命令的同一个文件夹中运行脚本。
2 个解决方案