MySVC
an open source UNIX framework for shell script based web services provider
»Home
»Tools
»Man Page
»User Guide
»ChangeLog
»Installation
»Source Code
»Downloads
»FAQ
»Support
»License

»My Apps

Table of Contents

Davide Cucciniello <davide6169@gmail.com>

NAME

myste - My Service Template Engine - general purpose template engine

SYNOPSIS

myste [-t "<template>"]
      [-f "<inputfile>"]
      [-p <arguments>]
      [-H "<header>"]
      [-F "<footer>"]]
      [-d "<separator>"]
      [-o <outputfile>]]
      [-D "<name>[=<value>]"]*
      [-s <n>,<k> [<validator>]]
      [-s <n>^<k> [<validator>]]
      [-r <n>,<k> [<repetion>]]
      [-r <n>^<k> [<repetion>]]
      [-r <n> [<repetion>]]
      [dir ftp://<username>[:<password>]@<remotehost>[:<port>][/<remotedir>[/.]|<remotefile>] [<remotefiles>=*]]
      [get ftp://<username>[:<password>]@<remotehost>[:<port>][/<remotedir>[/.]|<remotefile>] [<localdir>=.] [<remotefiles>=*]]
      [put ftp://<username>[:<password>]@<remotehost>[:<port>][/<remotedir>] [<localdir>=.|<localfile>] [<localfiles>=*]]
      [del ftp://<username>[:<password>]@<remotehost>[:<port>][/<remotedir>[/.]|<remotefile>] [<remotefiles>=*]]
      [-e]
      [-x]
      [-C]
      [-T]
      [-X]
      [-l]
      [[-c]<configfile>]
      ["<parameter>"]

DESCRIPTION

The myste(1) command is a general purpose template engine.

Usage:

  • myste (evaluate config file from stdin)

  • myste /my/path/to/configfile (evaluate config file /my/path/to/configfile)

  • myste /my/path/to/configfile myparametername (evaluate parameter myparametername of config file /my/path/to/configfile)

  • myste /my/path/to/configfile "myparametername(arg1,…,argN)" or

  • myste -p "arg1,…,argN" /my/path/to/configfile myparametername (evaluate parameter myparametername of config file /my/path/to/configfile with arguments arg1,…,argN)

  • myste /my/path/to/configfile "myparametername[i]" (evaluate parameter myparametername of config file /my/path/to/configfile and extract substring from i-th character to the end, starting from 1)

  • myste /my/path/to/configfile "myparametername(arg1,…,argN)[i]" or

  • myste -p "arg1,…,argN" /my/path/to/configfile "myparametername[i]" (evaluate parameter myparametername of config file /my/path/to/configfile with arguments arg1,…,argN and extract substring from i-th character to the end, starting from 1)

  • myste /my/path/to/configfile "myparametername[i,j]" (evaluate parameter myparametername of config file /my/path/to/configfile and extract substring from i-th character, starting from 1, with length j)

  • myste /my/path/to/configfile "myparametername(arg1,…,argN)[i,j]" or

  • myste -p "arg1,…,argN" /my/path/to/configfile "myparametername[i,j]" (evaluate parameter myparametername of config file /my/path/to/configfile with arguments arg1,…,argN and extract substring from i-th character, starting from 1, with length j)

  • myste -f /my/path/to/inputfile -p 1,3 \ /my/path/to/configfile myparametername (evaluate parameter myparametername of config file /my/path/to/configfile using as arguments first and third field of csv input file /my/path/to/inputfile, where fields are separated by default with spaces, or with the character <separator> if is specified)

  • myste -f "/my/path/to/inputfile(x,y,z)" \ /my/path/to/configfile myparametername (evaluate parameter myparametername of config file /my/path/to/configfile using as arguments x,y,z assigned from first three fields of csv input file /my/path/to/inputfile, (first to x, second to y and third to z) where fields are separated by default with spaces, or with the character <separator> if is specified)

  • myste -e /my/path/to/configfile myparametername (evaluate parameter myparametername of config file /my/path/to/configfile using as arguments fields of csv read from stdin)

  • cat /my/path/to/configfile | myste -x (create bourne shell export script for all parameters)

  • myste -x /my/path/to/configfile (create bourne shell export script for all parameters)

  • myste -C (create on stdout an archive of all files of . directory, each file being delimited by @file <path> <content> @end <path>)

  • myste -C /my/root/path (create on stdout an archive of all files of /my/root/path directory, each file being delimited by @file <path> <content> @end <path>)

  • myste -C /my/root/path "*.txt" (create on stdout an archive of all *.txt files of /my/root/path directory, each file being delimited by @file <path> <content> @end <path>)

  • myste -x /my/path/to/configfile myparameterexpr (create bourne shell export script for parameters whose name match with regular expression contained into value of myparameterexpr)

  • myste -X (extract files from stdin, each file being delimited by @file <path> <content> @end <path>)

  • myste -X /my/path/to/configfile (extract files from config file /my/path/to/configfile, each file being delimited by @file <path> <content> @end <path>)

  • myste -X /my/path/to/configfile myparameterexpr (extract files from config file /my/path/to/configfile files whose path match with regular expression contained into value of myparameterexpr, each file being delimited by @file <path> <content> @end <path>)

  • myste -T (extract list of files from stdin, each file being delimited by @file <path> <content> @end <path>)

  • myste -T /my/path/to/configfile (extract list of files from config file /my/path/to/configfile, each file being delimited by @file <path> <content> @end <path>)

  • myste -l (extract on stdout files from stdin, each file being delimited by @file <path> <content> @end <path>)

  • myste -l /my/path/to/configfile (extract on stdout files from config file /my/path/to/configfile, each file being delimited by @file <path> <content> @end <path>)

  • myste -l /my/path/to/configfile myparameterexpr (extract on stdout files from config file /my/path/to/configfile files whose path match with regular expression contained into value of myparameterexpr, each file being delimited by @file <path> <content> @end <path>)

  • myste -s n,k [/my/path/to/validation/filter] (evaluate all combinations from n and k)

  • myste -s n^k [/my/path/to/validation/filter] (evaluate all dispositions from n and k)

  • myste dir /my/local/dir get xml local directory tree)

  • myste dir ftp://myusername:mypassword@myremotehost/my/remote/file get remote info of my/remote/file of myremotehost using ftp with myusername and mypassword)

  • myste dir ftp://myusername:mypassword@myremotehost/my/remote/dir get remote directory tree of all files under my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste dir ftp://myusername:mypassword@myremotehost/my/remote/dir/. get remote directory tree of all files under my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste dir ftp://myusername:mypassword@myremotehost:1234/my/remote/dir *.txt get remote directory tree of all files *.txt under my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername, mypassword and server port 1234)

  • myste dir ftp://myusername:mypassword@myremotehost/my/remote/dir/. *.txt get remote directory tree of all files *.txt under my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir get to current local directory all files under my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir/. get to current local directory all files under my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/file get to current local directory file my/remote/file of myremotehost using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir /my/local/dir get to local directory /my/local/dir all files under my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir/. /my/local/dir get to local directory /my/local/dir all files under my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir /my/local/dir *.txt get to local directory /my/local/dir all files *.txt under my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste get ftp://myusername:mypassword@myremotehost/my/remote/dir/. /my/local/dir *.txt get to local directory /my/local/dir all files *.txt under my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste put ftp://myusername:mypassword@myremotehost/my/remote/dir put all local files under current local directory under my/remote/dir of myremotehost with recursion on local subdirectories using ftp with myusername and mypassword)

  • myste put ftp://myusername:mypassword@myremotehost/my/remote/dir/. put all local files under current local directory under my/remote/dir of myremotehost without recursion on local subdirectories using ftp with myusername and mypassword)

  • myste put ftp://myusername:mypassword@myremotehost/my/remote/dir . *.txt put all local files *.txt under current local directory to my/remote/dir of myremotehost without recursion on local subdirectories using ftp with myusername and mypassword)

  • myste put ftp://myusername:mypassword@myremotehost/my/remote/dir /my/local/dir *.txt put all local files *.txt under local directory /my/local/dir to my/remote/dir of myremotehost with recursion on local subdirectories using ftp with myusername and mypassword)

  • myste del ftp://myusername:mypassword@myremotehost/my/remote/file del remote file my/remote/file of myremotehost using ftp with myusername and mypassword)

  • myste del ftp://myusername:mypassword@myremotehost/my/remote/dir del remote directory my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste del ftp://myusername:mypassword@myremotehost/my/remote/dir/. del remote directory my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

  • myste del ftp://myusername:mypassword@myremotehost/my/remote/dir *.txt del all files *.txt under remote directory my/remote/dir of myremotehost with recursion on subdirectories using ftp with myusername and mypassword)

  • myste del ftp://myusername:mypassword@myremotehost/my/remote/dir/. *.txt del all files *.txt under remote directory my/remote/dir of myremotehost without recursion on subdirectories using ftp with myusername and mypassword)

if template is specified, then it’s evaluated before evaluating parameters

OPTIONS

-e

foreach

-x

export

-C

create archive

-T

list archive

-X

extract archive

-l

extract on stdout

-s <n>,<k>

(valid) combinations (n>k)

-s <n>^<k>

(valid) dispositions

-r <n>,<k>*

combination(s) (n>k)

-r <n>^<k>*

disposition(s)

-r <n>

random integer between 1 and <n>

-n

not execute

-h

print help

EXIT STATUS

0

Success

1

Failure (syntax or usage error; configuration error; document processing failure; unexpected error).

BUGS

See the MySTE distribution BUGS file.

AUTHOR

Written by Davide Cucciniello, <davide6169@gmail.com>

RESOURCES

Main web site: http://www.mysvc.it/

COPYING

Copyright (C) 2002-2009 Davide Cucciniello. Free use of this software is granted under the terms of the GNU General Public License (GPL).