Adobe Flash
- 2 ответа
- 0 вопросов
1
Вклад в тег
file=`cat file`
echo "------- file -------"
echo "$file"
template="'cluster' => 'Cluster',"
replaceTo="$template\\
'version' => '1.0'"
result=`echo "$file" | sed 's/'"$template"'/'"$replaceTo"'/g'`
echo "------- result -------"
echo "$result"
------- file -------
"server" => [
{
"port" => "2200",
"ntf_port" => "22000",
"ip" => "10.10.10.10",
'role' => 'Client',
'cluster' => 'Cluster',
'ntf_sync' => true,
}
------- result -------
"server" => [
{
"port" => "2200",
"ntf_port" => "22000",
"ip" => "10.10.10.10",
'role' => 'Client',
'cluster' => 'Cluster',
'version' => '1.0',
'ntf_sync' => true,
}