You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to process the output of cronnext using tools like yq. The output that cronnext gives is mostly YAML-like, but not entirely so.
This crontab line:
15 17 * * * echo "Out of my brain on the train" > /tmp/foo.log
gets printed by cronnext as:
next: 1726006500
nextjobs:
- user: alester
cmd: "echo "Out of my brain on the train" > /tmp/foo.log"
flags: 0x0C
flagnames: DOM_STAR|DOW_STAR
delay: 0
next: 1726006500
nextstring: Tue Sep 10 17:15:00 2024
but a tool like yq can't parse that because the double quotes in the cmd: value aren't escaped. It would be fine if it was:
next: 1726006500nextjobs:
- user: alestercmd: "echo \"Out of my brain on the train\" > /tmp/foo.log"flags: 0x0Cflagnames: DOM_STAR|DOW_STARdelay: 0next: 1726006500nextstring: Tue Sep 10 17:15:00 2024
I understand that nowhere does cronnext say that its output is YAML, and it would be great if it could be made so. If you didn't want to change the output because existing tools that use the output could break, an optional --yaml option to make the strict YAML format output would work, too.
I don't know what other things might have to change in the output to be correct YAML. I know there are a bunch of special characters and sequences that need to be escaped, but I don't know the full list. I figure there are plenty of libraries out there to do the dirty work.
The text was updated successfully, but these errors were encountered:
I'd like to process the output of cronnext using tools like
yq
. The output that cronnext gives is mostly YAML-like, but not entirely so.This crontab line:
gets printed by cronnext as:
but a tool like
yq
can't parse that because the double quotes in the cmd: value aren't escaped. It would be fine if it was:I understand that nowhere does
cronnext
say that its output is YAML, and it would be great if it could be made so. If you didn't want to change the output because existing tools that use the output could break, an optional--yaml
option to make the strict YAML format output would work, too.I don't know what other things might have to change in the output to be correct YAML. I know there are a bunch of special characters and sequences that need to be escaped, but I don't know the full list. I figure there are plenty of libraries out there to do the dirty work.
The text was updated successfully, but these errors were encountered: