Skip to content

parsing failure #3400

@kmcdonell

Description

@kmcdonell

For bugs with existing features

  • Rule Id: SC1073
  • My shellcheck version: 0.9.0
  • [yes] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

Here's a snippet or screenshot that shows the problem:

#!/bin/sh
for a in -d -f
do
        [ $a foo ] && echo bar
done

Here's what shellcheck currently says:

In eek line 4:
[ $a foo ] && echo bar
^-- SC1073 (error): Couldn't parse this test expression. Fix to allow more checks.
^-- SC1072 (error): Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.

Here's what I wanted or expected to see:

Nothing, this is valid shell syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions