#!/usr/bin/tcl## Replace string with another string -OR- include# only lines successfully modified with a regular# expression.#fconfigure stdout -translation binary -encoding binaryfconfigure stderr -translation binary -encoding binaryset mode [string tolower [lindex $argv 0]]set from [lindex $argv 1]set to [lindex $argv 2]if {-1 == [lsearch -exact [list exact regsub include] $mode]} {exit 1}if {[string length $from]==0} {exit 2}while {![eof stdin]} {set line [gets stdin]if {[eof stdin]} breakswitch -exact $mode {exact {set line [string map [list $from $to] $line]}regsub {regsub -all -- $from $line $to line}include {if {[regsub -all -- $from $line $to line]==0} continue}}puts stdout $line}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。