I just have a recipe with content:
echo_example = shell_out("echo "line 1\nline 2")
if echo_example.exitstatus == 0 && echo_example
node.rm('test')
node.set['test'] = [echo_example.stdout.chomp]
end
Attribute output with knife is:
"test": [
"line 1\nline 2"
]
How to get this output using knife below?
"test": [
"line 1",
"line 2"
]
Thanks
I don't know if this is what you are looking for, but maybe you can split the output in the recipe, before putting it in the attribute. You can use
String#split
for this: