看板 Editor 關於我們 聯絡資訊
※ 引述《AGanPTT (阿干)》之銘言: : 我有很多程式碼要轉換成html : 因為想保留高亮標記 : 但有上百個檔案 : 除了一個個開啟然後輸入:TOhtml以外有辦法一次大量處理嗎?? : 我是gVim #!/bin/sh rm -rf /tmp/tohtml mkdir /tmp/tohtml for thisFile in $( ls /tmp/source ); do vim -c 'set ft=javascript|syntax on' -c 'TOhtml' -c \ "w! /tmp/tohtml/"${thisFile}".html" -c \ 'qall!' /tmp/source/"${thisFile}" done exit 0 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.248.102.9
AGanPTT:不好意思 看不太懂= = 這個是什麼??要寫在哪?? 04/20 20:07
ya790206:linux系統下或有安裝sh的系統 04/20 21:21
AGanPTT:powershell 可以囉? 這應該是個腳本? 04/20 21:24
ya790206:是腳本沒錯,但我沒聽過powershell可執行,你可以試試看 04/20 21:28
AGanPTT:但我也不會用腳本= = powershell也不熟= = 04/20 21:37
ya790206:在windows下使用bash可以去找cygwin or mingw 04/20 23:28
LINGZ:不用shell script,windows下就改用batch,就算不會寫,用硬幹 04/21 11:00
LINGZ:方式也可以,主要的指令是vim -c那三行,可以把行尾 \ 去掉接 04/21 11:00
LINGZ:成一行,檔名自己指定. 04/21 11:01