0
svn mergeinfo --show-revs eligible http://svn.test.com/INT_1.0.0/ http://svn.test.com/DEV/ | cut -d"r" -f2 | cut -d" " -f1
6097
6099
当我把这个剧本,我只得到最后的值,但还不是全部:店从命令值到一个数组的bash
#!/usr/bin/bash
src_url="http://svn.test.com/INT_1.0.0/"
target_url="http://svn.test.com/DEV/"
eligible_revs=(`svn mergeinfo --show-revs eligible $src_url $target_url | cut -d"r" -f2 | cut -d" " -f1`)
echo ${eligible_revs[@]}
output:
6099
如何同时获取数组中的命令输出值或所有值 - 6097,6099? – iaav
@jaav:在设置'eligible_revs'之前,尝试在字段分隔符列表中添加'\ r':'IFS + = $'\ r'' – rici