I’m trying to replace "},"
by "}"
from the last line of a file :
My /etc/firefox/policies/policies.json
file like this because I added the certificate lines using a for
loop :
$ cat /etc/firefox/policies/policies.json
{
"policies": {
"Certificates": {
"Install": [
{"cert1.der", "/home/username/cert1.pem"},
{"cert2.der", "/home/username/cert2.pem"},
$
Please note there no "n"
at the end of this file (yet).
Before adding this to the end of my JSON file :
]
}
}
}
, how can I remove the last ,
: replacing “},” by “}” for example ?
sed
seems a complicated solution to do that, is there a more readable solution using awk
or perl
?