Translation update done using Pootle.
[phpmyadmin/dkf.git] / libraries / transformations / generator.sh
blobaa4900e7893c383615ec4183ffb993deffd9d5f2
1 #!/bin/bash
2 # $Id$
4 # Shell script that adds a new function file using a template. Should not be called directly
5 # but instead by template_Generator.sh and template_generator_mimetype.sh
8 # $1: Template
9 # $2: Filename
10 # $3: (optional) Description
12 if [ $# == 0 ]
13 then
14 echo "Please call template_generator.sh or template_generator_mimetype.sh instead"
15 echo ""
16 exit 65
18 functionupper="`echo $2 | tr [:lower:] [:upper:]`"
19 functionlower="`echo $2 | tr [:upper:] [:lower:]`"
21 sed "s/\[ENTER_FILENAME_HERE\]/$functionupper/; s/\[enter_filename_here\]/$functionlower/; s/Description of the transformation./$3/;" < $1 > $2.inc.php
23 echo "Created $2.inc.php"
24 echo ""