Why can lxd not read from stdin?
root@vast-oyster:~# /snap/bin/lxd init --preseed < config.yml
Error: Failed to read from stdin: read /dev/stdin: permission denied
While cat does the right thing (config content abbreviated)
root@vast-oyster:~# cat < config.yml
config: {}
and this works as well:
root@vast-oyster:~# cat config.yml | /snap/bin/lxd init --preseed
Is that a bug or intended behavior?
Reason to use the first on is that shellchecker correctly complains about useless cat usage.
(ShellCheck: SC2002 – Useless cat. Consider `cmd < file | ..` or `cmd file | ..` instead.)