我需要以簡單的週期打印當天的所有SVN修訂版,但我無法解析它們。在Bash中打印所有svn修訂日期
我需要的是循環修改每一天。我的問題是獲得一個腳本,例如修改日期和版本號:
log=$(svn log -r {2011-11-01}:Head)
startDate= #??? get first commit date from log
startCommit= #?? get first revision number from log
for $rev in $(log); do
# revisionDate=??? (similar to startdate)
# revisionNumber=??? (similar to start commit)
if [! $startDate = $revisionDate ]; then
echo $revisionDate
echo $revisionNumber
fi
done
這是一個SVN的日誌的例子:
------------------------------------------------------------------------
r1619603 | aw | 2014-08-21 23:33:35 +0200 (Thu, 21 Aug 2014) | 2 lines
YARN-2436. [post-HADOOP-9902] yarn application help doesn't work
------------------------------------------------------------------------
r1619604 | jlowe | 2014-08-21 23:38:16 +0200 (Thu, 21 Aug 2014) | 2 lines
HADOOP-10893. isolated classloader on the client side. Contributed by Sangjin Lee
------------------------------------------------------------------------
r1619614 | jlowe | 2014-08-22 00:41:34 +0200 (Fri, 22 Aug 2014) | 2 lines
YARN-2434. RM should not recover containers from previously failed attempt when AM restart is not enabled. Contributed by Jian He
------------------------------------------------------------------------
r1619626 | sandy | 2014-08-22 01:28:44 +0200 (Fri, 22 Aug 2014) | 1 line
MAPREDUCE-5130. Add missing job config options to mapred-default.xml (Ray Chiang via Sandy Ryza)
------------------------------------------------------------------------
r1619632 | aw | 2014-08-22 01:58:25 +0200 (Fri, 22 Aug 2014) | 1 line
HADOOP-8896. Javadoc points to Wrong Reader and Writer classes in SequenceFile (Ray Chiang via aw)
------------------------------------------------------------------------
您是否嘗試輸出'$ log'並看着它? – Will
是的,svn log的例子是$ log變量的輸出。 – Botacco