repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
SYSENTER/SYSCALL support
[minix.git]
/
commands
/
yes
/
yes.c
blob
b05ad14af296f5f18a1c862ae3f522ce34678503
1
/* yes 1.4 - print 'y' or argv[1] continuously. Author: Kees J. Bot
2
* 15 Apr 1989
3
*/
4
#include <sys/types.h>
5
#include <stdlib.h>
6
#include <string.h>
7
#include <unistd.h>
8
9
int
main
(
int
argc
,
char
**
argv
)
10
{
11
char
*
yes
;
12
static char
y
[] =
"y"
;
13
int
n
;
14
15
yes
=
argc
==
1
?
y
:
argv
[
1
];
16
17
n
=
strlen
(
yes
);
18
19
yes
[
n
++]=
'
\n
'
;
20
21
while
(
write
(
1
,
yes
,
n
) != -
1
) {}
22
exit
(
1
);
23
}