title: Open a new terminal tab and run a command inside, only after open tab
body: <p>I'm trying to create a script to open a new tab at my rails project and run <code>rails s</code> inside this tab, to already start my server.</p>
  <p>My command:</p>
  <pre><code>xfce4-terminal --tab --title=&quot;rails server&quot; --working-directory=&quot;Documents/projects/rails_blog&quot; --command=&quot;bash -c 'rails s';bash&quot;
  </code></pre>
  <p>The new tab open at the correct directory.<br>
  But I always get this error:<br>
  <code>bash: rails: command not found</code></p>
  <p>I think that <code>rails s</code> is running before the new tab is opened</p>
  <p>or <code>--command</code> tag expect only bash commands. I don't know</p>
  <p>Why is that? And how can I solve this?</p>
  <p><strong>I already try all this answers below:</strong><br>
  <a href="https://superuser.com/questions/198015/open-gnome-terminal-programmatically-and-execute-commands-after-bashrc-was-execu">from superuser</a><br>
  <a href="https://stackoverflow.com/questions/1188959/open-a-new-tab-in-gnome-terminal-using-command-line">stackoverflow - Open a new tab in gnome-terminal using command line</a><br>
  <a href="https://unix.stackexchange.com/questions/158434/open-gnome-terminal-with-several-tabs-and-execute-a-few-commands-in-every-tab">from stackexchange</a><br>
  <a href="https://askubuntu.com/questions/315408/open-terminal-with-multiple-tabs-and-execute-application">from ask ubuntu - Open Terminal with multiple tabs and execute application</a><br>
  <a href="https://askubuntu.com/questions/102527/how-to-open-several-terminal-tabs-in-different-folders-working-directories">from ask ubuntu - How to open several Terminal Tabs in different folders (working directories)?</a></p>