me-utils/src/vis.c

28 lines
371 B
C
Raw Normal View History

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "support.h"
int main(int argc, char **argv)
{
2022-09-06 22:23:51 +00:00
int c;
c = 0;
2022-09-06 22:23:51 +00:00
for(;(c = getchar()) != EOF;)
{
2022-09-06 22:23:51 +00:00
if(isascii(c) && !(c == ' ' || c == '\n' || c == '\t'))
{
2022-09-06 22:23:51 +00:00
putc(c, stdout);
}
else
{
2022-09-06 22:23:51 +00:00
fprintf(stdout, "%.3o", c);
}
}
return(0);
}