Mail Archives: cygwin/2002/08/15/18:25:13
----- Original Message -----
From: <Bruce DOT A DOT Petro AT mail DOT sprint DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Tuesday, August 13, 2002 6:12 PM
Subject: OK, I'm a newbie in CYGWIN... How to do title?
> I promise, I checked the archives and docs and don't see anything on
> this...
>
> Can someone share how I perform the equivalent of the NT 'title'
> command on a CYGWIN window?? I've got 4-6 CYGWIN windows open - each
> tailing a certain log file. Only problem is its not obvious which
> window is which log file! What I need is to do something like:
> $title "Logfile1"
> tail -f logfile1.log
>
> Hey, while I've got your attention - one more question. Does anyone
> know where I can download (or compile) a version of sendtcp to run
> under NT (Sorry, can't run under CYGWIN, must run under NT scripts).
>
> THANKS!
> Bruce.
Here's a little routine that I found somewhere years ago...
Just compile it as
gcc -o title title.c
and put "title.exe" in your path...
It works for me whether I'm in a "standard bash console" window
or in an "rxvt" window.
--Mark
mstucky5 AT cox DOT net
------------------------ title.c -----------------------
#include <stdio.h>
/*
* This program takes the input string and puts it into the
* the xterm title. If you change the value of the first
* number in the printf statement, you can determine where
* the string will go. You can use either 0, 1, or 2. 0
* puts it in the title of the xterm; 1 puts it into the
* the icon name, and 2 does both.
*/
main(argc, argv)
int argc; char *argv[];
{
char buff[512];
argv++; argc--;
buff[0] = '\0';
while (argc--) {
strcat( buff, *argv++ );
strcat( buff, " " );
}
buff[strlen(buff)-1] = '\0';
printf( "%c]0;%s%c", (char)27, buff, (char)7 ); fflush(stdout);
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -