Forrest logo
back to the cat tool

jello:tldr:1a000

jello: Output the value of a given key to a string (and disable JSON output).
$ cat ${file-json} | jello -r '"${some text}: " + _.${key_name}'
try on your machine

This command is a Unix shell command that performs a specific task. Here's an explanation of each part:

  1. cat ${file-json}: The cat command is used to display the contents of a file. ${file-json} represents a variable holding the filename (in JSON format) that you want to display. So, this part of the command retrieves the JSON content from the specified file and passes it to the next command.

  2. |: The pipe operator (|) is used to send the output of one command as the input to another command. In this case, it takes the output of the previous cat command and passes it as input to the next command.

  3. jello -r: jello is a command-line tool for manipulating JSON data. -r is an option that specifies a JavaScript expression to execute for each JSON object in the input.

  4. '"${some text}: " + _.${key_name}': This is the JavaScript expression that is passed to jello for evaluation. It concatenates the value of ${some text} (which is a variable) with the value of the property ${key_name} within each JSON object. The _. signifies the current JSON object being processed.

In summary, the command reads a JSON file (${file-json}), passes it to jello, and then executes a JavaScript expression for each JSON object. The expression concatenates some text with the value of a specific key within each JSON object.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cat tool