shell语句修改txt文件或者sh文件
基本思路,使用正则表达式,找到目标,替换目标,保存文件
shell sed regular expression
regular expression
方案1:
runScSparkFilename="runScSpark.sh"sed -i "s/$search/$replace/" $filename
方案2:
$ cat /etc/syslog.conf | sed -n '/^[[:alpha:]]/p'
authpriv.* /var/log/secure