who interpretes the environment variables

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default who interpretes the environment variables

    My question is does Operating system interpretes any environment
    variable for any purpose?? Or does it just see them as name-value
    pairs??




    One fact that I know is that OS is always aware that environment
    variables exists for example there are system calls to get, set,
    unset, clear the environment variables.



    But are they used by OS in any way??


    For example "PATH" variable is (probably) interpreted by shell and not
    by OS.


    Thanks and Regards,
    Ujjwal
    ujjwal bhoota Guest

  2. Similar Questions and Discussions

    1. Setting Environment Variables
      Greetings, My ColdFusion application has to act slightly differently depending on whether it is on the live server or the develop server. The...
    2. J2EE environment variables
      Hi all, I need to know how to set the J2EE environment variables. I can see that the JAVA_HOME environment variable is set, but i also need the...
    3. HTA environment variables?
      I have an HTA (HTML Application) that builds another HTA and (after writing it to disk via FSO) invokes MSHTA.EXE to run it. Is it possible to...
    4. Environment Variables - How to
      I'm wondering if there are such a command line/console version of setting the environment variables. Instead of using the GUI version, I'm used...
    5. setting environment variables in IIS
      Hi, How can I set up environment variables to be used in the script in IIS ? Thanks, Pradeep
  3. #2

    Default Re: who interpretes the environment variables


    "ujjwal bhoota" <ujjwalbhoota@yahoo.com> wrote in message
    news:98e0d8b3.0307091345.783a6cc3@posting.google.c om...
    > My question is does Operating system interpretes any environment
    > variable for any purpose?? Or does it just see them as name-value
    > pairs??
    It just sees them as strings and does not use them for any purpose, ever
    (that I'm aware of).
    > One fact that I know is that OS is always aware that environment
    > variables exists for example there are system calls to get, set,
    > unset, clear the environment variables.
    These are not system calls, they're library calls (libc).
    > But are they used by OS in any way??
    Nope.
    > For example "PATH" variable is (probably) interpreted by shell and not
    > by OS.
    Exactly.

    Cheers,
    Shaun


    Shaun Clowes Guest

  4. #3

    Default Re: who interpretes the environment variables

    In article <NA0Pa.267$Vw1.13656@news.optus.net.au>,
    "Shaun Clowes" <delius@no.spam.for.me.progsoc.org> writes:
    >
    > "ujjwal bhoota" <ujjwalbhoota@yahoo.com> wrote in message
    > news:98e0d8b3.0307091345.783a6cc3@posting.google.c om...
    >> My question is does Operating system interpretes any environment
    >> variable for any purpose?? Or does it just see them as name-value
    >> pairs??
    >
    > It just sees them as strings and does not use them for any purpose, ever
    > (that I'm aware of).
    >
    >> One fact that I know is that OS is always aware that environment
    >> variables exists for example there are system calls to get, set,
    >> unset, clear the environment variables.
    >
    > These are not system calls, they're library calls (libc).
    >
    >> But are they used by OS in any way??
    >
    > Nope.
    >
    >> For example "PATH" variable is (probably) interpreted by shell and not
    >> by OS.
    >
    > Exactly.
    There was a unix varient which allowed environment variables in
    symlinks (might have been Apollo, but not 100% sure). This required
    the kernel to obtain the environment variable expansion from the
    process accessing the link. I don't know the details of how it was
    implemented.

    --
    Andrew Gabriel
    Consultant Software Engineer
    Andrew Gabriel Guest

  5. #4

    Default Re: who interpretes the environment variables

    "Shaun Clowes" <delius@no.spam.for.me.progsoc.org> wrote in message news:<NA0Pa.267$Vw1.13656@news.optus.net.au>...
    > "ujjwal bhoota" <ujjwalbhoota@yahoo.com> wrote in message
    > news:98e0d8b3.0307091345.783a6cc3@posting.google.c om...
    > > My question is does Operating system interpretes any environment
    > > variable for any purpose?? Or does it just see them as name-value
    > > pairs??
    >
    > It just sees them as strings and does not use them for any purpose, ever
    > (that I'm aware of).
    >
    > > One fact that I know is that OS is always aware that environment
    > > variables exists for example there are system calls to get, set,
    > > unset, clear the environment variables.
    >
    > These are not system calls, they're library calls (libc).
    >
    > > But are they used by OS in any way??
    >
    > Nope.
    So the next question is "is OS at all aware of existence of
    env-variable or it just treate them as part of address space of
    process"
    For example consider following cases
    1. On fork os duplicates the address space of parent process, so all
    env-var also gets duplicated as side effect, without OS explicitly
    knowing about env-vars. So os is not aware of env-vars in this case.



    2. On exec the env-vars might be provided just like command line args,
    so it seems here that OS must put them near stack. BUT it do not have
    to be like that, for example after exec we can set env variable in
    user context by using functions like setenv(). So os is not aware of
    env-vars in this case also.

    Please correct me if I am wrong.

    -Ujjwal Bhoota

    >
    > > For example "PATH" variable is (probably) interpreted by shell and not
    > > by OS.
    >
    > Exactly.
    >
    > Cheers,
    > Shaun
    ujjwal bhoota Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139