LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   make a script that opens a specific terminal and enter commands into that terminal (https://www.linuxquestions.org/questions/linux-general-1/make-a-script-that-opens-a-specific-terminal-and-enter-commands-into-that-terminal-4175484094/)

jejuba 11-10-2013 08:05 AM

make a script that opens a specific terminal and enter commands into that terminal
 
Dear all,

I would like to run a program; the command to run that program is 'R'. I have a specific terminal with adequate properties (position, size, etc) to run that program on. Here is the script for that terminal

Code:

#!/bin/bash
#Give a name to the terminal window.
TITLE=termR
TERMOPTS="--hide-borders --hide-toolbars --hide-menubar --disable-server --title=$TITLE"

XDG_CONFIG_HOME=$HOME/.config3 xfce4-terminal $TERMOPTS --geometry=80x48+0+0 &

However, this script only opens the terminal window and then I have to type in the command 'R' to start the program. Nothing to cumbersome but still I was wondering if there was a way to open that terminal AND start the program.

I came across that previous thread:
http://www.linuxquestions.org/questi...rminal-358651/

with which I managed to open a standard terminal and the command R:
Code:

xfce4-terminal -e R
but this doesn't work and only opens the relevant terminal
Code:

~/myterminal -e R

so any idea how to do it?

thanks.

Firerat 11-10-2013 09:58 AM

untested

Code:

#!/bin/bash
#Give a name to the terminal window.
TITLE=termR
TERMOPTS="--hide-borders --hide-toolbars --hide-menubar --disable-server --title=$TITLE $@"

XDG_CONFIG_HOME=$HOME/.config3 xfce4-terminal $TERMOPTS --geometry=80x48+0+0 &


jejuba 11-10-2013 02:43 PM

Dear Fireat,

it doesn't work but you gave me a good idea and this is the script that does it for me:

Code:

#!/bin/bash
TITLE=termR
TERMOPTS="--hide-borders --hide-toolbars --hide-menubar --disable-server --title=$TITLE -e R"
XDG_CONFIG_HOME=$HOME/.config3 xfce4-terminal $TERMOPTS --geometry=80x48+0+0 &

so thank you very much.


All times are GMT -5. The time now is 06:20 PM.