Announcement

Collapse
No announcement yet.

[SOLVED] Environmental variables for SH and BASH scripts

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Environmental variables for SH and BASH scripts

    I'd like to see if anyone knows where I can find that info regarding the environmental variables for Linux (and KDE if needed or if they're also convenient and do exist).

    I only know about $HOME and that's pretty much all I know...
    Multibooting: Kubuntu Noble 24.04
    Before: Jammy 22.04, Focal 20.04, Precise 12.04 Xenial 16.04 and Bionic 18.04
    Win XP, 7 & 10 sadly
    Using Linux since June, 2008

    #2
    Re: Environmental variables for SH and BASH scripts

    There is a complete list of Bourne Shell and BASH variables in `The GNU Bash Reference Manual', Section 5, "Shell Variables". It is installable from the package bash-doc.

    I don't know where a complete list of KDE variables might be found.

    Edit

    If it is too inconvenient to install the manual locally, you can read it here.
    Welcome newbies!
    Verify the ISO
    Kubuntu's documentation

    Comment


      #3
      Re: Environmental variables for SH and BASH scripts

      Found by a simple web search with the terms "kde AND variables", first result.

      KDE System Administration/Environment Variables
      Welcome newbies!
      Verify the ISO
      Kubuntu's documentation

      Comment


        #4
        Re: Environmental variables for SH and BASH scripts

        To get a list of names marked for export:
        Code:
        $ export
        To get a complete list of names in the current environment:
        Code:
        $ declare
        More information on these commands in `The GNU Bash Reference Manual', Section 4 "Shell Builtin Commands".
        Welcome newbies!
        Verify the ISO
        Kubuntu's documentation

        Comment


          #5
          Re: Environmental variables for SH and BASH scripts

          When I want to see my environmental variables and what is assigned to them I open a Konsole and issue
          env
          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
          – John F. Kennedy, February 26, 1962.

          Comment


            #6
            Re: Environmental variables for SH and BASH scripts

            Originally posted by GreyGeek
            When I want to see my environmental variables and what is assigned to them I open a Konsole and issue
            env
            Neat

            Originally posted by info coreutils
            22.2 `env': Run a command in a modified environment
            . . .
            If no command name is specified following the environment
            specifications, the resulting environment is printed. This is like
            specifying the `printenv' program.
            Code:
            $ printenv --help
            Usage: printenv [VARIABLE]...
             or: printenv OPTION
            If no environment VARIABLE specified, print them all.
            More information in the coreutils info documentation, section 19.3.

            Code:
            info coreutils
            Welcome newbies!
            Verify the ISO
            Kubuntu's documentation

            Comment


              #7
              Re: Environmental variables for SH and BASH scripts

              Thanks for the info! At least I can tell you I can now use $PWD and $OLDPWD in any script. IDK what to do with the rest of them he he he.
              Multibooting: Kubuntu Noble 24.04
              Before: Jammy 22.04, Focal 20.04, Precise 12.04 Xenial 16.04 and Bionic 18.04
              Win XP, 7 & 10 sadly
              Using Linux since June, 2008

              Comment

              Working...
              X