question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

input_filename is always <stdin>

See original GitHub issue

I would expect input_filename to work like it does in jq, with yq however it always outputs <stdin>.

Actual result:

$ yq 'input_filename' */problem.yaml
"<stdin>"
"<stdin>"
"<stdin>"
"<stdin>"
"<stdin>"
"<stdin>"

Expected result:

$ yq 'input_filename' */problem.yaml
"project_alpha/problem.yaml"
"project_zero/problem.yaml"
"questions/problem.yaml"
"research/problem.yaml"
"stuff/problem.yaml"
"test/problem.yaml"

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kislyukcommented, Apr 24, 2020

@qistoph please feel free to do that. However, I don’t think it will solve this issue unless you also want to design a protocol for naming all documents in a stream and passing the names of those documents as a list to jq.

1reaction
kislyukcommented, Apr 24, 2020

@vergenzt I am open to the design you describe in principle, as long as it’s not the default (since there are a lot more things that can potentially break with the fifo approach, I don’t want to make it the default for now).

Read more comments on GitHub >

github_iconTop Results From Across the Web

stdin(3) - Linux manual page - man7.org
The input stream is referred to as "standard input"; the output stream is referred to as "standard output"; and the error stream is...
Read more >
Unix/Linux Shell I/O Redirection (including stdin, stdout, stderr ...
The cp command must always have an input file name. It never reads file data from standard input. 7.2 Redirection of standard input...
Read more >
Why is STDIN_FILENO always zero? - Stack Overflow
When opened, the standard error stream is not fully buffered; the standard input and standard output streams are fully buffered if and only...
Read more >
Edge case - detecting input on STDIN in perl
The inner script RIGHTLY thinks there's input on STDIN , it's just that another file open got file descriptor 0 (which, to perl,...
Read more >
Programming in Lua : 21.1 - Lua.org
A call like io.input(filename) opens the given file (in read mode) and sets ... Moreover, write uses the current output file, whereas print...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found