I have a variable, X, in a bash script that has a value like asw|uduu|sssdd. How can I convert it to a JSON array using jq?
A second variable, Y, has a value like A:1|B:1|C:1. How can I convert it to a JSON object using jq?
Please help me solve these conversion tasks.