Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Creating a new custom environment shell, inheriting most of bash.

  1. #11
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    384

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Hello hcvv,
    What I meant is an entire set of environment. Including the default paths for bash.

  2. #12
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,728

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Quote Originally Posted by SJLPHI View Post
    Hello hcvv,
    What I meant is an entire set of environment. Including the default paths for bash.
    Well, as explained above, every user can set (and set them again and again) when he wants:
    1. in his ~/.profile;
    2. by typing the new values in a command line;
    3. by putting the statement(s) in a file and "sourcing" them.

    They are just NAME=VALUE pairs that you should export to the environment (the exporting is only needed once).

    So either start a shell and when you want switch to the other environment "source" the file with statements.
    Or, as gogalthorpe advises, use diferent users, each with the appropriate statments in their ~/.profile.
    Or any combination you can imagine.

    Oh, about the "sourcing", which may be unknown to you.
    Let us assume two two files:
    Code:
    henk@boven:~/test/sjlphi> cat oldenv 
    PATH=/usr/oldbin:/oldbin:
    export LD_LIBRARY_PATH=/usr/oldlib:/usr/local/oldlib
    henk@boven:~/test/sjlphi>
    and
    Code:
    henk@boven:~/test/sjlphi> cat newenv 
    PATH=/usr/bin:/bin:
    export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
    henk@boven:~/test/sjlphi>
    I then can switch to oldenv with
    Code:
    . ~/test/sjlphi/oldenv
    and back to the newenv with
    Code:
    . ~/test/sjlphi/newenv
    Henk van Velden

  3. #13
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    384

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Hello hcvv,

    Quote Originally Posted by SJLPHI View Post
    hcvv,
    48sh,
    which would create reconfigure the paths so that I can avoid the conflicts altogether (as I am typing this, I am wondering to myself why I don't bother just writing a shell script that would set the environment on demand).
    I am aware or sourcing. I'm not understanding why such condescending comments are being thrown here? It's obvious I had a bit of a brain fart.

  4. #14
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,728

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Quote Originally Posted by SJLPHI View Post
    Hello hcvv,



    I am aware or sourcing. I'm not understanding why such condescending comments are being thrown here? It's obvious I had a bit of a brain fart.
    That is a bit harsh. We, at the other end of this forum communication line, can not realy assess what your knowledge level is. I only took the trouble to type a lot of lines in trying to help you. My time is too precious to create "condescending comments".

    I assume that you now are able tohelp yourself with the details. Good luck.
    Henk van Velden

  5. #15
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    384

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    hcvv,
    I am grateful to your, and others' comments on many topics. Not only this one but all of you helped me out more than once before. I just felt that it wasn't necessary to assume that I don't know how to source, script and etc. while the topic and previous statements I've made is about creating an entirely new shell similar to csh, zsh, and etc. which are beyond the knowledge or skill level of someone who cannot write a small environmental script.

    Obviously from this thread, it's totally unnecessary to create a new shell because we can just set up a profile for bash instead trying to create a new one which would be a lot more involved and time consuming. I admit, I had a brain fart, it was a dumb question.

    I do appreciate your input, but I don't always appreciate it if someone tells me that "about sourcing, which may be unknown to you".

  6. #16
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,728

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Well, IMHO "sourcing" instead of "calling" and the "why" of it (certainly in this case) is not often understood even by many shell script writers.

    And the creating of a new shell would not have helped you because it is not the shell, it are the environment variables that matter.
    Last edited by hcvv; 20-Jun-2019 at 12:03.
    Henk van Velden

  7. #17
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    384

    Default Re: Creating a new custom environment shell, inheriting most of bash.

    Quote Originally Posted by hcvv View Post
    Well, IMHO "sourcing" instead of "calling" and the "why" of it (certainly in this case) is not often understood even by many shell script writers.

    And the creating of a new shell would not have helped you because it is not the shell, it are the environment variables that matter.
    Yes, you are absolutely right. I just had a weird idea for a little bit. I am sorry if I've offended you.

Page 2 of 2 FirstFirst 12

Posting Permissions

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