logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git
commit: 434e2601724bb5bcbc5d73850621c87a8423ab32
parent 7144d0a4d2318bc29e9919b7e281dab895cb58a9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  8 Sep 2024 00:21:32 +0200

oasis db855feea2

Diffstat:

Abin/cal0
Abin/cols0
Abin/comm0
Abin/cp0
Abin/cron0
Abin/dd0
Abin/du0
Abin/ed0
Abin/egrep2++
Abin/expand0
Abin/find0
Abin/flock0
Abin/fold0
Abin/getconf0
Abin/grep0
Abin/hostname0
Abin/kill0
Abin/logger0
Abin/ls0
Abin/md5sum0
Abin/nl0
Abin/od0
Abin/paste0
Abin/printenv0
Abin/renice0
Abin/rev0
Abin/sed0
Abin/setsid0
Abin/sha224sum0
Abin/sha256sum0
Abin/sha384sum0
Abin/sha512-224sum0
Abin/sha512-256sum0
Abin/sha512sum0
Abin/sort0
Abin/sponge0
Abin/tail0
Abin/tftp0
Abin/tsort0
Abin/unexpand0
Abin/uudecode0
Abin/uuencode0
Abin/whoami0
Abin/xargs0
Ashare/man/man1/cal.172++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/cols.156++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/comm.144++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/cp.175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/cron.120++++++++++++++++++++
Ashare/man/man1/dd.191+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/du.161+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/ed.1241+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/expand.151+++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/find.1144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/flock.135+++++++++++++++++++++++++++++++++++
Ashare/man/man1/fold.143+++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/getconf.160++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/grep.198+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/hostname.118++++++++++++++++++
Ashare/man/man1/kill.147+++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/logger.156++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/ls.199+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/md5sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/nl.1120+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/od.183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/paste.151+++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/printenv.130++++++++++++++++++++++++++++++
Ashare/man/man1/renice.142++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/rev.122++++++++++++++++++++++
Ashare/man/man1/sed.1157+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/setsid.118++++++++++++++++++
Ashare/man/man1/sha224sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sha256sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sha384sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sha512-224sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sha512-256sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sha512sum.132++++++++++++++++++++++++++++++++
Ashare/man/man1/sort.1102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/sponge.119+++++++++++++++++++
Ashare/man/man1/tail.155+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/tftp.132++++++++++++++++++++++++++++++++
Ashare/man/man1/tsort.174++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/unexpand.145+++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/uudecode.150++++++++++++++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/uuencode.138++++++++++++++++++++++++++++++++++++++
Ashare/man/man1/whoami.19+++++++++
Ashare/man/man1/xargs.197+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
87 files changed, 2581 insertions(+), 0 deletions(-)

