tleguern / substr

An utility to extract substring from a string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

An utility to extract substring from a string

License:ISC License


Languages

Language:Roff 38.5%Language:C 33.7%Language:Shell 12.3%Language:Makefile 11.5%Language:Ruby 4.1%