NAME

Signature Engine


SYNOPSIS

sigeng [ -s ] [ -x ] [ -t template-file ] quote-file ...


DESCRIPTION

Signature Engine is another signature randomizer with arbitrary output formatting capabilities.


OPTIONS

-s

Treat the quote-file as a collection of single-line quotes. The default is to have a fortune-like formatting (multi-line quotes separated by ``%%'' on an empty line.

-x

Translate the quote to another language. Currently the translation used is hard-coded in the source and translates from Finnish to English but this may change in the future.

Note that actually the quote is just mangled through a web page, and the functionality could be used for other purposes than translation also.

-t

Template file. See below for discussion of the format of the template file.

If the parameter is not given, default value of ~/.sig/template is used instead.

quote-file

Quote files are the files containing all those snappy texts you want to share with the rest of the world. The files can either be formatted as a collection of single-line quotes (each line is a quote of its own) or as a fortune-like text file with double percentage signs on an empty line separating the quotes (see -s).

TEMPLATE FILE FORMAT

The template file is actually a Perl format (see perlform(1)). The following examples should cover the most common signature use.

Contact info on top, quote follows as-is

  John Doe - www.john.doe
  
  @*
  $quote

The string "@*" is a place-holder for the whole quote text.

Contact info on top with date and time in ISO 8601 format, quote follows as-is

  John Doe - www.john.doe - @*
                            $date_iso8601
  @*
  $quote

The first "@*" is replaced with date and time, the second with the whole quote.

Contact info on top, wrapped quote follows

  John Doe - john.doe@foo.bar - www.john.doe
                    "@"
  
  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
  $quote

The quote text begins at the first caret and fills the space allotted by the lesser-than signs. The double tilde indicates that the line formatting will be repeated as long as there is input. The at-sign in the e-mail address requires a dirty hack.

Contact info on the left, wrapped text on the right

  John Doe          ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                    $quote
  john.doe@foo.bar  ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
         "@",       $quote
  www.john.doe      ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                    $quote
  ~~                ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                    $quote

The quote text fills the space allotted for them, even on multiple rows. If the double tilde is removed, a four-line limit is imposed. Still better, if it is replaced with a single tilde, the last line will be removed if empty.

Contact info on the left, wrapped text on the right, Finnish style date on the bottom

  John Doe           ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                     $quote
  john.doe@foo.bar   ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
         "@",        $quote
  www.john.doe/@jdoe ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
              "~",   $quote
  ~                  ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                     $quote
  --------------------------------------------------------
  ^<<<<<<<<<<<<<<<<<<<
  $date

The quote text fills the space allotted for them, even on multiple rows, the last line will be removed if empty. On the bottom there is a line of dashes and below that, date and time in the customary Finnish format. The tilde (~) in the url is a kludge.

Four-line limit, unfilled paragraphs

  John Doe          @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                    $quote[0]
  john.doe@foo.bar  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         "@",       $quote[1]
  www.john.doe      @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                    $quote[2]
  ~                 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                    $quote[3]

You can pick a specific line of the quote by using an array subscript.

Perl statements in the signature

  John Doe @>>>>>>>>@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
           $ENV{USER}, "@", $ENV{HOSTNAME}
  Written: @|||||||||||||||||||||||||||||||||||||||||||||
           scalar localtime
  Uptime:  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
           `uptime`
  @*
  $quote

You can easily access any perl code through the template. The quote is not even required, if you get away with other information!

Two simultaneous languages

  ^<<<<<<<<<<<<<<<<<<<<<<<<< ^>>>>>>>>>>>>>>>>>>>>>>>>> ~~
  $quote_orig,               $quote_xlated

Both fields are filled and wrapped automatically.

EXAMPLES

See TEMPLATE FILE FORMAT for template examples.

  sigenv quote_file

Get template from ~/.sig/template, read the quote from quote_file (fortune format).

  sigenv -s -t template quote_file1 quote_file2

Get template from file ``template'', read the quotes from either of the quote_filen (single-line format).

  sigenv -x quote_file

Get the quote from quote_file, and translate it from Finnish to English.

  fortune | sigenv

Read the quote from fortune output and use the default template file.

NOTES

sigenv currently requires the perl modules LWP::UserAgent, HTTP::Request::Common, HTTP::Date and HTML::Entities to be installed.

Fortunately, they can be installed automatically by issuing the following commands as root:

  perl -MCPAN -e shell
  install LWP::UserAgent
  install HTTP::Request::Common
  install HTTP::Date
  install HTML::Entities

VERSION

  • 0.2.1 (current)

    Additional variables $date and $date_iso8601 for easily adding date and time in either customary Finnish style or ISO 8601 format.

    2000-03-07 Martti Rahkila

  • 0.2

    Support for simultaneous output in two languages. Use variables $quote (for default language), $quote_orig (for original version) and $quote_xlated (for translated version). Identical array variables exist also.

  • 0.1

    Initial release.

    AUTHOR

      Matti Airas
      mairas@iki.fi
      http://www.iki.fi/mairas/