vis(1): Add EXAMPLES section

Add three examples showing the use of `-h`, `-l`, `-t`, `-w`

christos@netbsd.org to be notified.

Reviewed by: bcr@, gbe@, imp@
Approved by: bcr@, gbe@ (mentor), imp@

Differential Revision: https://reviews.freebsd.org/D25242
This commit is contained in:
Fernando Apesteguía 2021-02-18 19:04:23 +01:00
parent acab1d58be
commit cee8be2c78

View File

@ -155,6 +155,25 @@ instead.
Specify the locale of the input data.
Set to C if the input data locale is unknown.
.El
.Sh EXAMPLES
Visualize characters encoding white spaces and tabs:
.Bd -literal -offset indent
$ echo -e "\\x10\\n\\t" | vis -w -t
\\^P\\012\\011\\012
.Ed
.Pp
Same as above but using `\\$' for newline followed by an actual newline:
.Bd -literal -offset indent
$ echo -e "\\x10\\n\\t" | vis -w -t -l
\\^P\\$
\\011\\$
.Ed
.Pp
Visualize string using URI encoding:
.Bd -literal -offset indent
$ echo http://www.freebsd.org | vis -h
http%3a%2f%2fwww.freebsd.org%0a
.Ed
.Sh SEE ALSO
.Xr unvis 1 ,
.Xr svis 3 ,