Skip to content

Avoid using 'bc' binary in script for installing PowerShell7 on RHEL; instead use builtin shell features #11582

@dpareit

Description

@dpareit

Type of issue

Other (describe below)

Feedback

To avoid using the 'bc' binary, which might not be installed (and isn't by default) on a RHEL system, it would be better to use shell builtin features for arithmetic comparison and string manipulation:

Replace
if [ $(bc<<<"$VERSION_ID < 9") = 1 ]
by
if [ ${VERSION_ID%.*} -lt 9 ]
in the install script. (And similar for similar occurences in the script.)

Kind regards,
Daan

Page URL

https://learn.microsoft.com/en-us/powershell/scripting/install/install-rhel?view=powershell-7.4

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/install/install-rhel.md

Author

@sdwheeler

Document Id

53869d01-6b5a-9502-079c-516836f213e3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions