printcap questions

Simon Kenyon simon at einode.UUCP
Sat Nov 29 01:04:44 AEST 1986


ins_ajbh at jhunix.UUCP (JABBA the HUT):
> I want to enable Ctrl-S, Ctrl-Q flow control with
> the ability to pass escape strings AND have it do the
> XTABS expansion. I tried a couple combinations of raw
> and cbreak and no dice. Does anyone have a handy 
> combination of xs,xc,fs,fc to do the job?. If not I
> can use the filter option of printcap to do the tab
> expansion and run in raw mode since I have to prefix the
> ESC string onto the data anyway.

this works file for me:
cat >/etc/printcap.simon <<End-Of-File
lp|line printer:\
	:br#9600:\
	:fc#0177777:\
	:fs#0000002:\
	:lf=/usr/adm/lpd-errs:\
	:lp=/dev/whatever:\
	:of=/usr/local/sf:\
	:sd=/usr/spool/lpd:\
	:sh:\
	:xc#0177777:\
	:xs#0000040:
End-Of-File
cat >sf.c <<End-Of-File
#include <stdio.h>

main()
{
	register int c, column;

	column = 0;
	while ((c = getchar()) != EOF)
		switch (c) {
		case '\t':
			do {
				putchar(' ');
				column++;
			} while (column & 07);
			break;
		case '\b':
			if (column)
				column--;
			putchar('\b');
			break;
		case '\n':
			putchar('\r');
			putchar('\n');
			column = 0;
			break;
		default:
			putchar(c);
			column++;
			break;
		}
	exit(0);
End-Of-File
-- 
Simon Kenyon
EUnet: simon at einode.UUCP
Smail: The National Software Centre, Dublin, IRELAND
Phone: +353-1-716255



More information about the Comp.unix.wizards mailing list