I have a simple script:
DEV:
tasks:
- checkout: SOME / Repo
- script: |
#!/bin/bash
set -ex
echo '{"a":"b"}' | jq -M
But for some reason the last line is failing with the following error:
...
error 15-Feb-2022 19:29:33 + jq -M error 15-Feb-2022 19:29:33 + echo '{"a":"b"}' error 15-Feb-2022 19:29:33 jq - commandline JSON processor [version 1.5-1-a5b5cbe] error 15-Feb-2022 19:29:33 Usage: jq [options] <jq filter> [file...] error 15-Feb-2022 19:29:33 error 15-Feb-2022 19:29:33 jq is a tool for processing JSON inputs, applying the error 15-Feb-2022 19:29:33 given filter to its JSON text inputs and producing the error 15-Feb-2022 19:29:33 filter's results as JSON on standard output. error 15-Feb-2022 19:29:33 The simplest filter is ., which is the identity filter, error 15-Feb-2022 19:29:33 copying jq's input to its output unmodified (except for error 15-Feb-2022 19:29:33 formatting). error 15-Feb-2022 19:29:33 For more advanced filters see the jq(1) manpage ("man jq") error 15-Feb-2022 19:29:33 and/or https://stedolan.github.io/jq error 15-Feb-2022 19:29:33
...
It seems '|' should be somehow escaped. I tried to use \| but it doesn't work. What I'm doing wrong?
Hello @denis.kot
jq needs a filter. Try something like this:
echo '{"a":"b"}' | jq -M .
Eduardo Alvarenga
Atlassian Support APAC
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.