why does exec env -i /bin/bash in .bash_profile go to background and exit when logging in via su - on...

In Stroustrup's example, what does this colon mean in `return 1 : 2`? It's not a label or ternary operator

Do I add modifiers to the Charisma check roll of 15 granted by the Glibness spell?

How long would it take for people to notice a mass disappearance?

Do publishers care if submitted work has already been copyrighted?

What are the advantages of luxury car brands like Acura/Lexus over their sibling non-luxury brands Honda/Toyota?

Copy previous line to current line from text file

Upside-Down Pyramid Addition...REVERSED!

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

Where in Bitcoin Core does it do X?

29er Road Tire?

Why does this derived table improve performance?

Adding command shortcuts to bin

IP addresses from public IP block in my LAN

Can my company stop me from working overtime?

Identifying characters

Decoupling cap routing on a 4 layer PCB

In Russian, how do you idiomatically express the idea of the figurative "overnight"?

How to adjust tikz picture so it fits to current size of a table cell?

Refinish or replace an old staircase

How can I get people to remember my character's gender?

Why is "breaking the mould" positively connoted?

Something that can be activated/enabled

My advisor talks about me to his colleague

Adjacent DEM color matching in QGIS



why does exec env -i /bin/bash in .bash_profile go to background and exit when logging in via su - on arch?


Will I be able to build LFS using dash and mawk?Why lfs couldn't use original host environment variables?cron ignores variables defined in “.bashrc” and “.bash_profile”There are stopped jobs (on bash exit)Why doesn't source work when I call bash -c6.7 Linux headers `make mrproper` fails in lfs 7.5How to prevent the caller's shell from being used in sudoBash - PS1 not Updating With Proper Hostname after Hostname Change in Scriptbash: cannot set terminal process group (-1): Inappropriate ioctl for deviceWhy does trap ERR behaviour differ over bash versions 3 and 4?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am following the LFS book and trying to get a clean shell using the following .bash_profile in arch (bash 5):



exec env -i HOME=$HOME TERM=$TERM PS1='u:w$ ' /bin/bash


What this usually does is allow logging in via:



su - lfs


But for some reason, the shell immediately exits and I get:



[1]+  Stopped                 su - lfs


I am able to get into the session using:



fg


But then I have to exit twice. The exec and env documentation seem to agree with the LFS provided command that this should just create a bash environment with the 3 variables in it (HOME, TERM, and PS1). How do I get it to just replace bash with the cleaner version and let me log in?










share|improve this question





























    0















    I am following the LFS book and trying to get a clean shell using the following .bash_profile in arch (bash 5):



    exec env -i HOME=$HOME TERM=$TERM PS1='u:w$ ' /bin/bash


    What this usually does is allow logging in via:



    su - lfs


    But for some reason, the shell immediately exits and I get:



    [1]+  Stopped                 su - lfs


    I am able to get into the session using:



    fg


    But then I have to exit twice. The exec and env documentation seem to agree with the LFS provided command that this should just create a bash environment with the 3 variables in it (HOME, TERM, and PS1). How do I get it to just replace bash with the cleaner version and let me log in?










    share|improve this question

























      0












      0








      0








      I am following the LFS book and trying to get a clean shell using the following .bash_profile in arch (bash 5):



      exec env -i HOME=$HOME TERM=$TERM PS1='u:w$ ' /bin/bash


      What this usually does is allow logging in via:



      su - lfs


      But for some reason, the shell immediately exits and I get:



      [1]+  Stopped                 su - lfs


      I am able to get into the session using:



      fg


      But then I have to exit twice. The exec and env documentation seem to agree with the LFS provided command that this should just create a bash environment with the 3 variables in it (HOME, TERM, and PS1). How do I get it to just replace bash with the cleaner version and let me log in?










      share|improve this question














      I am following the LFS book and trying to get a clean shell using the following .bash_profile in arch (bash 5):



      exec env -i HOME=$HOME TERM=$TERM PS1='u:w$ ' /bin/bash


      What this usually does is allow logging in via:



      su - lfs


      But for some reason, the shell immediately exits and I get:



      [1]+  Stopped                 su - lfs


      I am able to get into the session using:



      fg


      But then I have to exit twice. The exec and env documentation seem to agree with the LFS provided command that this should just create a bash environment with the 3 variables in it (HOME, TERM, and PS1). How do I get it to just replace bash with the cleaner version and let me log in?







      bash arch-linux lfs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 38 mins ago









      decuserdecuser

      16611




      16611






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f516888%2fwhy-does-exec-env-i-bin-bash-in-bash-profile-go-to-background-and-exit-when-l%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f516888%2fwhy-does-exec-env-i-bin-bash-in-bash-profile-go-to-background-and-exit-when-l%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...