]> git.ipfire.org Git - thirdparty/bash.git/blame - support/recho.c
Imported from ../bash-2.01.tar.gz.
[thirdparty/bash.git] / support / recho.c
CommitLineData
726f6388
JA
1#include <stdio.h>
2
d166f048
JA
3void strprint();
4
5int
726f6388
JA
6main(argc, argv)
7int argc;
8char **argv;
9{
10 register int i;
11
12 for (i = 1; i < argc; i++) {
13 printf("argv[%d] = <", i);
14 strprint(argv[i]);
15 printf(">\n");
16 }
d166f048 17 exit(0);
726f6388
JA
18}
19
d166f048 20void
726f6388
JA
21strprint(str)
22char *str;
23{
24 register char *s;
726f6388
JA
25
26 for (s = str; s && *s; s++) {
27 if (*s < ' ') {
28 putchar('^');
29 putchar(*s+64);
30 } else if (*s == 127) {
31 putchar('^');
32 putchar('?');
33 } else
34 putchar(*s);
35 }
36}