Add TODO and SUS-compliant yes.

master
Mid Favila 1 year ago
parent 7f0e2180a3
commit e3bc4a02e2
  1. 91
      TODO
  2. 54
      doc/echo.1
  3. 34
      doc/yes.1
  4. 13
      src/yes.c

91
TODO

@ -0,0 +1,91 @@
Write a Makefile.
Add octal escape support to echo.
Rework yes(1) to buffer input. This achieves greater throughput per system call.
Write the following utilities:
ar
at/atd
basename
batch(?)
bc
cal
cat
chgrp
chmod
chownn
cksum
cmp
comm
compress(?)
cp
crond/crontab
csplit
cut
dd
df
diff
dirname
du
ed/x
expand(?)
expr
file
find
fold
fuser
grep
head
iconv
id
join
kill
link(?)
ln
locale
localedef
logname
lp(?)
ls
mesg
mkdir
mkfifo
mknod
mktemp
more
mv
newgrp(?)
nice
nl
paste
pathchk(?)
pax
printf
ps
pwd
renice
rm
rmdir
sed
sh
sleep
sort
split
strings
tabs
tail
talk(?)
tee
test
touch
tput
tr
true
tsort
uname
uncompress(?)
unexpand
uniq
wc
who
write(?)
xargs

@ -0,0 +1,54 @@
.TH echo 1 2021-11-21 mp-utils Userland
.SH NAME
echo \- Print argv to stdout.
.PP
.SH SYNOPSIS
.PP
Print the provided arguments to stdout while applying
.SM
SUS
backslash escapes.
.SH DESCRIPTION
.PP
Echo is a standard Unix tool that accepts input from the user and prints it to stdout while applying minimal or no formatting.
.SH OPTIONS
.PP
This implementation of echo accepts no arguments.
.SH ENVIRONMENT
This implementation of echo requires a C89 compiler.
.SH FILES
/usr/src/mp-utils/src/echo.c
.SH CONFORMING TO
.PP
.SM
POSIX
2017,
.SM
SUS
3
.SH NOTES
.PP
Including the following backslash-escapes modifies echo's behavior.
\\a \- Print a BEL.
\\b \- Print a backspace.
\\f \- Print a form-feed.
\\f \- Print a newline.
\\r \- Print a carriage return.
\\t \- Print a tabulation.
\\v \- Print a vertical tabulation.
\\c \- Suppress the trailing newline and ignore further input.
.SH BUGS
.PP
Currently, \\0 (octal) escapes have not been implemented.
.SH SEE ALSO
echo(1p), printf(1)

@ -0,0 +1,34 @@
.TH yes 1 2021-11-21 mp-utils Userland
.SH NAME
yes \- print to stdout forever
.PP
.SH SYNOPSIS
.PP
Print the provided string to stdout forever.
.SH DESCRIPTION
.PP
Yes is a standard Unix tool that accepts input from the user and prints it to stdout repeatedly, or y when no input is provided.
.SH OPTIONS
.PP
This implementation of yes accepts no arguments.
.SH ENVIRONMENT
This implementation of yes requires a C89 compiler.
.SH FILES
/usr/src/mp-utils/src/yes.c
.SH CONFORMING TO
.PP
.SM
POSIX
2017,
.SM
SUS
3
.SH NOTES
.PP
None.
.SH BUGS
.PP
None known.
.SH SEE ALSO
yes(1p)

@ -0,0 +1,13 @@
#include "common.h"
int main(int argc, char **argv)
{
if(argc > 1)
while(1)
puts(argv[1]);
else
while(1)
puts("y");
return 0;
}
Loading…
Cancel
Save