Skip to content

Commit

Permalink
Fix "ambiguous redirect" error in check/shellcheck
Browse files Browse the repository at this point in the history
On my system, running `check/shellcheck` results in an error:

```
check/shellcheck: line 33: 0: ambiguous redirect
```

The reason concerned the use of the shell `<(...)` construct. It seems
that with some combination of user Bash options, versions of Bash, and
possibly other factors, the output is not compatible with using a `<`
redirection; however, I was unable to figure out exactly why. I
ultimately resolved it by using a slightly different syntax for the
git/pipeline output and variable assignment.
  • Loading branch information
mhucka committed Feb 23, 2025
1 parent a2bf6e8 commit aa9c052
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check/shellcheck
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ for arg in "$@"; do
done

# Find all shell scripts in this repository.
IFS=$'\n' read -r -d '' -a our_shell_scripts < \
<(git ls-files -z -- \
IFS=$'\n' read -r -d '' -a our_shell_scripts <<< \
"$(git ls-files -z -- \
':(exclude)*.'{py,json,json_inward,repr,repr_inward,ipynb,txt,md} \
':(exclude)*.'{yaml,ts,tst,rst,pyi,cfg} | \
xargs -0 file | grep -i 'shell script' | cut -d: -f1)
xargs -0 file | grep -i 'shell script' | cut -d: -f1)"
# Verify our_shell_scripts array - require it must contain files below.
typeset -a required_shell_scripts
Expand Down

0 comments on commit aa9c052

Please sign in to comment.