Skip to content

variable.md 环境变量 vs 自定义变量(Shell变量) #27

@eagleoflqj

Description

@eagleoflqj

env或printenv输出的是环境变量,而BASHPID、BASHOPTS、PS1、PS2、RANDOM通常不属于环境变量,不会被printenv输出(其实UID也不会输出,但不知为何USER会),只能被set输出。
https://stackoverflow.com/questions/41931855/why-env-does-not-print-ps1-variable
https://askubuntu.com/questions/960551/why-arent-variables-like-ps1-in-printenv

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