我有一个Bash脚本,可以自动创建一些SVN文件夹。在这样做的过程中,它会创建一个临时目录。当我尝试删除临时目录与室射频命令,我收到以下错误...rm:无法删除'-rf':没有这样的文件或目录
rm: cannot remove '–rf': No such file or directory
它似乎认为“-rf”是一个文件名。该命令在命令行上正常工作。
这里是我的脚本...
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 reponame1 reponame2 ..."
else
for var in "[email protected]"
do
REPONAME=$var
mkdir -p ~/temp-$REPONAME/branches
mkdir ~/temp-$REPONAME/tags
mkdir ~/temp-$REPONAME/trunk
svnadmin create $REPONAME
svn import ~/temp-$REPONAME svn+ssh://[email protected]/home/username/svnrepos/$REPONAME -m "Initial structure"
rm –rf ~/temp-$REPONAME/
done
fi
这里是输出
$ ./mkrepo.sh mysvnrepo
[email protected]'s password:
[email protected]'s password:
Adding /home/username/temp-mysvnrepo/branches
Adding /home/username/temp-mysvnrepo/tags
Adding /home/username/temp-mysvnrepo/trunk
Committing transaction...
Committed revision 1.
rm: cannot remove '–rf': No such file or directory
rm: cannot remove '/home/username/temp-mysvnrepo/': Is a directory