cat 2.txt | ./jq '{(.id): .custom}'
above command outputs
{
"1": {
"results": "Success"
}
}
{
"2": {
"input method": "touch",
"from": "Prescription Center",
}
}
{
"3": {
"entry point": "|All"
}
}
Expected output :
I want to print/save each object in a line.
cat 2.txt | ./jq '{(.id): .custom}'
{ "1": { "results": "Success" } }
{ "2": { "input method": "touch", "from": "Prescription Center" } }
{ "3": { "entry point": "|All" } }
will it be possible in shell script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…