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
Basic shell command works exactly the same in sh, bash and zsh (i.e producing the exact same output as input)
$ cat <<EOF{ "key1": "a simple text with an escaped doublequote \" in the text"}EOF
{
"key1": "a simple text with an escaped doublequote \" in the text"
}
but the following task prints different outputs:
version: '3'tasks:
test:
vars:
TEXT: | { "key1": "a simple text with an escaped doublequote \" in the text" }cmds:
- echo '{{.TEXT}}'
- | cat << EOF {{.TEXT}} EOF
Output: (do note the last entry not having an escaped doublequote)
$ task test
task: [test] echo '{
"key1": "a simple text with an escaped doublequote \" in the text"
}
'
{
"key1": "a simple text with an escaped doublequote \" in the text"
}
task: [test] cat << EOF
{
"key1": "a simple text with an escaped doublequote \" in the text"
}
EOF
{
"key1": "a simple text with an escaped doublequote " in the text"
}
I see this as 1 bug and 1 feature-request:
feature suggestion: apart of settings your command using the "sh:" key, add a "stdin" or "input" key to be a variable
cmds:
- sh: catstdin: TEXT
The text was updated successfully, but these errors were encountered:
@ninlil this indeed seems to be a bug in the upstream gosh project. I am going to open a bug report there.
gosh
$ cat << EOF
> test \" test
> EOF
test " test
bash
bash-3.2$ cat << EOF
> test \" test
> EOF
test \" test
bash-3.2$
You can workaround the issue using here-stringcat <<< {{.TEXT | shellQuote}}, which produce:
task: [test] cat <<< $'{\n "key1": "a simple text with an escaped doublequote \\" in the text"\n}\n'
{
"key1": "a simple text with an escaped doublequote \" in the text"
}
Basic shell command works exactly the same in sh, bash and zsh (i.e producing the exact same output as input)
but the following task prints different outputs:
Output: (do note the last entry not having an escaped doublequote)
I see this as 1 bug and 1 feature-request:
feature suggestion: apart of settings your command using the "sh:" key, add a "stdin" or "input" key to be a variable
The text was updated successfully, but these errors were encountered: