Running a terminal from within a bash script

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
davidbow

Running a terminal from within a bash script

Post by davidbow »

Greetings to all
In order to make a program position independant I wish to run the following script.

#!/bin/bash
/usr/bin/mate-terminal
cd /home/david/C-Programs/Word-Programs
./target64

It opens the terminal OK but fails to execute the commands following in the now opened terminal.
How do I achieve this ?
( running Mint Mate 17 64 bit)

Another quick question - when using the launcher (Right mouse button) if "run in terminal" is chosen, I get the error message
"Failed to execute child process "xterm" (No such file or directory)" - which file is missing ?
Thanks
David
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Running a terminal from within a bash script

Post by Pilosopong Tasyo »

davidbow wrote:In order to make a program position independant I wish to run the following script.

#!/bin/bash
/usr/bin/mate-terminal
cd /home/david/C-Programs/Word-Programs
./target64

It opens the terminal OK but fails to execute the commands following in the now opened terminal.
How do I achieve this ?
To summarize, when you run a script file from the GUI, you want a terminal window to open and run the commands in the now-open terminal window, showing you any output and prompt you if more input is needed. You'll find this being discussed here. The TL;DR version is here.

HTH.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Locked

Return to “Scripts & Bash”