PHISH WWW Site - PHISH Documentation - Bait.py Commands

reverse program

Syntax:

reverse 

Examples:

wrapsink "reverse"
wrapss "reverse" 

Description:

Reverse is a stand-along non-PHISH program that can be wrapped with a PHISH minnow so it can be used in a PHISH program. In PHISH lingo, a "minnow" is a stand-alone application which makes calls to the PHISH library to exchange data with other PHISH minnows.

The reverse program simply reads lines from stdin, reverses the order of the characters, and writes the resulting string to stdout. PHISH minnows that can wrap the reverse program include the wrapsink and wrapss, which convert stdin/stdout into the receiving and sending of datums.

Ports:

The reverse program does not call the PHISH library and thus does not use PHISH ports directly. But if it is wrapped with the wrapsink or wrapss minnows then they use one input port 0 to receive datums which are then read by the reverse program via stdin. If it is wrapped with the wrapss minnow then it uses one output port 0 to send datums that are written to stdout by the reverse program.

Operation:

The reverse program simply reads a line of input from stdin, stores it as a string, reverse the order of characters in the string, and writes it to stdout. See the doc pages for the wrapsink or wrapss minnows for how they convert datums they receive to lines of text that the reverse program can read from stdin, and how they convert lines of text that the reverse program writes to stdout to datums they send.

Data:

The reverse program does not call the PHISH library and thus does not deal directly with PHISH data types.

Restrictions:

The C++ version of the reverse program allocates a buffer of size MAXLINE = 1024 bytes for reading a line from stdin. This can be changed (by editing minnow/reverse.cpp) if longer lines are needed.

Related programs:

echo