[comp.unix.shell] Help with tput on HP9000 running UNIX

maklinm@cognos.UUCP (Maxwell Maklin) (06/24/91)

Can someone give me an example of how one uses tput on a HP/UX.
It seems tput does not accept positional parameters on-line with the command,
unlike the Berkley System V version.  It must have its parameters pushed
onto the stack and popped off using tparam.  This has all confused me as I 
have a csh script making extenisve use of the tput command running on Sun
platform and need to port it over to the the HP platform.  Just an example
would suffice.  For example, how would I specify the following

         tput cup 0 8
Thanks

Max

kevin@hpkslx.mayfield.HP.COM (Kevin Steves) (06/26/91)

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@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);
	}
}