No es necesario sed
si todo lo que está haciendo es filtrar líneas según patrones. Para eso está grep
:
grep -iv '^[[:space:]]*"content"' < file.txt
grep -i
, a diferencia de ese indicador de dirección I
es estándar.
O si ese es un archivo JSON adecuado, puede usar una utilidad de análisis JSON como jq
para eliminar esa clave:
jq 'del(.properties.content)' < file.txt
Документы не очень ясны, но нам повезло со следующим:
routes:
- to: 224.0.0.0/4
via: 0.0.0.0
В Ubuntu 20.04, если вы настроите только to:
, вы получите предупреждение о:
Error in network definition: unicast route must include both a 'to' and 'via' IP
Предполагается, что маршрут является одноадресным маршрутом. Однако via
не требуется при добавлении многоадресного маршрута.
Правильная конфигурация:
ens224:
addresses:
- 192.160.0.1/24
routes:
- to: 224.0.0.0/4
scope: link
В результате будет добавлен следующий маршрут:
224.0.0.0/4 dev ens224 proto static scope link
scope:
описано в :http://manpages.ubuntu.com/manpages/focal/man5/netplan.5.htmlа точнее на :http://manpages.ubuntu.com/manpages/focal/man8/ip-route.8.html
scope SCOPE_VAL
the scope of the destinations covered by the route prefix. SCOPE_VAL may be
a number or a string from the file /etc/iproute2/rt_scopes. If this
parameter is omitted, ip assumes scope global for all gatewayed unicast
routes, scope link for direct unicast and broadcast routes and scope host
for local routes.