Skip to content

Failed to parse expression: "$((16#ffff))" decimal conversion #138

Closed
@fakuivan

Description

@fakuivan
#!/usr/bin/env bash
function to_decimal () {
    echo "$(("$1"#"$2"))"
}
to_decimal 16 ff

The function to_decimal converts the number "$2" in base "$1" to decimal. The parser fails to recognize this instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    grammar bugIssues related to the bash grammarquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions