Menu

Tree [e4527b] master /
 History

HTTPS access


File Date Author Commit
 regress 2018-01-03 Tristan Le Guern Tristan Le Guern [8a99e7] regress: don't hide result from Makefile
 .gitignore 2014-07-30 Tristan Le Guern Tristan Le Guern [371744] Update .gitignore
 Makefile 2017-04-19 Tristan Le Guern Tristan Le Guern [2cb652] Use a more portable Makefile.
 README.md 2018-01-03 Tristan Le Guern Tristan Le Guern [e4527b] README: indicate how to compile and install
 substr.1 2014-07-30 Tristan Le Guern Tristan Le Guern [343339] Add a COMPATIBILITY section
 substr.c 2017-04-19 Tristan Le Guern Tristan Le Guern [2cb652] Use a more portable Makefile.

Read Me

substr

An utility to extract substring from a string, inspired by the GNU
expr extension of the same name. This implementation is under
the ISC licence.

Read the man page for more information with either mandoc(1) or groff(1):

$ mandoc substr.1 | less
$ groff -m mdoc -Tascii substr.1 | less

In order to run on Linux systems the libbsd package should be installed first.

Installation

On OpenBSD:

$ make && doas make install

On Linux:

$ LDADD=-lbsd CFLAGS="-D NEED_LIBBSD" make && sudo make install

Example

$ substr hello 1 2
he
$ substr "Omelette du fromage" 13 7
fromage
$ substr toto 2
oto