这是indexloc提供的服务,不要输入任何密码
Skip to content

Filter out shell set -$flag calls #34

@Neved4

Description

@Neved4

It's very frequent in scripts to enable set flags to avoid common pitfalls and make them more robust and safer:

#!/bin/sh

set -Cefu

# ...

At explainshell it can be clearly seen at a glance what each of these flags do:

Of these, -C doesn't exist in fish, and -e, -f, -u all have different meanings.

It'd be cool to filter them out from the output entirely.

My only concern would be set -- x y z constructs, that set elements to the builtin pseudo-array.

See also: POSIX.1-2017: §2.15 Special Built-In Utilities

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