diff --git a/bin/cal b/bin/cal Binary files differ. diff --git a/bin/cols b/bin/cols Binary files differ. diff --git a/bin/comm b/bin/comm Binary files differ. diff --git a/bin/cp b/bin/cp Binary files differ. diff --git a/bin/cron b/bin/cron Binary files differ. diff --git a/bin/dd b/bin/dd Binary files differ. diff --git a/bin/du b/bin/du Binary files differ. diff --git a/bin/ed b/bin/ed Binary files differ. diff --git a/bin/egrep b/bin/egrep @@ -0,0 +1,2 @@ +#!/bin/rc +exec grep -E $* diff --git a/bin/expand b/bin/expand Binary files differ. diff --git a/bin/find b/bin/find Binary files differ. diff --git a/bin/flock b/bin/flock Binary files differ. diff --git a/bin/fold b/bin/fold Binary files differ. diff --git a/bin/getconf b/bin/getconf Binary files differ. diff --git a/bin/grep b/bin/grep Binary files differ. diff --git a/bin/hostname b/bin/hostname Binary files differ. diff --git a/bin/kill b/bin/kill Binary files differ. diff --git a/bin/logger b/bin/logger Binary files differ. diff --git a/bin/ls b/bin/ls Binary files differ. diff --git a/bin/md5sum b/bin/md5sum Binary files differ. diff --git a/bin/nl b/bin/nl Binary files differ. diff --git a/bin/od b/bin/od Binary files differ. diff --git a/bin/paste b/bin/paste Binary files differ. diff --git a/bin/printenv b/bin/printenv Binary files differ. diff --git a/bin/renice b/bin/renice Binary files differ. diff --git a/bin/rev b/bin/rev Binary files differ. diff --git a/bin/sed b/bin/sed Binary files differ. diff --git a/bin/setsid b/bin/setsid Binary files differ. diff --git a/bin/sha224sum b/bin/sha224sum Binary files differ. diff --git a/bin/sha256sum b/bin/sha256sum Binary files differ. diff --git a/bin/sha384sum b/bin/sha384sum Binary files differ. diff --git a/bin/sha512-224sum b/bin/sha512-224sum Binary files differ. diff --git a/bin/sha512-256sum b/bin/sha512-256sum Binary files differ. diff --git a/bin/sha512sum b/bin/sha512sum Binary files differ. diff --git a/bin/sort b/bin/sort Binary files differ. diff --git a/bin/sponge b/bin/sponge Binary files differ. diff --git a/bin/tail b/bin/tail Binary files differ. diff --git a/bin/tftp b/bin/tftp Binary files differ. diff --git a/bin/tsort b/bin/tsort Binary files differ. diff --git a/bin/unexpand b/bin/unexpand Binary files differ. diff --git a/bin/uudecode b/bin/uudecode Binary files differ. diff --git a/bin/uuencode b/bin/uuencode Binary files differ. diff --git a/bin/whoami b/bin/whoami Binary files differ. diff --git a/bin/xargs b/bin/xargs Binary files differ. diff --git a/share/man/man1/cal.1 b/share/man/man1/cal.1 @@ -0,0 +1,72 @@ +.Dd 2015-10-08 +.Dt CAL 1 +.Os sbase +.Sh NAME +.Nm cal +.Nd show calendar +.Sh SYNOPSIS +.Nm +.Op Fl 1 | Fl 3 | Fl y | Fl n Ar num +.Op Fl s | Fl m | Fl f Ar num +.Op Fl c Ar num +.Oo Oo Ar month Oc Ar year Oc +.Sh DESCRIPTION +.Nm +writes a calendar of +.Ar month +and +.Ar year +or the current month to stdout. +If +.Ar year +is given without +.Ar month , +.Nm +writes a 3-column calendar of the whole +year to stdout. +The date formatting is according to +.Xr localtime 3 . +.Pp +The Julian calendar is used until Sep 2, 1752. +The Gregorian calendar is used starting the next day on Sep 14, 1752. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl 1 +Print current month. +This is the default. +.It Fl 3 +Print previous, current and next month. +.It Fl c Ar num +Print +.Ar num +calendars in a row. +The default is 3. +.It Fl f Ar num +Set +.Ar num +(0 is Sunday, 6 is Saturday) as first day of week. +.It Fl m +Set Monday as first day of week. +.It Fl n Ar num +Output +.Ar num +months starting from and including the current month. +.It Fl s +Set Sunday as first day of week. +.It Fl y +Print the entire +.Ar year +or current year. +.El +.Sh SEE ALSO +.Xr localtime 3 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The flags +.Op Fl 13cfmnsy +are an extension to that specification. diff --git a/share/man/man1/cols.1 b/share/man/man1/cols.1 @@ -0,0 +1,56 @@ +.Dd 2015-10-08 +.Dt COLS 1 +.Os sbase +.Sh NAME +.Nm cols +.Nd columnize output +.Sh SYNOPSIS +.Nm +.Op Fl c Ar num +.Op Ar file ... +.Sh DESCRIPTION +.Nm +reads each +.Ar file +in sequence and writes them to stdout, in as many vertical +columns as will fit in +.Ar num +character columns. +If no +.Ar file +is given, +.Nm +reads from stdin. +.Pp +By default +.Nm cols +tries to figure out the width of the output device. +If that fails, it defaults to 65 chars. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c Ar num +Set maximum number of character columns to +.Ar num , +unless input lines exceed this limit. +.El +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It COLUMNS +The width of the output device. +.El +.Sh HISTORY +.Nm +is similar to +.Xr mc 1 +in Plan 9. It was renamed to +.Nm +to avoid the name collision with the popular file manager +Midnight Commander. +.Sh CAVEATS +This implementation of +.Nm +assumes that each UTF-8 code point occupies one character cell, +and thus mishandles TAB characters (among others). +.Pp +.Nm +currently mangles files which contain embedded NULs. diff --git a/share/man/man1/comm.1 b/share/man/man1/comm.1 @@ -0,0 +1,44 @@ +.Dd 2015-10-08 +.Dt COMM 1 +.Os sbase +.Sh NAME +.Nm comm +.Nd select or reject lines common to two files +.Sh SYNOPSIS +.Nm +.Op Fl 123 +.Ar file1 +.Ar file2 +.Sh DESCRIPTION +.Nm +reads +.Ar file1 +and +.Ar file2, +which should both be sorted lexically, and writes three text columns +to stdout: +.Bl -tag -width Ds +.It 1 +Lines only in +.Ar file1 . +.It 2 +Lines only in +.Ar file2 . +.It 3 +Common lines. +.El +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl 1 | Fl 2 | Fl 3 +Suppress column 1 | 2 | 3 +.El +.Sh SEE ALSO +.Xr cmp 1 , +.Xr sort 1 , +.Xr uniq 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/cp.1 b/share/man/man1/cp.1 @@ -0,0 +1,75 @@ +.Dd 2015-10-08 +.Dt CP 1 +.Os sbase +.Sh NAME +.Nm cp +.Nd copy files and directories +.Sh SYNOPSIS +.Nm +.Op Fl afpv +.Oo +.Fl R +.Op Fl H | L | P +.Oc +.Ar source ... +.Ar dest +.Sh DESCRIPTION +.Nm +copies +.Ar source +to +.Ar dest . +If more than one +.Ar source +is given +.Ar dest +has to be a directory. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a +Preserve block devices, character devices, sockets and FIFOs. +Implies +.Fl p , +.Fl P +and +.Fl R . +.It Fl f +If an existing +.Ar dest +cannot be opened, remove it and try again. +.It Fl p +Preserve mode, timestamp and permissions. +.It Fl v +Write "'source' -> 'dest'" for each +.Ar source +to stdout. +.It Fl H +Dereference +.Ar source +if it is a symbolic link. +.It Fl L +Dereference all symbolic links. +This is the default without +.Fl R . +.It Fl P +Preserve symbolic links. +This is the default with +.Fl R . +.It Fl R +Traverse directories recursively. +If this flag is not specified, directories are not copied. +.El +.Sh SEE ALSO +.Xr mv 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification except from the +.Op Fl i +flag. +.Pp +The +.Op Fl av +flags are an extension to that specification. diff --git a/share/man/man1/cron.1 b/share/man/man1/cron.1 @@ -0,0 +1,20 @@ +.Dd 2015-10-08 +.Dt CRON 1 +.Os sbase +.Sh NAME +.Nm cron +.Nd clock daemon +.Sh SYNOPSIS +.Nm +.Op Fl f Ar file +.Sh DESCRIPTION +.Nm +schedules commands to be run at specified dates and times. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl f Ar file +Use the specified +.Ar file +instead of the default +.Pa /etc/crontab . +.El diff --git a/share/man/man1/dd.1 b/share/man/man1/dd.1 @@ -0,0 +1,91 @@ +.Dd 2020-04-28 +.Dt DD 1 +.Os sbase +.Sh NAME +.Nm dd +.Nd convert and copy a file +.Sh SYNOPSIS +.Nm +.Op Ar operand Ns ... +.Sh DESCRIPTION +.Nm +copies its input to its output, possibly after conversion, using +the specified block sizes, +.Pp +The following operands are available: +.Bl -tag -width ibs=expr +.It Cm if= Ns Ar file +Read from the file named by +.Ar file +instead of standard input. +.It Cm of= Ns Ar file +Write to the file named by +.Ar file +instead of standard output. +.It Cm ibs= Ns Ar expr +Set the input block size to +.Ar expr +(defaults to 512). +.It Cm obs= Ns Ar expr +Set the output block size to +.Ar expr +(defaults to 512). +.It Cm bs= Ns Ar expr +Set the input and output block sizes to +.Ar expr . +Additionally, if no conversion other than +.Cm noerror , +.Cm notrunc , +or +.Cm sync +is specified, input blocks are copied as single output blocks, even +when the input block is short. +.It Cm skip= Ns Ar n +Skip +.Ar n +input blocks before starting to copy. +.It Cm seek= Ns Ar n +Skip +.Ar n +output blocks before starting to copy. +.It Cm count= Ns Ar n +Copy at most +.Ar n +input blocks. +.It Cm conv= Ns Ar value Ns Op , Ns Ar value Ns ... +Apply the conversions specified by +.Ar value . +.Bl -tag -width Ds +.It Cm lcase +Map uppercase characters to the corresponding lowercase character +using +.Fn tolower . +.It Cm ucase +Map lowercase characters to the corresponding uppercase character +using +.Fn toupper . +.It Cm swab +Swap each pair of bytes in the input block. +If there is an odd number of bytes in a block, the last one is +unmodified. +.It Cm noerror +In case of an error reading from the input, do not fail. +Instead, print a diagnostic message and a summary of the current +status. +.It Cm notrunc +Do not truncate the output file. +.It Cm sync +In case of a partial input block, pad with null bytes to form a +complete block. +.El +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2008 +specification, except that it does not implement the +.Cm block +and +.Cm unblock +conversions. diff --git a/share/man/man1/du.1 b/share/man/man1/du.1 @@ -0,0 +1,61 @@ +.Dd 2015-10-08 +.Dt DU 1 +.Os sbase +.Sh NAME +.Nm du +.Nd display disk usage statistics +.Sh SYNOPSIS +.Nm +.Op Fl a | s +.Op Fl d Ar depth +.Op Fl h +.Op Fl k +.Op Fl H | L | P +.Op Fl x +.Op Ar file ... +.Sh DESCRIPTION +.Nm +displays the file system block usage for each +.Ar file +argument and for each directory in the file hierarchy rooted in directory +argument. +If no +.Ar file +is specified, the block usage of the hierarchy rooted in the current directory +is displayed. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a +Display an entry for each file in the file hierarchy. +.It Fl s +Display only the grand total for the specified files. +.It Fl d Ar depth +Maximum directory depth to print files and directories. +.It Fl h +Enable human-readable output. +.It Fl k +By default all sizes are reported in 512-byte block counts. +The +.Fl k +option causes the numbers to be reported in kilobyte counts. +.It Fl H +Only dereference symbolic links that are passed as command line arguments when +recursively traversing directories. +.It Fl L +Always dereference symbolic links while recursively traversing directories. +.It Fl P +Don't dereference symbolic links. +This is the default. +.It Fl x +Do not traverse file systems mount points. +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl dhP +flags are an extension to that specification. diff --git a/share/man/man1/ed.1 b/share/man/man1/ed.1 @@ -0,0 +1,241 @@ +.Dd 2016-12-27 +.Dt ED 1 +.Os sbase +.Sh NAME +.Nm ed +.Nd text editor +.Sh SYNOPSIS +.Nm +.Op Fl s +.Op Fl p Ar string +.Op Ar file +.Sh DESCRIPTION +.Nm +is the standard text editor. +It performs line-oriented operations on a buffer; The buffer's contents are +manipulated in command mode and text is written to the buffer in input mode. +Command mode is the default. +To exit input mode enter a dot ('.') on a line of its own. +.Pp +If +.Nm +is invoked with a file as an argument, it will simulate an edit command and read +the file's contents into a buffer. +Changes to this buffer are local to +.Nm +until a write command is given. +.Pp +.Nm +uses the basic regular expression syntax and allows any character but space and +newline to be used as a delimiter in regular expressions. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl s +Suppress diagnostic messages +.It Fl p Ar string +Use +.Ar string +as a prompt when in command mode +.El +.Sh EXTENDED DESCRIPTION +.Ss Addresses +Commands operate on addresses. +Addresses are used to refer to lines within the buffer. +Address ranges may have spaces before and after the separator. +Unless otherwise specified, 0 is an invalid address. +The following symbols are valid addresses: +.Bl -tag -width Ds +.It n +The nth line. +.It . +The current line, or "dot". +.It $ +The last line. +.It + +The next line. +.It +n +The nth next line. +.It ^ or - +The previous line. +.It ^n or -n +The nth previous line. +.It x,y +The range of lines from x to y. +The default value of x is 1, and the default value of y is $. +.It x;y +As above, except that the current line is set to x. +Omitting x in this case uses the current line as the default value. +.It /re/ +The next line matching re. +.It ?re? +The last line matching re. +.It 'c +The line marked by c. See k below. +.El +.Ss Commands +.Nm +expects to see one command per line, with the following exception: commands may +be suffixed with either a list, number, or print command. +These suffixed commands are run after the command they're suffixed to has +executed. +.Pp +The following is the list of commands that +.Nm +knows about. +The parentheses contain the default addresses that a command uses. +.Bl -tag -width Ds +.It (.)a +Append text after the addressed line. +The dot is set to the last line entered. +If no text was entered, the dot is set to the addressed line. +An address of 0 appends to the start of the buffer. +.It (.,.)c +Delete the addressed lines and then accept input to replace them. +The dot is set to the last line entered. +If no text was entered, the dot is set to the line before the deleted lines. +.It (.,.)d +Delete the addressed lines. +If there is a line after the deleted range, the dot is set to it. +Otherwise, the dot is set to the line before the deleted range. +.It e Ar file +Delete the contents of the buffer and load in +.Ar file +for editing, printing the bytes read to standard output. +If no filename is given, +.Nm +uses the currently remembered filename. +The remembered filename is set to +.Ar file +for later use. +.It E Ar file +As above, but without warning if the current buffer has unsaved changes. +.It f Ar file +Set the currently remembered filename to +.Ar file +, or print the currently remembered filename if +.Ar file +is omitted. +.It (1,$)g/re/command +Apply command to lines matching re. +The dot is set to the matching line before command is executed. +When each matching line has been operated on, the dot is set to the last line +operated on. +If no lines match then the dot remains unchanged. +The command used may not be g, G, v, or V. +.It (1,$)G/re/ +Interactively edit the range of line addresses that match re. +The dot is set to the matching line and printed before a command is input. +When each matching line has been operated on, the dot is set to the last line +operated on. +If no lines match then the dot remains unchanged. +The command used may not be a, c, i, g, G, v, or V. +.It h +Print the reason for the most recent error. +.It H +Toggle error explanations. +If on, the above behaviour is produced on all subsequent errors. +.It (.)i +Insert text into the buffer before the addressed line. +The dot is set to the last line entered. +If no text was entered, the dot is set to the addressed line +.It (.,.+1)j +Join two lines together. +If only one address is given, nothing happens. +The dot is set to the newly joined line. +.It (.)kc +Mark the line with the lower case character c. The dot is unchanged. +.It (.,.)l +Unambiguously print the addressed lines. +The dot is set to the last line written. +.It (.,.)m(.) +Move lines in the buffer to the line address on the right hand side. +An address of 0 on the right hand side moves to the start of the buffer. +The dot is set to the last line moved. +.It (.,.)n +Print the addressed lines and their numbers. +The dot is set to the last line printed. +.It (.,.)p +Print the addressed lines. +The dot is set to the last line printed. +.It P +Toggle the prompt. +Defaults to off, but is switched on if the -p flag is used. +.It q +Quit +.Nm +, warning if there are unsaved changes. +.It Q +As above, but without warning if the current buffer has unsaved changes. +.It ($)r Ar file +Read in +.Ar file +and append it to the current buffer, printing the bytes read to standard output. +The currently remembered filename isn't changed unless it's empty. +An address of 0 reads the file into the start of the buffer. +.It (.,.)s/re/replacement/flags +Substitute re for replacement in lines matching re. +An & within replacement is replaced with the whole string matched by re. +Backrefs can be used with the form \\n, where n is a positive non-zero integer. +When % is the only character in replacement, it is substituted for the +replacement string from the last substitute command. +If a newline is part of replacement then the matched string is split into two +lines; this cannot be done as part of a g or v command. +If flags contains an integer n, then the nth match is replaced. +If flags contains g, all matches are replaced. +The dot is set to the last line matched. +.It (.,.)t(.) +As m, but copying instead of moving. +The dot is set to the last line added. +.It u +Undo the last change. +The dot is set to whatever it was before the undone command was performed. +.It (1.$)v/re/command +As with g, but operating on lines that don't match re. +.It (1.$)V/re/ +As with G, but operating on lines that don't match re. +.It (1,$)w Ar file +Write the addressed lines to +.Ar file +, overwriting its previous contents if the file exists, and print the number of +bytes written. +If no filename is given the currently remembered filename will be used instead. +The dot is unchanged. +.It (1,$)W Ar file +As above, but instead of overwriting the contents of +.Ar file +the addressed lines are appended to +.Ar file +instead. +.It (.+1) +Print the addressed line. +Sets the dot to that line. +.It ($)= +Print the line number of the addressed line. +The dot is unchanged. +.It & +Repeat the last command. +.It ! Ar command +Execute +.Ar command +using sh. +If the first character of +.Ar command +is '!' then it is replaced with the text of the previous command. +An unescaped % is replaced with the currently remembered filename. +! does not process escape characters. +When +.Ar command +returns a '!' is printed. +The dot is unchanged. +.El +.Sh SEE ALSO +.Xr sed 1 , +.Xr regexp 3 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification, except where noted here: +g and v operate on single commands rather than lists delimited with '\\'. +e, E, r, w, and W commands cannot accept shell escapes. diff --git a/share/man/man1/expand.1 b/share/man/man1/expand.1 @@ -0,0 +1,51 @@ +.Dd 2015-10-08 +.Dt EXPAND 1 +.Os sbase +.Sh NAME +.Nm expand +.Nd expand tabs to spaces +.Sh SYNOPSIS +.Nm +.Op Fl i +.Op Fl t Ar tablist +.Op Ar file ... +.Sh DESCRIPTION +.Nm +converts tabs to spaces in each +.Ar file +as specified in +.Ar tablist . +If no file is given, +.Nm +reads from stdin. +.Pp +Backspace characters are preserved and decrement the column count +for tab calculations. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl i +Only expand tabs at the beginning of lines, i.e. expand each +line until a character different from '\et' and ' ' is reached. +.It Fl t Ar tablist +Specify tab size or tabstops. +.Ar tablist +is a list of one (in the former case) or multiple (in the latter case) +strictly positive integers separated by ' ' or ','. +.Pp +The default +.Ar tablist +is "8". +.El +.Sh SEE ALSO +.Xr fold 1 , +.Xr unexpand 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl i +flag is an extension to that specification. diff --git a/share/man/man1/find.1 b/share/man/man1/find.1 @@ -0,0 +1,144 @@ +.Dd 2015-10-08 +.Dt FIND 1 +.Os sbase +.Sh NAME +.Nm find +.Nd find files +.Sh SYNOPSIS +.Nm +.Op Fl H | L +.Ar path Op ... +.Op Ar expression +.Sh DESCRIPTION +.Nm +walks a file hierarchy starting at each +.Ar path +and applies the +.Ar expression +to each file encountered. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl H +Dereference symbolic links provided as +.Ar path . +.It Fl L +Dereference all symbolic links encountered. +.El +.Sh EXTENDED DESCRIPTION +.Ar expression +is a combination of the following primaries and boolean operators. +In the following descriptions the number n can be replaced by +n, n, or +-n, to mean more than, exactly, or less than n respectively. +.Ss Primaries +.Bl -tag -width Ds +.It Fl name Ar pattern +True if the name of the file matches the given pattern. +.It Fl path Ar pattern +True if the path to the file matches the given pattern. +.It Fl nouser +True if the file belongs to a user for which getpwuid() returns NULL. +.It Fl nogroup +True if the file belongs to a group for which getgrgid() returns NULL. +.It Fl xdev +True. +Do not enter directory on a different device. +.It Fl prune +True. +Do not enter directory. +.It Fl perm Ar mode +True if permissions on the file match mode. +Mode is a symbolic mode as used in chmod. +A leading '-' in mode checks that at least all bits in mode are set in +permissions for file. +Without the leading '-' the permissions for file must exactly match +mode. +.It Fl type Ar t +True if file is of type specified by +.Ar t . +.Bl -tag -width Ds +.It Ar b +block special +.It Ar c +character special +.It Ar d +directory +.It Ar l +symbolic link +.It Ar p +FIFO +.It Ar f +regular file +.It Ar s +socket +.El +.It Fl links Ar n +True if file has +.Ar n +links. +.It Fl user Ar name +True if file belongs to user +.Ar name . +.It Fl group Ar name +True if file belongs to group +.Ar name . +.It Fl size Ar n[c] +True if file size in 512 byte sectors (rounded up), or bytes (if +.Ar c +is given), is +.Ar n . +.It Fl atime n +True if file access time is +.Ar n +days. +.It Fl ctime +True if file status change time is +.Ar n +days. +.It Fl mtime +True if file modified time is +.Ar n +days. +.It Fl exec Ar cmd [arg ...] \&; +Execute cmd with given arguments, replacing each {} in argument list +with the current file. +True if cmd exits with status 0. +.It Fl exec Ar cmd [arg ...] {} + +True. +Add as many files as possible to argument list and execute when the list +is full or all files have been found. +.It Fl ok Ar cmd [arg ...] \&; +Prompt the user on each file encountered whether or not to execute cmd +as with -exec. +True if the user responds yes and cmd exits with status 0, false +otherwise. +.It Fl print +True. +Print the path to the current file. +.It Fl newer Ar file +True if the modification time of the current file is newer than that of +the provided file. +.It Fl depth +True. +Causes find to evaluate files within in a directory before the directory +itself. +.El +.Ss Operators +In order of decreasing precedence +.Bl -tag -width Ds +.It Ar \&( expression \&) +True if expression is true. +.It Ar \&! expression +True if expression if false. +.It Ar expression [ Fl a ] Ar expression +True if both expressions are true. +Second expression is not evaluated if first expression is false. +.Fl a +is implied if there is no operator between primaries. +.It Ar expression Fl o Ar expression +True if either expression is true. +Second expression is not evaluated if first expression is true. +.El +.Pp +If no expression is supplied, -print is used. +If an expression is supplied but none of -print, -exec, or -ok is +supplied, then -a -print is appended to the expressions. diff --git a/share/man/man1/flock.1 b/share/man/man1/flock.1 @@ -0,0 +1,35 @@ +.Dd 2015-10-08 +.Dt FLOCK 1 +.Os sbase +.Sh NAME +.Nm flock +.Nd tool to manage locks on files +.Sh SYNOPSIS +.Nm +.Op Fl nosux +.Ar file +.Ar cmd Op arg ... +.Sh DESCRIPTION +.Nm +is used to manage advisory locks on open files. +It is commonly used to prevent long running cron jobs from running in +parallel. +If +.Ar file +does not exist, it will be created. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl n +Set non-blocking mode on the lock. +Fail immediately if the lock cannot be acquired. +.It Fl o +Close the file descriptor before exec to avoid having the exec'ed +program holding on to the lock. +.It Fl s +Acquire a shared lock. +.It Fl u +Release the lock. +.It Fl x +Acquire an exclusive lock. +This is the default. +.El diff --git a/share/man/man1/fold.1 b/share/man/man1/fold.1 @@ -0,0 +1,43 @@ +.Dd 2015-10-08 +.Dt FOLD 1 +.Os sbase +.Sh NAME +.Nm fold +.Nd wrap lines to width +.Sh SYNOPSIS +.Nm +.Op Fl bs +.Op Fl w Ar num | Fl Ns Ar num +.Op Ar file ... +.Sh DESCRIPTION +.Nm +reads each +.Ar file +and prints its lines wrapped such that no line +exceeds a certain width. +If no file is given, +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl b +Count bytes rather than characters. +.It Fl s +If a line contains spaces, break +at the last space within width. +.It Fl w Ar num | Fl Ns Ar num +Break at +.Ar num +characters. +The default is 80. +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl Ns Ar num +syntax is an extension to that specification. diff --git a/share/man/man1/getconf.1 b/share/man/man1/getconf.1 @@ -0,0 +1,60 @@ +.Dd 2015-10-08 +.Dt GETCONF 1 +.Os sbase +.Sh NAME +.Nm getconf +.Nd get configuration values +.Sh SYNOPSIS +.Nm +.Op Fl v Ar spec +.Ar var +.Ar [path] +.Sh DESCRIPTION +.Nm +writes the value of the variable +.Ar var +to stdout. +.sp +If +.Ar path +is given, +.Ar var +is matched against configuration values from +.Xr pathconf 3 . +If +.Ar path +is not given, +.Ar var +is matched against configuration values from +.Xr sysconf 3 , +.Xr confstr 3 +and limits.h (Minimum and Maximum). +.sp +If +.Ar var +is not defined, +.Nm +writes "undefined" to stdout. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl v Ar spec +Ignored. +.El +.Sh EXIT STATUS +.Bl -tag -width Ds +.It 0 +.Ar var +was matched and its value written successfully. +.It 1 +An error occured or +.Ar var +was invalid. +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification except from the +.Op Fl v +flag. diff --git a/share/man/man1/grep.1 b/share/man/man1/grep.1 @@ -0,0 +1,98 @@ +.Dd 2015-10-08 +.Dt GREP 1 +.Os sbase +.Sh NAME +.Nm grep +.Nd search files for patterns +.Sh SYNOPSIS +.Nm +.Op Fl EFHchilnqsvx +.Op Fl e Ar pattern +.Op Fl f Ar file +.Op Ar pattern +.Op Ar file ... +.Sh DESCRIPTION +.Nm +searches the input files for lines that match the +.Ar pattern , +a regular expression as defined in +.Xr regex 7 or +.Xr re_format 7 . +By default each matching line is printed to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl E +Match using extended regex. +.It Fl F +Match using fixed strings. +Treat each pattern specified as a string instead of a regular +expression. +.It Fl H +Prefix each matching line with its filename in the output. +This is the default when there is more than one file specified. +.It Fl c +Print only a count of matching lines. +.It Fl e Ar pattern +Specify a pattern used during the search of the input: an input +line is selected if it matches any of the specified patterns. +This option is most useful when multiple -e options are used to +specify multiple patterns, or when a pattern begins with a dash. +.It Fl f Ar file +Read one or more patterns from the file named by the pathname file. +Patterns in file shall be terminated by a <newline>. +A null pattern can be specified by an empty line in pattern_file. +Unless the -E or -F option is also specified, each pattern shall be +treated as a BRE. +(`-'). +.It Fl h +Do not prefix each line with 'filename:' prefix. +.It Fl i +Match lines case insensitively. +.It Fl l +Print only the names of files with matching lines. +.It Fl n +Prefix each matching line with its line number in the input. +.It Fl q +Print nothing, only return status. +.It Fl s +Suppress the error messages ordinarily written for nonexistent or unreadable +files. +.It Fl v +Select lines which do +.Sy not +match the pattern. +.It Fl w +The expression is searched for as a word (as if surrounded by '\\<' and '\\>'). +.It Fl x +Consider only input lines that use all characters in the line excluding the +terminating <newline> to match an entire fixed string or regular expression to +be matching lines. +.El +.Sh EXIT STATUS +.Bl -tag -width Ds +.It 0 +One or more lines were matched. +.It 1 +No lines were matched. +.It > 1 +An error occurred. +.El +.Sh SEE ALSO +.Xr sed 1 , +.Xr regex 7 , +.Xr re_format 7 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl Hhw +flags are an extension to that specification. diff --git a/share/man/man1/hostname.1 b/share/man/man1/hostname.1 @@ -0,0 +1,18 @@ +.Dd 2015-10-08 +.Dt HOSTNAME 1 +.Os sbase +.Sh NAME +.Nm hostname +.Nd set or print host name +.Sh SYNOPSIS +.Nm +.Op Ar name +.Sh DESCRIPTION +.Nm +sets the current host name to +.Ar name . +If no +.Ar name +is given, the current host name is written to stdout. +.Sh SEE ALSO +.Xr hostname 7 diff --git a/share/man/man1/kill.1 b/share/man/man1/kill.1 @@ -0,0 +1,47 @@ +.Dd 2015-10-08 +.Dt KILL 1 +.Os sbase +.Sh NAME +.Nm kill +.Nd signal processes +.Sh SYNOPSIS +.Nm +.Op Fl s Ar signame | Fl num | Fl signame +.Ar pid ... +.Nm +.Fl l Op Ar num +.Sh DESCRIPTION +.Nm +signals TERM to each process or process group specified by +.Ar pid . +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl l Op Ar num +List all available signals or the signal name of +.Ar num . +.It Fl s Ar signame | Fl num | Fl signame +Send signal corresponding to +.Ar signame +| +.Ar num . +The default is TERM. +.El +.Sh SEE ALSO +.Xr kill 2 , +.Xr signal 7 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Fl Ar signame +and +.Fl Ar num +syntax is marked by +.St -p1003.1-2013 +as an +X/OPEN System Interfaces +option. diff --git a/share/man/man1/logger.1 b/share/man/man1/logger.1 @@ -0,0 +1,56 @@ +.Dd 2015-10-08 +.Dt LOGGER 1 +.Os sbase +.Sh NAME +.Nm logger +.Nd make entries in the system log +.Sh SYNOPSIS +.Nm +.Op Fl is +.Op Fl p Ar priority +.Op Fl t Ar tag +.Op Ar message ... +.Sh DESCRIPTION +.Nm +provides a shell command interface to the +.Xr syslog 3 +system log module and writes each +.Ar message +to the log. +If no +.Ar message +is given, +.Nm +logs stdin. +.Sh OPTIONS +.Bl -tag -width xxxxxxxxxxxx +.It Fl i +Add the logger process ID to each line in the log. +.It Fl p Ar priority +Set the message +.Ar priority +given symbolically as a +.Dq facility.level +pair. +The default is +.Dq user.notice . +.It Fl s +Also log to stderr. +.It Fl t Ar tag +Add +.Ar tag +to each line in the log. +.El +.Sh SEE ALSO +.Xr syslogd 1 , +.Xr syslog 3 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl ipst +flags are an extensions to that specification. diff --git a/share/man/man1/ls.1 b/share/man/man1/ls.1 @@ -0,0 +1,99 @@ +.Dd 2015-10-08 +.Dt LS 1 +.Os sbase +.Sh NAME +.Nm ls +.Nd list directory contents +.Sh SYNOPSIS +.Nm +.Op Fl iqr +.Op Fl ln +.Op Fl A | a +.Op Fl 1 +.Op Fl h | F | p +.Op Fl H | L +.Op Fl R | d +.Op Fl S | f | t | U +.Op Fl c | u +.Op Ar file ... +.Sh DESCRIPTION +.Nm +lists each given file, and the contents of each given directory. +If no files are given the current directory is listed. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl A +List all entries except for '.' and '..'. +.It Fl a +Show hidden files (those beginning with '.'). +.It Fl c +Use time file's status was last changed instead of last +modification time for sorting or printing. +.It Fl d +List directories themselves, not their contents. +.It Fl F +Append a file type indicator to all special files. +.It Fl f +Like +.Fl U +but turns on +.Fl a +and disables +.Fl r , +.Fl S +and +.Fl t . +.It Fl H +List information about the targets of symbolic links specified on the command +line instead of the links themselves. +.It Fl h +Show filesizes in human\-readable format. +.It Fl i +Print the index number of each file. +.It Fl L +List information about the targets of symbolic links instead of the links +themselves. +.It Fl l +List detailed information about each file, including their type, permissions, +links, owner, group, size or major and minor numbers if the file is a +character/block device, and last file status/modification time. +.It Fl n +List detailed information about each file, including their type, permissions, +links, owner, group, size or major and minor numbers if the file is a +character/block device, and last file status/modification time, but with +numeric IDs. +.It Fl p +Append a file type indicator to directories. +.It Fl q +Replace non-printable characters in filenames with '?'. +.It Fl R +List directory content recursively. +The +.Fl 1 +flag is set implicitly. +.It Fl r +Reverse the sort order. +.It Fl S +Sort files by size (in decreasing order). +.It Fl t +Sort files by last file status/modification time instead of by name. +.It Fl U +Keep the list unsorted. +.It Fl u +Use file's last access time instead of last modification time for +sorting or printing. +.El +.Sh SEE ALSO +.Xr stat 2 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification except from the +.Op Fl Ckmpsx +flags. +.Pp +The +.Op Fl hU +flags are an extension to that specification. diff --git a/share/man/man1/md5sum.1 b/share/man/man1/md5sum.1 @@ -0,0 +1,32 @@ +.Dd 2015-10-08 +.Dt MD5SUM 1 +.Os sbase +.Sh NAME +.Nm md5sum +.Nd compute or check MD5 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes MD5 (128-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of MD5 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/nl.1 b/share/man/man1/nl.1 @@ -0,0 +1,120 @@ +.Dd 2020-05-15 +.Dt NL 1 +.Os sbase +.Sh NAME +.Nm nl +.Nd line numbering filter +.Sh SYNOPSIS +.Nm +.Op Fl p +.Op Fl b Ar type +.Op Fl d Ar delim +.Op Fl f Ar type +.Op Fl h Ar type +.Op Fl i Ar num +.Op Fl l Ar num +.Op Fl n Ar format +.Op Fl s Ar sep +.Op Fl v Ar num +.Op Fl w Ar num +.Op Ar file +.Sh DESCRIPTION +.Nm +reads lines from +.Ar file +and writes them to stdout, numbering non-empty lines. +If no +.Ar file +is given +.Nm +reads from stdin. +.Pp +.Nm +treats the input text as a collection of logical pages divided into +logical page sections. +Each logical page consists of a header section, a body +section and a footer section. +Sections may be empty. +The start of each section is indicated by a single delimiting line, one of: +.Bl -column "\e:\e:\e: " "header " -offset indent +.It Em "Line" Ta Em "Start of" +.It \e:\e:\e: header +.It \e:\e: body +.It \e: footer +.El +.Pp +If the input text contains no delimiting line then all of the input text +belongs to a single logical page body section. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl p +Do not reset line number for logical pages. +.It Fl h Ar type | Fl b Ar type | Fl f Ar type +Define which lines to number in the head | body | footer section: +.Bl -tag -width pstringXX +.It a +All lines. +.It n +No lines. +.It t +Only non-empty lines. +This is the default. +.It p Ns Ar expr +Only lines matching +.Ar expr +according to +.Xr regex 7 or +.Xr re_format 7 . +.El +.It Fl d Ar delim +Set +.Ar delim +as the delimiter for logical pages. +If +.Ar delim +is only one character, +.Nm +appends ":" to it. +The default is "\e:". +.It Fl i Ar num +Set the increment between numbered lines to +.Ar num . +.It Fl l Ar num +Set the number of adjacent blank lines to be considered as one to +.Ar num . +The default is 1. +.It Fl n Ar format +Set the line number output +.Ar format +to one of: +.Bl -tag -width pstringXX +.It ln +Left justified. +.It rn +Right justified. +This is the default. +.It rz +Right justified with leading zeroes. +.El +.It Fl s Ar sep +Use +.Ar sep +to separate line numbers and lines. +The default is "\et". +.It Fl v Ar num +Start counting lines from +.Ar num . +The default is 1. +.It Fl w Ar num +Set the width of the line number to +.Ar num . +The default is 6. +.El +.Sh SEE ALSO +.Xr pr 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/od.1 b/share/man/man1/od.1 @@ -0,0 +1,83 @@ +.Dd 2015-10-25 +.Dt OD 1 +.Os sbase +.Sh NAME +.Nm od +.Nd octal dump +.Sh SYNOPSIS +.Nm +.Op Fl bdosvx +.Op Fl A Ar addrformat +.Op Fl E | e +.Op Fl j Ar skip +.Op Fl t Ar outputformat... +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes an octal dump of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl A Ar addressformat +.Ar addressformat +is one of d|o|x|n and sets the address to be +either in \fId\fRecimal, \fIo\fRctal, he\fIx\fRadecimal or \fIn\fRot +printed at all. +The default is octal. +.It Fl E | e +Force Little Endian +.Fl ( e ) +or Big Endian +.Fl ( E ) +system-independently. +.It Fl b +Equivalent to +.Fl t o1 . +.It Fl d +Equivalent to +.Fl t u2 . +.It Fl j Ar skip +Ignore the first +.Ar skip +bytes of input. +.It Fl o +Equivalent to +.Fl t o2 . +.It Fl s +Equivalent to +.Fl t d2 . +.It Fl t Ar outputformat +.Ar outputformat +is a list of a|c|d|o|u|x followed by a digit or C|S|I|L and sets +the content to be in n\fIa\fRmed character, \fIc\fRharacter, signed +\fId\fRecimal, \fIo\fRctal, \fIu\fRnsigned decimal, or +he\fIx\fRadecimal format, processing the given amount of bytes or the length +of \fIC\fRhar, \fIS\fRhort, \fII\fRnteger or \fIL\fRong. +The default is octal with 4 bytes. +.It Fl v +Always set. +Write all input data, including duplicate lines. +.It Fl x +Equivalent to +.Fl t x2 . +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification except that the +.Op Fl v +flag is always enabled and the 'd' parameter for the +.Op Fl t +flag is interpreted as 'u'. +.Pp +The +.Op Ee +flags are an extension to that specification. diff --git a/share/man/man1/paste.1 b/share/man/man1/paste.1 @@ -0,0 +1,51 @@ +.Dd 2015-10-08 +.Dt PASTE 1 +.Os sbase +.Sh NAME +.Nm paste +.Nd merge lines of files in parallel or sequentially +.Sh SYNOPSIS +.Nm +.Op Fl s +.Op Fl d Ar list +.Ar file ... +.Sh DESCRIPTION +.Nm +reads single lines from each +.Ar file +and writes them into one line, replacing +.Sy \en +with +.Sy \et +except from the last +.Ar file . +This process is repeated until each +.Ar file +is starved, treating zero-reads as empty lines along the way. +.Pp +If +.Ar file +is '-', +.Nm +interprets it as stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl d Ar list +Replace +.Sy \en +with escaped characters from +.Ar list +by cycling through it. +.It Fl s +Read each +.Ar file +sequentially instead of in parallel. +.El +.Sh SEE ALSO +.Xr cut 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/printenv.1 b/share/man/man1/printenv.1 @@ -0,0 +1,30 @@ +.Dd 2016-03-30 +.Dt PRINTENV 1 +.Os sbase +.Sh NAME +.Nm printenv +.Nd print the environment or values of variables +.Sh SYNOPSIS +.Nm +.Op Ar var ... +.Sh DESCRIPTION +.Nm +prints the entire environment as key=value pairs if no +.Ar var +is given. +Otherwise, +.Nm +prints only the value of each +.Ar var +one per line in the order specified. +.Sh EXIT STATUS +.Bl -tag -width Ds +.It 0 +Successful completion. +.It 1 +One or more queried variables were not found. +.It > 1 +An error occurred. +.El +.Sh SEE ALSO +.Xr env 1 diff --git a/share/man/man1/renice.1 b/share/man/man1/renice.1 @@ -0,0 +1,42 @@ +.Dd 2015-10-08 +.Dt RENICE 1 +.Os sbase +.Sh NAME +.Nm renice +.Nd change niceness of processes +.Sh SYNOPSIS +.Nm +.Fl n Ar num +.Op Fl g | Fl p | Fl u +.Ar id ... +.Sh DESCRIPTION +.Nm +changes the niceness of each process with the given +.Ar id . +Only the superuser can lower the niceness. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl g | Fl p | Fl u +Interpret each +.Ar id +as a process group ID | process ID | user name or ID. +The middle option is default. +.It Fl n Ar num +Change niceness by +.Ar num , +with niceness ranging from +.Sy -20 +(highest priority) +to +.Sy +20 +(lowest priority). +.El +.Sh SEE ALSO +.Xr nice 2 , +.Xr renice 2 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/rev.1 b/share/man/man1/rev.1 @@ -0,0 +1,22 @@ +.Dd 2016-03-26 +.Dt REV 1 +.Os sbase +.Sh NAME +.Nm rev +.Nd reverse each line +.Sh SYNOPSIS +.Nm +.Op Ar file ... +.Sh DESCRIPTION +.Nm +reads each +.Ar file +in sequence and writes it to stdout, but with all characters in each +line in reverse order. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh SEE ALSO +.Xr tac 1 diff --git a/share/man/man1/sed.1 b/share/man/man1/sed.1 @@ -0,0 +1,157 @@ +.Dd 2015-10-08 +.Dt SED 1 +.Os sbase +.Sh NAME +.Nm sed +.Nd stream editor +.Sh SYNOPSIS +.Nm +.Op Fl nrE +.Ar script +.Op Ar file ... +.Nm +.Op Fl nrE +.Fl e Ar script +.Op Fl e Ar script +.Ar ... +.Op Fl f Ar scriptfile +.Ar ... +.Op Ar file ... +.Nm +.Op Fl nrE +.Op Fl e Ar script +.Ar ... +.Fl f Ar scriptfile +.Op Fl f Ar scriptfile +.Ar ... +.Op Ar file ... +.Sh DESCRIPTION +.Nm +reads line oriented output from +.Ar file +or stdin, applies the editing commands supplied by +.Ar script +or +.Ar scriptfile +and writes the edited stream to stdout. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl n +Suppress default printing at the end of each cycle. +.It Fl r E +Use extended regular expressions +.It Fl e Ar script +Append +.Ar script +to the list of editing commands. +.It Fl f Ar scriptfile +Append the commands from +.Ar scriptfile +to the list of editing commands. +.El +.Sh EXTENDED DESCRIPTION +Editing commands take the form +.Pp +[address[,address]]function +.Ss Addresses +Addresses are either blank, a positive decimal integer denoting a line +number, the character '$' denoting the last line of input, or a regular +expression. +A command with no addresses matches every line, one address matches +individual lines, and two addresses matches a range of lines from the +first to the second address inclusive. +.Ss Functions +.Bl -tag -width Ds +.It Ar a Op Ar text +Append text to output after end of current cycle. +.It Ar b Op Ar label +Branch to label. +If no label is provided branch to end of script. +.It Ar c Op Ar text +Change. +Delete addressed range and output text after end of current cycle. +.It Ar d +Delete pattern space and begin next cycle. +.It Ar D +Delete pattern space up to and including first newline and begin new +cycle without reading input. +If there is no newline, behave like d. +.It Ar g +Get. +Replace the pattern space with the hold space. +.It Ar G +Get. +Append a newline and the hold space to the pattern space. +.It Ar h +Hold. +Replace the hold space with the pattern space. +.It Ar H +Hold. +Append a newline and the pattern space to the hold space. +.It Ar i Op Ar text +Insert text in output. +.It Ar l +List? Write the pattern space replacing known non printing characters with +backslash escaped versions (\\\\, \\a, \\b, \\f, \\r, \\t, \\v). +Print bad UTF-8 sequences as \\ooo where ooo is a three digit octal +number. +Mark end of lines with '$'. +.It Ar n +Next. +Write pattern space (unless +.Fl n ) , +read next line into pattern space, and continue current cycle. +If there is no next line, quit. +.It Ar N +Next. +Read next line, append newline and next line to pattern space, and +continue cycle. +If there is no next line, quit without printing current pattern space. +.It Ar p +Print current pattern space. +.It Ar P +Print current pattern space up to first newline. +.It Ar q +Quit. +.It Ar r file +Read file and write contents to output. +.It Ar s/re/text/flags +Find occurences of regular expression re in the pattern space and +replace with text. +A '&' in text is replaced with the entire match. +A \\d where d is a decimal digit 1-9 is replaced with the corresponding +match group from the regular expression. +\\n represents a newline in both the regular expression and replacement +text. +A literal newline in the replacement text must be preceded by a \\. +.Pp +Flags are +.Bl -tag -width Ds +.It Ar n +A positive decimal number denoting which match in the pattern space +to replace. +.It Ar g +Global. +Replace all matches in the pattern space. +.It Ar p +Print the pattern if a replacement was made. +.It Ar w file +Write the pattern space to file if a replacement was made. +.El +.It Ar t Op Ar label +Test. +Branch to corresponding label if a substitution has been made since the +last line was read or last t command was executed. +If no label is provided branch to end of script. +.It Ar w file +Write pattern space to file. +.It Ar x +Exchange hold space and pattern space. +.It Ar y/set1/set2/ +Replace each occurrence of a character from set 1 with the corresponding +character from set 2. +.It Ar :label +Create a label for b and t commands. +.It Ar = +Write current input line number to output. +.El diff --git a/share/man/man1/setsid.1 b/share/man/man1/setsid.1 @@ -0,0 +1,18 @@ +.Dd 2020-07-14 +.Dt SETSID 1 +.Os sbase +.Sh NAME +.Nm setsid +.Nd run a command in a new session +.Sh SYNOPSIS +.Nm +.Op Fl f +.Ar cmd +.Op Ar arg ... +.Sh DESCRIPTION +.Nm +runs +.Ar cmd +in a new session. +.Sh SEE ALSO +.Xr setsid 2 diff --git a/share/man/man1/sha224sum.1 b/share/man/man1/sha224sum.1 @@ -0,0 +1,32 @@ +.Dd 2016-02-24 +.Dt SHA224SUM 1 +.Os sbase +.Sh NAME +.Nm sha224sum +.Nd compute or check SHA-224 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-224 (224-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-224 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sha256sum.1 b/share/man/man1/sha256sum.1 @@ -0,0 +1,32 @@ +.Dd 2015-10-08 +.Dt SHA256SUM 1 +.Os sbase +.Sh NAME +.Nm sha256sum +.Nd compute or check SHA-256 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-256 (256-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-256 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sha384sum.1 b/share/man/man1/sha384sum.1 @@ -0,0 +1,32 @@ +.Dd 2016-02-24 +.Dt SHA384SUM 1 +.Os sbase +.Sh NAME +.Nm sha384sum +.Nd compute or check SHA-384 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-384 (384-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-384 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sha512-224sum.1 b/share/man/man1/sha512-224sum.1 @@ -0,0 +1,32 @@ +.Dd 2016-02-24 +.Dt SHA512-224SUM 1 +.Os sbase +.Sh NAME +.Nm sha512-224sum +.Nd compute or check SHA-512/224 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-512/224 (224-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-512/224 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sha512-256sum.1 b/share/man/man1/sha512-256sum.1 @@ -0,0 +1,32 @@ +.Dd 2016-02-24 +.Dt SHA512-256SUM 1 +.Os sbase +.Sh NAME +.Nm sha512-256sum +.Nd compute or check SHA-512/256 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-512/256 (256-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-512/256 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sha512sum.1 b/share/man/man1/sha512sum.1 @@ -0,0 +1,32 @@ +.Dd 2015-10-08 +.Dt SHA512SUM 1 +.Os sbase +.Sh NAME +.Nm sha512sum +.Nd compute or check SHA-512 message digests +.Sh SYNOPSIS +.Nm +.Op Fl c +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes SHA-512 (512-bit) checksums of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c +Read list of SHA-512 checksums from each +.Ar file +and check them. +If no +.Ar file +is given +.Nm +reads from stdin. +.El diff --git a/share/man/man1/sort.1 b/share/man/man1/sort.1 @@ -0,0 +1,102 @@ +.Dd 2016-02-17 +.Dt SORT 1 +.Os sbase +.Sh NAME +.Nm sort +.Nd sort lines +.Sh SYNOPSIS +.Nm +.Op Fl Cbcdfimnru +.Op Fl o Ar outfile +.Op Fl t Ar delim +.Op Fl k Ar key ... +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes the sorted concatenation of each +.Ar file +to stdout. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl C +Check that the concatenation of the given +.Ar files +is sorted rather than sorting them. +In this mode, no output is printed to stdout, and the exit status +indicates the result of the check. +.It Fl b +Skip leading whitespace of columns when sorting. +.It Fl c +The same as +.Fl C +except that when disorder is detected, a message is written to stderr +indicating the location of the disorder. +.It Fl d +Skip non-whitespace and non-alphanumeric characters. +.It Fl f +Ignore letter case when sorting. +.It Fl i +Skip non-printable characters. +.It Fl k Ar key +Specify a key definition of the form +.Sm off +.Sy S +.No [. +.Sy s +.No ][ +.Sy f +.No ][, +.Sy E +.No [. +.Sy e +.No ][ +.Sy f +.No ]] +.Sm on +where +.Sy S , s , E +and +.Sy e +are the starting column, starting character in that column, ending column and +the ending character of that column respectively. +If they are not specified, +.Sy s +refers to the first character of the specified starting column, +.Sy E +refers to the last column of every line, and +.Sy e +refers to the last character of the ending column. +.Sy f +can be used to specify options +.Sy ( n , b ) +that only apply to this key definition. +.Sy b +is special in that it only applies to the column that it was specified after. +.It Fl m +Assume sorted input, merge only. +.It Fl n +Perform a numeric sort. +.It Fl o Ar outfile +Write output to +.Ar outfile +rather than stdout. +.It Fl r +Reverses the sort. +.It Fl t Ar delim +Set +.Ar delim +as the field delimiter. +.It Fl u +Print equal lines only once. +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/sponge.1 b/share/man/man1/sponge.1 @@ -0,0 +1,19 @@ +.Dd 2015-10-08 +.Dt SPONGE 1 +.Os sbase +.Sh NAME +.Nm sponge +.Nd soak up standard input and write to a file +.Sh SYNOPSIS +.Nm +.Ar file +.Sh DESCRIPTION +.Nm +reads stdin completely, then writes the saved contents to +.Ar file . +This makes it possible to easily create pipes which read from and write to +the same file. +.Pp +If +.Ar file +is a symbolic link, it writes to its destination instead. diff --git a/share/man/man1/tail.1 b/share/man/man1/tail.1 @@ -0,0 +1,55 @@ +.Dd 2015-10-08 +.Dt TAIL 1 +.Os sbase +.Sh NAME +.Nm tail +.Nd display final lines of files +.Sh SYNOPSIS +.Nm +.Op Fl f +.Op Fl c Ar num | Fl m Ar num | Fl n Ar num | Fl Ns Ar num +.Op Ar file ... +.Sh DESCRIPTION +.Nm +writes the last 10 lines of each +.Ar file +to stdout. +If no +.Ar file +is given, +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl c Ar num | Fl m Ar num | Fl n Ar num | Fl Ns Ar num +Display final +.Ar num +bytes | characters | lines | lines. +If +.Ar num +begins with '+' +it is an offset from the beginning of each +.Ar file . +If +.Ar num +begins with '-' it is as if no sign was given. +The default is 10 lines. +.It Fl f +If one +.Ar file +is specified, append lines to output as +.Ar file +grows. +.El +.Sh SEE ALSO +.Xr head 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl Ns Ar num +syntax is an extension to that specification. diff --git a/share/man/man1/tftp.1 b/share/man/man1/tftp.1 @@ -0,0 +1,32 @@ +.Dd 2015-10-08 +.Dt TFTP 1 +.Os sbase +.Sh NAME +.Nm tftp +.Nd trivial file transfer protocol client +.Sh SYNOPSIS +.Nm +.Fl h Ar host +.Op Fl p Ar port +.Op Fl x | c +.Ar file +.Sh DESCRIPTION +.Nm +is a client that implements the trivial file transfer protocol over +either IPv4 or IPv6 as specified in RFC 1350. +It can be used to transfer files to and from remote machines. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl h Ar host +Set the remote hostname. +.It Fl p Ar port +Set the remote port. +It defaults to port 69. +.It Fl x +Extract a file from the server. +This is the default if no flags are specified. +Output goes to stdout. +.It Fl c +Create a file on the server. +Input comes from stdin. +.El diff --git a/share/man/man1/tsort.1 b/share/man/man1/tsort.1 @@ -0,0 +1,74 @@ +.Dd 2016-02-16 +.Dt TSORT 1 +.Os sbase +.Sh NAME +.Nm tsort +.Nd topological sort +.Sh SYNOPSIS +.Nm +.Op Ar file +.Sh DESCRIPTION +.Nm +topologically sorts a graph. +The graph is read either from +.Ar file +or from standard input. +The result is not optimized for any particular usage. +Loops are detected and reported to standard error, but does not stop the +sort. +.Pp +The input is a list of edges (vertex pairs), where +the edge is directed from the first vertex to the +second vertex. +.Sh OPTIONS +None. +.Sh EXIT STATUS +.Bl -tag -width Ds +.It 0 +The graph as successfully sorted. +.It 1 +The graph as successfully sorted, but contained loops. +.It > 1 +An error occurred. +.El +.Sh EXAMPLES +.Bd -literal -offset left +The input + + a a + a b + a c + a c + a d + b c + c b + e f + +or equivalently + + a a a b a c a c a d + b c c b e f + +represents the graph + + ┌─┐ + ↓ │ + ┏━━━┓ + ┌──────┃ a ┃──────┐ + │ ┗━━━┛ │ + │ │ │ │ + ↓ ↓ ↓ ↓ + ┏━━━┓───→┏━━━┓ ┏━━━┓ + ┃ b ┃ ┃ c ┃ ┃ d ┃ + ┗━━━┛←───┗━━━┛ ┗━━━┛ + + ┏━━━┓ ┏━━━┓ + ┃ e ┃───→┃ f ┃ + ┗━━━┛ ┗━━━┛ +.Ed +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/unexpand.1 b/share/man/man1/unexpand.1 @@ -0,0 +1,45 @@ +.Dd 2015-10-08 +.Dt UNEXPAND 1 +.Os sbase +.Sh NAME +.Nm unexpand +.Nd unexpand spaces to tabs +.Sh SYNOPSIS +.Nm +.Op Fl a +.Op Fl t Ar tablist +.Op Ar file ... +.Sh DESCRIPTION +.Nm +converts spaces to tabs in each +.Ar file +as specified in +.Ar tablist . +If no file is given, +.Nm +reads from stdin. +.Pp +Backspace characters are preserved and decrement the column count +for tab calculations. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a +Convert spaces to tabs everywhere, not just at the start of lines. +.It Fl t Ar tablist +Specify tab size or tabstops. +.Ar tablist +is a list of one (in the former case) or multiple (in the latter case) +strictly positive integers separated by ' ' or ','. +.Pp +The default +.Ar tablist +is "8". +.El +.Sh SEE ALSO +.Xr expand 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/uudecode.1 b/share/man/man1/uudecode.1 @@ -0,0 +1,50 @@ +.Dd 2015-10-08 +.Dt UUDECODE 1 +.Os sbase +.Sh NAME +.Nm uudecode +.Nd decode a uuencoded file +.Sh SYNOPSIS +.Nm +.Op Fl m +.Op Fl o Ar output +.Op Ar file +.Sh DESCRIPTION +.Nm +reads +.Ar file +and writes a decoded version to the file specified in the uuencoded header. +In case the file already exists, it is truncated. +Otherwise a new file is created. +The permissions of the created/accessed file are changed to reflect the +mode in the header. +If no +.Ar file +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl m +Use Base64 for decoding. +.It Fl o Ar output +Write to +.Ar output +rather than the file specified in the header. +.El +.Sh IMPLEMENTATION NOTES +For safety uudecode operates on regular files and stdout only. +Trying to uudecode to a link, directory, or special file +yields an error. +.Sh SEE ALSO +.Xr uuencode 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. +.Pp +The +.Op Fl m +flag is an extension to that specification. diff --git a/share/man/man1/uuencode.1 b/share/man/man1/uuencode.1 @@ -0,0 +1,38 @@ +.Dd 2015-10-08 +.Dt UUENCODE 1 +.Os sbase +.Sh NAME +.Nm uuencode +.Nd encode a binary file +.Sh SYNOPSIS +.Nm +.Op Fl m +.Op Ar file +.Ar name +.Sh DESCRIPTION +.Nm +reads +.Ar file +and writes an encoded version to stdout. +The encoding uses only printing ASCII characters and +includes the mode of the file and the operand +.Ar name +for use by uudecode. +If no +.Ar name +is given +.Nm +reads from stdin. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl m +Use Base64 for encoding. +.El +.Sh SEE ALSO +.Xr uudecode 1 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification. diff --git a/share/man/man1/whoami.1 b/share/man/man1/whoami.1 @@ -0,0 +1,9 @@ +.Dd 2015-12-14 +.Dt WHOAMI 1 +.Os sbase +.Sh NAME +.Nm whoami +.Nd show effective uid +.Sh SYNOPSIS +.Nm +writes the name of the effective uid to stdout. diff --git a/share/man/man1/xargs.1 b/share/man/man1/xargs.1 @@ -0,0 +1,97 @@ +.Dd 2015-10-08 +.Dt XARGS 1 +.Os sbase +.Sh NAME +.Nm xargs +.Nd construct argument lists and execute command +.Sh SYNOPSIS +.Nm +.Op Fl rtx +.Op Fl E Ar eofstr +.Op Fl n Ar num +.Op Fl s Ar num +.Op Ar cmd Op Ar arg ... +.Sh DESCRIPTION +.Nm +reads space, tab, newline and EOF delimited strings from stdin +and executes the specified +.Ar cmd +with the strings as +.Ar arguments . +.Pp +Any arguments specified on the command line are given to the command upon +each invocation, followed by some number of the arguments read from +stdin. +The command is repeatedly executed one or more times until stdin is exhausted. +.Pp +Spaces, tabs and newlines may be embedded in arguments using single (`'') +or double (`"') quotes or backslashes ('\\'). +Single quotes escape all non-single quote characters, excluding newlines, up +to the matching single quote. +Double quotes escape all non-double quote characters, excluding newlines, up +to the matching double quote. +Any single character, including newlines, may be escaped by a backslash. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl n Ar num +Use at most +.Ar num +arguments per command line. +.It Fl r +Do not run the command if there are no arguments. +Normally the command is executed at least once even if there are no arguments. +.It Fl E Ar eofstr +Use +.Ar eofstr +as a logical EOF marker. +.It Fl s Ar num +Use at most +.Ar num +bytes per command line. +.It Fl t +Write the command line to stderr before executing it. +.It Fl x +Terminate if the command line exceeds the system limit or the number of bytes +given with the +.Op Fl s +flag. +.El +.Sh EXIT STATUS +.Nm +exits with one of the following values: +.Bl -tag -width Ds +.It 0 +All invocations of +.Ar cmd +returned a zero exit status. +.It 123 +One or more invocations of +.Ar cmd +returned a nonzero exit status. +.It 124 +.Ar cmd +exited with a 255 exit status. +.It 125 +.Ar cmd +was killed or stopped by a signal. +.It 126 +.Ar cmd +was found but could not be executed. +.It 127 +.Ar cmd +could not be found. +.It 1 +Some other error occurred. +.El +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2013 +specification except from the +.Op Fl p +flag. +.Pp +The +.Op Fl r +flag is an extension to that specification.