close
Blogtrottr
批踢踢實業坊 EZsoft 板
 
Re: [請問] 用bat取到的本地端SVN版號做檔名
Sep 19th 2014, 05:56, by murraious

作者murraious (murraious)

看板EZsoft

標題Re: [請問] 用bat取到的本地端SVN版號做檔名

時間Fri Sep 19 05:56:19 2014

※ 引述《kobenein (哈哈哈)》之銘言: : 目前我已經可以用 svn log -l 1 這個指令抓到我要的東西 : 像是以下 : D:\Firmware\abc>svn log -l 1 : ------------------------------------------------------------------------ : r7611 | XXXXX@XXXXX | 2014-09-09 17:27:17 +0800 (週二, 09 九月 2014) | 1 : line : ------------------------------------------------------------------------ : 我想把 r7611這個字串拿來當成檔名 : 但一直試不成功 : 是不是只要cmd window印出來的東西都可以拿來用? : 謝謝 FOR /F "skip=1 tokens=1,2,3 delims=|" %a in ('svn log -l 1') do @echo %a, %b, %c 解釋一下,重點在 "skip=1 tokens=1,2,3 delims=|" skip=n 不要解析前n行,因為第一行是分隔線,我們把他濾掉 delims=| 用"|"來切token tokens=1,2,3 切出來的token,預設只會保留第一個,你可以多抓幾個欄位,這裡示範是抓前三個欄位 如果你想抓第一個與第三個欄位,就用tokens=1,3,後面調用時就是echo $a, %b 唉,還是 awk, sed 好用。 建議下載一套好用的 free unix tool: http://unxutils.sourceforge.net/ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 96.44.189.100 ※ 文章網址: http://www.ptt.cc/bbs/EZsoft/M.1411077382.A.870.html

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.
Scottish readers: Undecided about the referendum? Please read How the media shafted the people of Scotland and Scottish Independence, Power And Propaganda.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kkotgszvx368m 的頭像
    kkotgszvx368m

    【韓劇推薦】2016年8,韓劇看什麼呢?2016韓劇推薦好看的 , 2016韓劇推薦必看 , 2016韓劇 , 2016韓劇排行榜前十名 , 韓劇推薦 , 2016韓劇介紹 , 2016韓劇排行榜 , 2016韓劇列表 ,

    kkotgszvx368m 發表在 痞客邦 留言(0) 人氣()