Results 1 to 4 of 4
Ok so I am interested in how can I open a new terminal and execute commands in that terminal with also keeping the previous one. For example lets say that ...
- 10-08-2010 #1Just Joined!
- Join Date
- Oct 2010
- Posts
- 6
Bash Script Help
Ok so I am interested in how can I open a new terminal and execute commands in that terminal with also keeping the previous one. For example lets say that I have a really simple script like this one
#!/bin/bash
echo "TESTING"
echo "TESTING2"
So what I want to happen is to output the first echo in the main terminal and then after this open a new terminal and output TESTING2 into the new terminal without closing the first one.
Also I would like to know if it is possible to somehow protect the source code of the script so that others cant still it... I mean something like compiling the script to linux executable files...
Thanks in advance -ac1dxtrem
- 10-08-2010 #2
Hi and welcome,
Even compiled files can be reverse engineered. The best protection is a well chosen license. In case one would do fraudulent copies, you could at least claim your copyrights. If you don't want that others see your code at all, just don't publish the code.Also I would like to know if it is possible to somehow protect the source code of the script so that others cant still it... I mean something like compiling the script to linux executable files...
It would depend on your window system how you open a new terminal. Once you know the command that opens the terminal (i.e. in gnome it is gnome-terminal), you can figure out how to pass arguments such that the opened terminal will invoke the command you want. Invoking another command is always something like:So what I want to happen is to output the first echo in the main terminal and then after this open a new terminal and output TESTING2 into the new terminal without closing the first one.
command (blocks at the invoker)
or
command & (does not block at the invoker)Last edited by Kloschüssel; 10-08-2010 at 09:03 AM.
- 10-08-2010 #3Just Joined!
- Join Date
- Oct 2010
- Posts
- 6
I figured the opening new shell problem but how can I execute a command in the new shell from the script that is running in the previous shell ?
- 10-08-2010 #4
You'll have to pass it to the newly created shell as an argument. How exactly that would have to look like depends ont he shell. For the gnome-terminal it would be something like:
gnome-terminal -x commandOrScript
Please read the manual pages for more information.


Reply With Quote