Skip to content

Running script fails when using "set -e" because post increment #15

@mikuhno

Description

@mikuhno

If script is run using "set -e" it crashes on lines 177 ((LINE_NUM++)) and 193 ((SECTIONS_NUM++))
This is because post increment returns value (defaulted at 0) before addition and set -e reads this as false, returning error.

Related stackoverflow: here

Fix is easy enough as lines can be changed to use pre-increment ((++LINE_NUM)) and ((++SECTIONS_NUM))

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