Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As I understand you want gnome-terminal to open, have it execute some commands, and then drop to the prompt so you can enter some more commands. Gnome-terminal is not designed for this use case, but there are workarounds:</p> <h2>Let gnome-terminal run bash and tell bash to run your commands and then run bash</h2> <pre><code>$ gnome-terminal -e "bash -c \"echo foo; echo bar; exec bash\"" </code></pre> <p>The <code>exec bash</code> at the end is necessary because <code>bash -c</code> will terminate once the commands are done. <code>exec</code> causes the running process to be replaced by the new process, otherwise you will have two bash processes running.</p> <h2>Let gnome-terminal run bash with a prepared <code>rcfile</code> which runs your commands</h2> <p>Prepare <code>somercfile</code>:</p> <pre><code>source ~/.bashrc echo foo echo bar </code></pre> <p>Then run:</p> <pre><code>$ gnome-terminal -e "bash --rcfile somercfile" </code></pre> <h2>Let gnome-terminal run a script which runs your commands and then drops to bash</h2> <p>Prepare <code>scripttobash</code>:</p> <pre><code>#!/bin/sh echo foo echo bar exec bash </code></pre> <p>Set this file as executable.</p> <p>Then run:</p> <pre><code>$ gnome-terminal -e "./scripttobash" </code></pre> <p>Alternatively you can make a <code>genericscripttobash</code>:</p> <pre><code>#!/bin/sh for command in "$@"; do $command done exec bash </code></pre> <p>Then run:</p> <pre><code>$ gnome-terminal -e "./genericscripttobash \"echo foo\" \"echo bar\"" </code></pre> <hr> <p>Every method has it's quirks. You must choose, but choose wisely. I like the first solution for its verbosity and the straightforwardness.</p> <p>All that said, this might be of good use for you: <a href="http://www.linux.com/archive/feature/151340" rel="noreferrer">http://www.linux.com/archive/feature/151340</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload