Skip to content

tleguern/substr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Contents

  1. Install
  2. Instructions
  3. Examples
  4. License

Install

Requires

  • C compiler ;
  • libbsd on Linux.

Build

On OpenBSD:

$ make
$ DESTDIR=~/ make install # or doas make install

On Linux:

$ LDADD=-lbsd CFLAGS="-D NEED_LIBBSD" make
$ DESTDIR=~/ make install # or sudo make install

Instructions

To see a description of the options see the man page.

Example

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

License

All the code is licensed under the ISC License.