LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Change terminal title with bash script. (https://www.linuxquestions.org/questions/ubuntu-63/change-terminal-title-with-bash-script-907608/)

Amerika 10-11-2011 12:29 PM

Change terminal title with bash script.
 
Code:

#!/bin/bash
cd ../cooms3/
./run_something

Every time i run this bash script an terminal opens and the program runs further. The terminal has title "Terminal". I know i can change it manually, but can i change automatically everytime by adding some kinda line in the bash script?

Thanks for answers.

corp769 10-11-2011 12:45 PM

Hello,

To keep this simple.... http://www.google.com/#sclient=psy-a...w=1024&bih=584

Cheers,

Josh

David the H. 10-11-2011 12:47 PM

It might help if you gave us a few more details. What is purpose of the script? What exactly are these further commands the script runs? Most commands don't open up new consoles.

In principle, any command you can run in the shell can also be done inside a script. So how exactly do you change it "manually"? Do you perhaps mean through the features of the gui virtual console you use?

Most consoles honor the xtitle section of the PS1 prompt, if it exists, in their titlebar displays. So you probably just need to set the PS1 in your script.

Amerika 10-19-2011 02:06 PM

Quote:

Originally Posted by corp769 (Post 4495671)
Hello,

To keep this simple.... http://www.google.com/#sclient=psy-a...w=1024&bih=584

Cheers,

Josh

Found some scripts, but i dont understand them exactly right could you post the right one, because they have posted many kinds of script lines.
This is an script
It is for an counter strike 1.6 server.
Code:

#!/bin/bash
cd ../cooms3/
./hlds_run -game cstrike +ip 192.168.1.106 +port 2701 +maxplayers 21 +map de_aztec

What i do is click the .sh file and then press "Run in Terminal" And i need to add some kinda line in order to change the terminal title.


All times are GMT -5. The time now is 08:44 AM.