Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-15-2012, 12:43 PM   #1
LQ Newbie
Registered: May 2012
Posts: 5

Rep: Reputation: Disabled
Sending command from one terminal to another.

I am running a program in a terminal.
this program is just printing random words.
I can change the color of each word by entering the first character of the color(for example G for Green).
I want to write a bash code that runs in a different terminal and sends different characters to terminal 1 (the one showing the rectangle) to change the color automatically and constantly.

my word program is running in /dev/pts/1

i tried to do the following:

echo G > /dev/pts/1 , all it does is printing G in terminal 1. nothing happens to the color. how can I make it execute and change the color of the words?
Old 05-15-2012, 12:54 PM   #2
LQ Newbie
Registered: May 2012
Posts: 28

Rep: Reputation: Disabled
have you tried echo hello|grep --color=green > /dev/pts/1
Old 05-15-2012, 01:02 PM   #3
LQ Newbie
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Originally Posted by zXi View Post
have you tried echo hello|grep --color=green > /dev/pts/1
yeah and it did not work...
color is not the case... lets say if you press 1 it generates a word that starts with A.
my question is how can I make sure what i sent from terminal 2 is evaluated?
Old 05-15-2012, 01:06 PM   #4
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,786

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
I tried ls -l > /dev/pts/1 and all the colors transferred successfully.
So you need to know the terminal color codes and you can send them with that redirection too. You can have an overview here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize the terminal window from the command line in the gnome terminal QuIcKSpArK Linux - Newbie 5 04-21-2012 02:04 PM
[SOLVED] Make linux terminal transparent with terminal command? yooy Linux - Newbie 1 05-11-2010 03:24 AM
Sending anonymous emails from the Terminal memo007 Linux - Software 7 02-13-2007 05:21 PM
reading and sending to terminal inlogger Programming 4 02-09-2007 11:23 AM
Sending Data Bytes to a terminal jonty_11 Programming 8 03-28-2005 07:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration