Help with tput on HP9000 running UNIX

Kevin Steves kevin at hpkslx.mayfield.HP.COM
Wed Jun 26 04:07:52 AEST 1991


tput(1) on HP-UX doesn't seem to allow parameters other than termtype and
capname.  The only solution I could come up with was this short program
which might solve your problem.


Kevin Steves
kevin at hpkslx.mayfield.hp.com
Hewlett-Packard
Response Center Lab

---------------------------------Cut Here-------------------------------
#include <stdlib.h>
#include <curses.h>
#include <term.h>

/* 
 * To compile: cc -o cup cup.c -lcurses
 */

char *tparm();

main(argc,argv)
int argc;
char **argv;
{
	if (argc == 3) {
		int row,col;
		row = atoi(argv[1]);
		col = atoi(argv[2]);
		setupterm(0,1,0);
		putp(tparm(cursor_address,row,col));
		resetterm();
		exit(0);
	}
	else {
		fprintf(stderr,"Usage: cup row col\n");
		exit(1);
	}
}



More information about the Comp.unix.shell mailing list