bash 脚本内的 SVN 提交无法正常工作
我有一个小示例脚本,它是一个更大脚本的一部分,除了 svn 提交部分之外,它运行良好。
root@dx-svn02:~# cat test.sh
#!/bin/bash
CMD="svn update /mnt/checkout/dx-test/"
echo "INFO>>>: $CMD"
$CMD
CMD="svn commit -m 'Updated various bits' /mnt/checkout/dx-test/"
echo "$CMD"
$CMD
root@dx-svn02:~# ./test.sh
INFO>>>: svn update /mnt/checkout/dx-test/
At revision 3.
svn commit -m 'Updated various bits' /mnt/checkout/dx-test/
svn: '/' is not a working copy
root@dx-svn02:~# svn commit -m 'Updated various bits' /mnt/checkout/dx-test/
root@dx-svn02:~#
我真的不明白更新是如何工作的,但提交却不能。 任何帮助将不胜感激。
I have a small example script, part of a bigger script, which is working fine except for the svn commit part.
root@dx-svn02:~# cat test.sh
#!/bin/bash
CMD="svn update /mnt/checkout/dx-test/"
echo "INFO>>>: $CMD"
$CMD
CMD="svn commit -m 'Updated various bits' /mnt/checkout/dx-test/"
echo "$CMD"
$CMD
root@dx-svn02:~# ./test.sh
INFO>>>: svn update /mnt/checkout/dx-test/
At revision 3.
svn commit -m 'Updated various bits' /mnt/checkout/dx-test/
svn: '/' is not a working copy
root@dx-svn02:~# svn commit -m 'Updated various bits' /mnt/checkout/dx-test/
root@dx-svn02:~#
I really don't understand how the update can work but the commit doesn't.
Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您插入单引号字符串时,它不会保留在引号中。
换句话说,您希望
...但是引用的方式,您会得到
您可能最好使用
set -x
之类的东西来查看执行命令时的命令。The single-quoted string doesn't remain quoted when you interpolate it.
In other words, you would like to have
... but the way the quoting works out, you are getting
You're probably better off using something like
set -x
to see the commands as you execute them.