美好的一天。奇怪的字符做改變後使用perl命令
讓說我的文件內容如下::
java ${AGENT_JAVAOPTS} -Xmx2560m com.xxx.xxx.xxx.AgentXX -inifile ${XXX_AGENT_INI} -queues winall,dustat,envstat,netstat,iostat,winconfig,netwarestat,netwareconfig,pawmin,paw15,db2,sqlserver,vmstatvmw2,vmstatvm2,netstatvm,netstatvmw,vmstatvm,vmstatvmw,iostatvm,iostatvmw,envstatvm,envstatvmw,vmscpu,vmsdisk,vmsmem,vmstatvcw,process,winprocess -log xxx0202.'$DotDate'.log -AgentName xxx0202
於是,我試圖改變字符串後 '-queue' 爲 「荃銀,工藝,winconfig,vmscpu,vmstat的,dustat」,這是我在UNIX使用以下命令::
perl -pi -e 'tr/winall,dustat,envstat,netstat,iostat,winconfig,netwarestat,netwareconfig,pawmin,paw15,db2,sqlserver,vmstatvmw2,vmstatvm2,netstatvm,netstatvmw,vmstatvm,vmstatvmw,iostatvm,iostatvmw,envstatvm,envstatvmw,vmscpu,vmsdisk,vmsmem,vmstatvcw,process,winprocess/winall,process,winconfig,vmscpu,vmstat,dustat/' file
然而,它產生一個奇怪的字符的輸出如下::
jaia ${AGENT_JAVAOPTS} -Xtxtt60t u,t.itt.ott.cotau,.At,ncDP -iniail, ${SRM_AGENT_INI} -tr,r,o winall,procac,,niocac,n,cocac,i,ocac,winu,nait,n,cwat,ocac,n,cwat,u,nait,tawtin,tawtt,ptt,otlo,ti,t,itocacitwt,itocacitt,n,cocacit,n,cocacitw,itocacit,itocacitw,i,ocacit,i,ocacitw,,niocacit,,niocacitw,itoutr,itopiot,itot,t,itocaciuw,tt,u,oo,wintt,u,oo -l,t tlp0t0t.'$D,cDac,'.l,t -At,ncNat, tlp0t0t
它如何產生像上面那樣的輸出?
輸出假設是因爲:
java ${AGENT_JAVAOPTS} -Xmx2560m com.xxx.xxx.xxx.AgentXX -inifile ${XXX_AGENT_INI} -queues winall,process,winconfig,vmscpu,vmstat,dustat -log xxx0202.'$DotDate'.log -AgentName xxx0202
需要幫助解決該問題。
如果以下任何答案對您的目標有所幫助,請通過在答案旁邊勾選正確的符號來接受/提出封閉答案。 –