Skip to content

SC2003 expr as octal to decimal converter #1910

Closed
@ChillerDragon

Description

@ChillerDragon

I try to increment numbers prefixed with zeros. I used expr to convert them to decimal. Because bash thinks they are octal:

$ x="0008"
$ echo "$((x + 1))"
-bash: 0008: value too great for base (error token is "0008")

$ echo "$(expr "$x" + 1)" # <- works but throws SC2003
9

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