shellcat - templating system with shell syntax

NAME  SYNOPSIS  DESCRIPTION  OPTIONS  TEMPLATE SYNTAX  ENVIRONMENT  SEE ALSO 

NAME

shellcat − templating system with shell syntax

SYNOPSIS

shellcat [−s SHELL] TEMPLATE [ARG...]

shellcat {−h | −−help | −v | −−version}

DESCRIPTION

shellcat is a template processor, which uses shell script syntax. It can be used to produce static HTML pages, or pre-process any sort of text document.

OPTIONS

−s, −−shell=SHELL

Use the specified shell. The default is /bin/sh.

−h, −−help

Display help and exit.

−v, −−version

Output version information and exit.

TEMPLATE SYNTAX

text

Unless specified otherwise below, any text is echoed verbatim:

$ cat ex1.sc
Hello world!
$ shellcat ex1.sc
Hello world!

#!interpreter

If the first line of the template starts with #! characters, it is completely ignored. This allows for executable scripts with shellcat as interpreter:

$ cat ex2.sc
#!/usr/bin/shellcat
Hello world!
$ chmod +x ex2.sc
$ ./ex2.sc
Hello world!

<$ code $>

The code is executed by the shell:

$ cat ex3.sc
<$ for x in $(seq 3); do $>Hello world!
<$ done $>
$ shellcat ex3.sc
Hello world!
Hello world!
Hello world!

Whitespace around code is strongly recommended, but not obligatory; see below however.

−$>

If used inside a code block, the $> sequence (with the leading minus sign omitted) is used in the shell code:

$ cat ex4.sc
<$ echo '−$> not closed yet' $>
$ shellcat ex4.sc
$> not closed yet

<$−

If used outside a code block, the <$ sequence (with the trailing minus sign omitted) is output:

$ cat ex5.sc
<$− not code $>
$ shellcat ex5.sc
<$ not code $>

ENVIRONMENT

The following environment variables are available for the processes spawned by shellcat:
SHELLCAT

name of the shellcat interpreter

Variables which existed in the environment are not modified, but left intact.

SEE ALSO

sh(1)


Updated 2024-01-29 - jenkler.se | uex.se