当我尝试使用sed在OSX中插入新行时,我收到以下错误
在命令结尾处\后的额外字符
当前文件内容是
{
'localhost' => ['domain_name' => 'default', 'domain_type' => 'mobile'],
}
Run Code Online (Sandbox Code Playgroud)
预期的内容是
{
'localhost' => ['domain_name' => 'default', 'domain_type' => 'mobile'],
'dev.ops' => ['domain_name' => 'default', 'domain_type' => 'mobile'],
}
Run Code Online (Sandbox Code Playgroud)
我正在使用的命令是
sed -i '' "/localhost/a\ 'dev.ops' => ['domain_name' => 'default', 'domain_type' => 'web']," FILENAME
Run Code Online (Sandbox Code Playgroud)