Skip to content

Requesto for new lint: Recommend uname -n in place of a plain hostname #3483

Description

@slatian

For new checks and feature suggestions

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

#!/bin/sh
printf "You are on host %s" "$(hostname)"

Here's what shellcheck currently says:

Nothing

Here's what I wanted to see:

Shellcheck should flag this use of hostname as non POSIX (see also issue #3468) and recommend uname -n instead (not that this does not include other usecases of the hostname command like setting the hostname).

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