【发布时间】:2014-06-10 17:53:24
【问题描述】:
您好,我正在运行 bash 脚本来更改文本文件上的关键字,但它位于@我的远程主机 (10.101.5.91),我尝试使用此示例代码,但它不会更改该文件上的任何内容,也没有错误要显示。
changeConfig(){
shopt -s globstar
for file in $1
do
sed -i.bak 's/$2/$3/g' $file
done
}
remoteFunction(){
ssh ppuser@10.101.5.91 "`declare -f changeConfig`; changeConfig /var/www/file.txt
}
remoteFunction
谁能帮帮我?谢谢.... :)
【问题讨论】: