Execute script in new gnome-terminal loading bashrc












0















I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window.



I have tried to execute this commands:



gnome-terminal -x bash


the script above open a new shell and loads bashrc, but I don't know how to execute a script automatically.



gnome-terminal -x ./new_script.sh


the script above open a new shell and execute the script but doesn't load bashrc and close the window.





The result that I would like to obtain is to feel like opening a new terminal as clicking the term icon but execute a script after the bashrc setup.










share|improve this question














bumped to the homepage by Community 22 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window.



    I have tried to execute this commands:



    gnome-terminal -x bash


    the script above open a new shell and loads bashrc, but I don't know how to execute a script automatically.



    gnome-terminal -x ./new_script.sh


    the script above open a new shell and execute the script but doesn't load bashrc and close the window.





    The result that I would like to obtain is to feel like opening a new terminal as clicking the term icon but execute a script after the bashrc setup.










    share|improve this question














    bumped to the homepage by Community 22 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0


      1






      I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window.



      I have tried to execute this commands:



      gnome-terminal -x bash


      the script above open a new shell and loads bashrc, but I don't know how to execute a script automatically.



      gnome-terminal -x ./new_script.sh


      the script above open a new shell and execute the script but doesn't load bashrc and close the window.





      The result that I would like to obtain is to feel like opening a new terminal as clicking the term icon but execute a script after the bashrc setup.










      share|improve this question














      I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window.



      I have tried to execute this commands:



      gnome-terminal -x bash


      the script above open a new shell and loads bashrc, but I don't know how to execute a script automatically.



      gnome-terminal -x ./new_script.sh


      the script above open a new shell and execute the script but doesn't load bashrc and close the window.





      The result that I would like to obtain is to feel like opening a new terminal as clicking the term icon but execute a script after the bashrc setup.







      bash shell-script terminal gnome-terminal bashrc






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 '17 at 11:05









      CyrCyr

      1




      1





      bumped to the homepage by Community 22 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 22 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          gnome-terminal -e command


          or



          xterm -e command


          or



          konsole -e command


          Pretty much



          terminal -e command


          To make the terminal stay when the command exits:



          In konsole there is a --noclose flag.



          In xterm, there is a -hold flag.



          In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with



          gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command





          share|improve this answer


























          • Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

            – Cyr
            Jan 31 '17 at 11:32











          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%2f341431%2fexecute-script-in-new-gnome-terminal-loading-bashrc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          gnome-terminal -e command


          or



          xterm -e command


          or



          konsole -e command


          Pretty much



          terminal -e command


          To make the terminal stay when the command exits:



          In konsole there is a --noclose flag.



          In xterm, there is a -hold flag.



          In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with



          gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command





          share|improve this answer


























          • Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

            – Cyr
            Jan 31 '17 at 11:32
















          0














          gnome-terminal -e command


          or



          xterm -e command


          or



          konsole -e command


          Pretty much



          terminal -e command


          To make the terminal stay when the command exits:



          In konsole there is a --noclose flag.



          In xterm, there is a -hold flag.



          In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with



          gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command





          share|improve this answer


























          • Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

            – Cyr
            Jan 31 '17 at 11:32














          0












          0








          0







          gnome-terminal -e command


          or



          xterm -e command


          or



          konsole -e command


          Pretty much



          terminal -e command


          To make the terminal stay when the command exits:



          In konsole there is a --noclose flag.



          In xterm, there is a -hold flag.



          In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with



          gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command





          share|improve this answer















          gnome-terminal -e command


          or



          xterm -e command


          or



          konsole -e command


          Pretty much



          terminal -e command


          To make the terminal stay when the command exits:



          In konsole there is a --noclose flag.



          In xterm, there is a -hold flag.



          In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with



          gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 31 '17 at 11:35

























          answered Jan 31 '17 at 11:12









          Wissam RoujoulahWissam Roujoulah

          2,853517




          2,853517













          • Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

            – Cyr
            Jan 31 '17 at 11:32



















          • Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

            – Cyr
            Jan 31 '17 at 11:32

















          Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

          – Cyr
          Jan 31 '17 at 11:32





          Thanks! But I don't see the bashrc output when I run gnome-terminal -e ./new_script.sh --window-with-profile=my_profile. Have I forgotten something?

          – Cyr
          Jan 31 '17 at 11:32


















          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%2f341431%2fexecute-script-in-new-gnome-terminal-loading-bashrc%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

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt