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
Here's a snippet or screenshot that shows the problem:
I managed to write something like this
#!/bin/sh
rmdir "/foo/bar"||true2> /dev/null
and only spotted the problem myself after the code was merged.
Here's what shellcheck currently says:
Nothing.
Here's what I wanted or expected to see:
Some warning about the /dev/null silencing being applied to a command that will never emit anything, and given the || true, was likely meant to be applied to the LHS command. So this is probably two feature requests (or easiest to do if considered like that): Output redirections applied to builtins like true, false, : are most likely useless, at least when the destination is also a known subject like /dev/null (true > file is not useless). And when a command is followed by || true , it is likely that any redirection of output applied to the RHS was meant to apply to the LHS.
The text was updated successfully, but these errors were encountered:
For bugs
shellcheck --version
or "online"):For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
I managed to write something like this
and only spotted the problem myself after the code was merged.
Here's what shellcheck currently says:
Nothing.
Here's what I wanted or expected to see:
Some warning about the /dev/null silencing being applied to a command that will never emit anything, and given the
|| true
, was likely meant to be applied to the LHS command. So this is probably two feature requests (or easiest to do if considered like that): Output redirections applied to builtins liketrue
,false
,:
are most likely useless, at least when the destination is also a known subject like/dev/null
(true > file
is not useless). And when a command is followed by|| true
, it is likely that any redirection of output applied to the RHS was meant to apply to the LHS.The text was updated successfully, but these errors were encountered: