Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 661
  • Last Modified:

Configuring Gnome-Terminal

In ubuntu linux, I have a script that opens two terminals.  How do I print a seperate message into each terminal and put them into a specific directory?
!/bin/bash
gnome-terminal --geometry 90x26+200+10
gnome-terminal --geometry 30x8+700+500

Open in new window

0
tmonteit
Asked:
tmonteit
  • 5
  • 2
1 Solution
 
wesly_chenCommented:
> put them into a specific directory
gnome-terminal --geometry 90x26+200+10 --working-directory=/dir1
gnome-terminal --geometry 30x8+700+500 --working-directory=/dir2
0
 
wesly_chenCommented:
Here are some advanced usage of gnome-terminal
How to automate starting terminal instances for specific tasks
http://askubuntu.com/questions/2538/how-to-automate-starting-terminal-instances-for-specific-tasks

Customize and use Gnome Terminal profiles
http://ubuntuforums.org/showthread.php?t=1347856
0
 
José MéndezCommented:
To send messages to the consoles you may try to obtain the pts number for each console, for example if you run:

who am i
user    pts/3        2011-05-05 00:24 (:0.0)

Then you need to extract the pts/3, and use it like this:

echo "Your message" > /dev/pts/3

Hope it helps
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
tmonteitAuthor Commented:
I'm making progress...  The only problem is that when I try to display my message the window automatically closes.  

gnome-terminal -e "cat my-message.txt"  

How do I keep the window open with the bash-prompt after I display my-message?
0
 
wesly_chenCommented:
You need to create a new profile.
Open a terminal and select Edit -> Profiles. Add a new profile and name it 'term1'
Then edit the "term1" profile, in the "Title and Command" tag, in pull-down menu for "When command exits:" choose "Hold the terminal open".

Then
gnome-terminal --profile=term1

0
 
wesly_chenCommented:
Then create a script called /home/<user>/term1.sh
----- term1.sh -----
#!/bin/bash
echo "message....."
/bin/bash
-------

chmod +x term1.sh

Edit "term1" gnome-terminal profile, in the "Title and Command" tag, check "Run a custom command instead of my shell" and put
"/home/<user>/term1.sh into "Custom command:" filed.

Then
gnome-terminal --geometry 90x26+200+10 --profile=term1
0
 
tmonteitAuthor Commented:
worked perfect!!!
0
 
wesly_chenCommented:
Great.

If my 1st and 3rd comments helpful, please click on "yes" for those comments.
This will make the other subscribers easy to locate the solution.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now