shellcat − templating system with shell syntax
shellcat [−s SHELL] TEMPLATE [ARG...]
shellcat {−h | −−help | −v | −−version}
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.
−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.
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 $>
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.
sh(1)