Skip to content

mkende/ptp

Repository files navigation

PTP - An expressive Pipelining Text Processor

DESCRIPTION

PTP is a versatile and expressive text processor program. The core features that it tries to provide are the following:

  • Provide grep, sed-like and other operations with a coherent regular expressions language (grep has a -P flag but sed has nothing of the like).

  • Provide a powerful input/output files support, that is lacking when using vanilla-Perl one-liner (recursion in directories, output in-place with optional backups, etc.).

  • Pipelining of multiple operations on multiple files (using a pipeline made of several standard tool usually makes it difficult to process several input files at once).

See examples of PTP in action in the documentation.

DOCUMENTATION

You can find the documentation for the program itself on meta::cpan or on the project wiki. After the program is installed, you can also get its documentation by running any of the following commands: man ptp, ptp --help or perldoc ptp.

There is also a quick reference card, available with the --cheat command line flag or on meta::cpan, on the project wiki or in PDF format.

The built-in --help rendering will be better if the perldoc program is installed. It usually comes in a perl-doc package on most systems.

INSTALLATION

Requirements

To install this program you need Perl and its cpanminus package manager. The perldoc program is recommended but not required. You can these dependencies with one of the following command lines, depending on your OS:

# On Debian, Ubuntu, Mint, etc.
sudo apt-get install perl cpanminus perl-doc build-essential

# On Red Hat, Fedora, CentOS, etc.
sudo yum install perl Perl-App-cpanminus perl-doc gcc make

Installing from CPAN (recommanded)

This program is available on CPAN (the Perl package manager). So, to install ptp automatically using CPAN, you can just run the following command:

sudo cpanm App::PTP -n -L /usr/local --man-pages --install-args 'DESTINSTALLBIN=/usr/local/bin'

Installing from the Git sources

To install the program manually from Git, you can run the following commands:

git clone https://github.com/mkende/ptp.git
cd ptp
cpanm --installdeps . -n --with-configure
perl Makefile.PL
make
# Optionally:
# make test
sudo make install

Note that this approach is discouraged because you will need to reinstall ptp every time you update your system Perl.

About

An expressive Pipelining Text Processor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published