English 中文(简体)
bash 执行 svn 命令, URl 包含空格
原标题:bash execute svn command where url contains spaces

我是一个新人 当它涉及到linux 和特别 冲击性脚本。

基本上,我想做的是(在一些混合狂欢/假代码中)

for entry in `svn list https://svn.xxx.../projects`
  if already checked out
  then
    svn up https://svn.xxx.../projects/$entry some/local/path
  else 
    svn co https://svn.xxx.../projects/$entry some/local/path
  fi

  ... other stuff ...
done

My problem is that unfortunately some of our projects contains spaces in their names. I managed to do some assembling of the entry parts but when executing the subversion command the spaces in the url became escaped. E.g.

svn co "https://svn.xxx.../projects/$myassembly" some/local/path

成为

svn co https://svn.xxx.../projects/Project%20With%20Space some/local/path

无法找到 URL 。

任何帮助我解决此事的帮助我都会感激不尽 谢谢

最佳回答

使用 < code> 而使用 环, 而不是 < code> 环, 并引用变量扩展处的 < code> 环。 使用程序替换, 重新定向到 < code> done 的环, 输入 < code > 。

while read -r entry
do
  if already checked out
  then
    svn up "https://svn.xxx.../projects/$entry" some/local/path
  else 
    svn co "https://svn.xxx.../projects/$entry" some/local/path
  fi

  ... other stuff ...
done < <(svn list https://svn.xxx.../projects)
问题回答

暂无回答




相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签