我在这个文件中有这个文字:
test.php的
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'original',
'username' => 'root',
'password' => 'root',
'host' => 'localhost'
),
),
);
Run Code Online (Sandbox Code Playgroud)
在终端运行此行以用'new'替换'original'
sed -i 's/original/new/g' test.php
Run Code Online (Sandbox Code Playgroud)
更新:错误消息是:
sed:1:"test.php":未定义标签'est.php'
问题是什么?
更新2:
如果我只是运行:(我删除'-i')
sed 's/original/new/g' test.php
Run Code Online (Sandbox Code Playgroud)
我看到终端中修改了文件文本.但是文件没有保存.