Trident provides an easy way to pass the output of one command to any number of targets.

Overview

Trident: The multiple-pipe system

Trident provides an easy way to pipe the output of one command to not just one but many targets. These targets can be other commands, or files, and it can be filtered (line-wise) through a regular expression.

Introduction

A trident file is split into Jobs, which consist of

  • A job name. A valid job name starts with either a letter or an underscore, followed by zero or more letters, digits or underscores. That means, job0 is a valid name, but 0job is not.
  • A command. This is any program, along with any number of arguments. Arguments which contain any of the reserved words JOB, CMD, OUT or FILE must be set in quotation marks (either single or double quotes are allowed).
  • One or more targets. A target can either be a file, or another job. A target can also contain a regular expression, in which case the output of this job will be filtered through this RegEx, and only those lines which match are passed to the actual target.

Syntax

To define a new job, use the keyword JOB followed by the job name. Then, the keyword CMD is followed by the program and its arguments. Finally, the keyword OUT indicates the start of the list of targets. A target consists of an optional RegEx (enclosed in /re/), either the keyword FILE and the name of a file (absolute or relative path), or JOB followed by the job name. The special file names stdout and stderr are reserved for their standard usage.

To invert a regular expression (and thus output every line not matching it), precede it by an exclamation mark: ! /re/.

Examples

This example file in essence recreates the functionality of grep:

JOB repeat
CMD cat
OUT
	- /regular exression/ FILE stdout

A sightly more sophisticated example might read URLs and store the associated IPs in a file.

JOB repeat
CMD cat
OUT
	- /^\([0-9]\{1,3\}.\)\{3\}[0-9]\{1,3\}$/ FILE ips.dat
	- /\w/ JOB query_dns

JOB query_dns
CMD dig +short a -f -
OUT
	- FILE queried_ips.dat

In this example, the main job reads data from stdin, and all lines that match a (very crude) match for an IP are written directly to a file. Those lines that contain at least one word character are queried from a DNS first, and then written to a different file. Note that no two jobs can access the same file at the same time (except for stdout and stderr).

Command line interface

Trident takes as command line arguments the paths to the input files, which are read in the order that they appear in. All files are considered as one continuous stream of input.

After parsing all input files, by default trident executes the first job defined in the input. This behaviour can be overwritten by using the command line option -s to explicitly provide a job name:

./trident example.tr -s latex

Compilation

Trident uses Flex and Bison/Yacc for parsing input, so both of those need to be installed.

This repository uses CMake as its build system, so to compile trident simply run

mkdir build
cd build
cmake ..
make -j

After finishing the compilation, an executable file called trident will be created in the directory build. If you want to install the program system-wide, additionally run

sudo make install
Owner
Matthias Gessinger
Just your average Scientist, Code Monkey, general Nerd. Ke nu jurkadi ti Mando'ade.
Matthias Gessinger
Kaprekar constant, number 6174, number 495.

Kaprekar Constant Demos Kaprekar constant, number 6174, number 495. This repository contains 1 Visual Studio solution, which managing 2 Visual Studio

MatrixLife 1 Dec 25, 2021
Toy LLVM obfuscator pass

ToyObfuscator Some simple obfuscator ;) (base on llvm-10) Compile Build out-tree pass git clone https://github.com/veritas501/ToyObfuscator.git cd Toy

veritas501 38 Jun 14, 2022
A gazebo actor plugin that utilizes the map of the environment and graph search methods to generate random actor trajectories that don't pass through walls, furniture, etc.

Gazebo-Map-Actor-Plugin A gazebo actor plugin that utilizes the map of the environment and graph search methods to generate random actor trajectories

Yasin Sonmez 10 Jun 25, 2022
Small and convenient C2 tool for Windows targets

Micro Backdoor for Windows Micro Backdoor is C2 tool for Windows targets with easy customizable code base and small footprint. Micro Backdoor consists

Dmytro Oleksiuk 420 Jun 23, 2022
Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas.

Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas. With a theoretical transmission range of 10 miles (16kms), OTG messenger can be used by groups of people to stay connected when they are in areas not serviced by mobile connectivity.

Trevor Attema 488 Jun 19, 2022
Memory Process File System (MemProcFS) is an easy and convenient way of viewing physical memory as files in a virtual file system

The Memory Process File System (MemProcFS) is an easy and convenient way of viewing physical memory as files in a virtual file system.

Ulf Frisk 1.3k Jun 23, 2022
Lock you keyboard and clean your screen. A simple, and easy way to clean your computers.

Pristine Cleaner A screen and keyboard cleaning application made to turn screen black, and lock keyboard for easy cleaning. With features such as star

Rhino Inani 2 Jan 16, 2022
Allows an easy way to replace levels' songs with their respective NONG songs.

NONG-Replace Allows an easy way to replace levels' songs with their respective NONG songs. NOTE: THIS REQUIRES MEGA HACK V6!! If you do not have it, t

null 3 Nov 10, 2021
🎁 An easy way to install DWM + Dots

DWM - DOTS ━━━━━━ ❖ ━━━━━━ Window Manager • DWM ?? Tiles Everywhere! Shell • Zsh ?? con oh-my-zsh framework! Terminal • Kitty ?? Una terminal que sopo

linuxmobile ( リナックス ) 36 Jun 9, 2022
sampctl-runner: Easy way to build and run package..

sampctl-runner Easy way to build and run package.. Usage Just enter the name of the repository from pawn.json and let the program do other things.. Ex

Emmett 1 Apr 17, 2022
It creates a random word by mixing two English common words into a single one, each one with the first character in capital letter. It also allow you to scroll down infinitely without repeating the same word twice.

startup_namer A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Samuel Cobas 2 Feb 3, 2022
Any one can add their programs here ,but program should not be repeated.

Hactoberfest2021 To All the Beginners Guys Don't Forget to give star to this repo. Any one can add their programs here ,but program should not be repe

Varun.py 22 Jun 12, 2022
Add a command interpreter (eg., REPL) to any C++ program

Command Interpreter This header-only library makes it easy to add command evaluation to a C++ program. #include "command_interpreter.hpp" class Arith

Empirical Software Solutions, LLC 405 Jun 8, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

null 103 Jun 20, 2022
Automatically load dlls into any executables without replacing any files!

Automatically loaded dll using xinput9_1_0 proxy. Please put the modified xinput9_1_0.dll in the executable's directory.

null 11 Apr 17, 2022
Create a calculator of any kind in any language, create a pr.

calculators Create a calculator of any kind in any language, create a pr. Create a calculator of any type using the programming language of your choic

Akshay Gautam 2 Dec 1, 2021
Turn your ESP32 into a easy to use micro web-server allowing to interact with any GPIO by simple http(s) calls.

WebhooksTriggeredESP32WiFi Turn your ESP32 into an easy to use and manage wireless micro web-server allowing it to process reliably and asynchronouly

JayDeLux 4 Jun 1, 2022