LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Hello,
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, 01:54 PM   #2
zXi
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, 02:02 PM   #3
alireza6485
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
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, 02:06 PM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,109

Rep: Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268
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: http://www.bo.infn.it/alice/alice-do...ex/node15.html
 
  


Reply


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 03:04 PM
[SOLVED] Make linux terminal transparent with terminal command? yooy Linux - Newbie 1 05-11-2010 04:24 AM
Sending anonymous emails from the Terminal memo007 Linux - Software 7 02-13-2007 06:21 PM
reading and sending to terminal inlogger Programming 4 02-09-2007 12:23 PM
Sending Data Bytes to a terminal jonty_11 Programming 8 03-28-2005 08:55 PM


All times are GMT -5. The time now is 04:42 AM.

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