I am trying to make a JSON String but I am always getting an exception while validating the JSON String using any tool -
Below is my JSON String which I am not able to validate properly -
{"script":"#!/bin/bash hello=$jj1 echo $hello echo $jj1 echo $jj2 for el1 in $jj3 do echo \"$el1\" done for el2 in $jj4 do echo \"$el2\" done for i in $( ls ); do echo item: $i done"}
It is always giving me -
Invalid characters found.
What else I am supposed to escape?
Below is my shell script which I want to represent as JSON String -
#!/bin/bash
hello=$jj1
echo $hello
echo $jj1
echo $jj2
for el1 in $jj3
do
echo "$el1"
done
for el2 in $jj4
do
echo "$el2"
done
for i in $( ls ); do
echo item: $i
done
How do I use jackson or other libraries to make the above a valid JSON String.
getting an exception while validating the JSON String using any tool. Which tool did you use?