Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending message to myself

Status
Not open for further replies.

jjrrgg01

Programmer
Sep 25, 2001
7
AR
I am trying to send messages to myself, when I am online my crontab script detect in which terminal i am and then send to my device display a message and a ring, till all that is ok, but my trouble is that after the massage is displayed on my screen I have to hit a the enter key to get my prompt again, i did not find the way to be again in the prompt line after the message is displayed. The tip is that i need to see in a place of my screen a message with the output of my crontab script, meanwhile i keep having the control of my terminal doing other jobs ( i use an echo redirected to my terminal screen divice).
If someone know a way to get again my prompt line, tell me please is going to be to helfull for me, because i need the system to monitor communication channel meanwhile I am not infront or not of my terminal, if there is a trouble, it ring and ring alerting me, and then i start to investigate for a solution, all this is in order to be sure that everthing is going ok or not at any time.
thank you very much.

Julio - jjrrgg01 :)
 
Are you using a terminal, or a terminal emulator? Either way, it is possible to write to the "status line" in a terminal or terminal emulator. Let's say that your terminal is 24x80, the status line would be row 25, and is usually in reverse video, or in term emulators, the status line is often at the bottom of the window. Writing to the status line will depend on what your TERM type is set to, but basically, you proceed you message with some CTRL characters to tell the "terminal" where to put the message, then you send another set of CTRL characters to revert back to the normal screen. It should not mess with your prompt position. Can you post what type of terminal/emulator and TERM type you are using?

crowe
 
hi everybody, I am using a terminal emulator, TinyTERM Plus Edition, and when I type "echo $TERM" I get "ibm3151".
the script I made is simple, just to test, is the following:

#!/bin/ksh
date > /appl/USUARIOS/operador/pruebacron.txt
fecha=`date`
echo "\n" > /dev/pts/1
echo "Fecha: $fecha" > /dev/pts/1
echo "\n" > /dev/pts/1
echo "\r\r" > /dev/pts/1

if you have any comment that can help me, I thank you very much.

Julio - jjrrgg01 :)
 
the command 'tput tsl' should provide a control code to move your cursor to the status line, the command 'tput fsl' provides the control code to return back from the status line.

So, the script fragment

to_status_line=$(tput tsl)
from_status_line=$(tput fsl)
echo "$to_status_line hello world $from_status_line"

should display the string ' hello world ' on the status line of your terminal emulator, if it supports a status line that is. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
hi, Mike!
I have no luck, I added your lines to my script, but I could not retun to the status line in the terminal emulator TinyTERM Plus Edition, I was testing other commands with no luck, I am a little bit disappoint, if you have any help I will thank you very much.

Julio - jjrrgg01 :)
 
Julio,

Could you double check that TinyTERM supports the status line please? It might be something you have to turn on. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top