I'd like to add a comma after } except the last one } Tried Google but can't find the answer.
Example as below:
From
{
"{#SERVICES} ,": "Directory",
"{#STATUS}": "RUNNING"
}
{
"{#SERVICES}": "krb5kdc",
"{#STATUS}": "RUNNING"
}
{
"{#SERVICES}": "kadmin",
"{#STATUS}": "RUNNING"
}
{
"{#SERVICES}": "named",
"{#STATUS}": "RUNNING"
}
{
"{#SERVICES}": "httpd",
"{#STATUS}": "RUNNING"
}
To
{
"{#SERVICES} ,": "Directory",
"{#STATUS}": "RUNNING"
},
{
"{#SERVICES}": "krb5kdc",
"{#STATUS}": "RUNNING"
},
{
"{#SERVICES}": "kadmin",
"{#STATUS}": "RUNNING"
},
{
"{#SERVICES}": "named",
"{#STATUS}": "RUNNING"
},
{
"{#SERVICES}": "httpd",
"{#STATUS}": "RUNNING"
}
Please let me know if you have any questions.
Thanks!!
question from:
https://stackoverflow.com/questions/65931347/add-a-comma-to-every-curly-bracket-except-the-last-curly-bracket-in-shell-awk-se 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…