3

I've been trying to learn to use jq and for bash it uses the <<< operator which I cannot understand after reading the bash documentation, what is this operator for?

Besides that, I use the fish shell instead. How can I translate jq . <<< '{"some": "xyz"}' (works in bash) to the fish shell?

1 Answer 1

5

The <<< operator is a here-string

3.6.7 Here Strings

Given:

[n]<<< word 

The word undergoes brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion and word splitting are not performed. The result is supplied as a single string, with a newline appended, to the command on its standard input (or file descriptor n if n is specified).

To translate this to fish shell you could likely do:

echo '{"some": "xyz"}' | jq 

(which would work in bash as well)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.