#  $Id: mks1sed.in 0.03 2000/05/28 00:00:03 tom Exp $
#
#  mks1sed.in:  Generates a shell script file from the DEFINITION-FILE.
#
#
#  Copyright (c) 2000  Thomas Esken      <esken@gmx.net>
#                      Im Hagenfeld 84
#                      D-48147 M"unster
#                      GERMANY
#
#  This software doesn't claim completeness, correctness or usability.
#  On principle I will not be liable for ANY damages or losses (implicit
#  or explicit), which result from using or handling my software.
#  If you use this software, you agree without any exception to this
#  agreement, which binds you LEGALLY !!
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the `GNU General Public License' as published by
#  the `Free Software Foundation'; either version 2, or (at your option)
#  any later version.
#
#  You should have received a copy of the `GNU General Public License'
#  along with this program; if not, write to the:
#
#    Free Software Foundation, Inc.
#    59 Temple Place - Suite 330
#    Boston, MA 02111-1307,  USA
#
#
# First line, insert header text.
1 {
  i\
#! /bin/sh\
\
# Automatically generated by mksamp-1.sed from @DEFINITION_FILE@.\

}
# Convert `%%%' prefixed lines ==> `%%%XYZ' is substituted to `echo "\$ XYZ"'.
/^%%%/ {
  s/^%%%/echo "\$ /
  s/$/"/
# Print pattern space.
  P
}
# Convert `%%>' prefixed lines ==> `%%>XYZ' is substituted to `echo "> XYZ"'.
/^%%>/ {
  s/^%%>/echo "> /
  s/$/"/
# Print pattern space.
  P
}
# Convert `***' prefixed lines ==> `***XYZ' is substituted to `XYZ'
/^\*\*\*/ {
  s/^\*\*\*//
# Append a newline after substitution.
  a\

# Print pattern space.
  P
}
# Last line, insert `exit 0' text.
$ {
  i\
exit 0
}
# Clear pattern space and start new cycle.
  d
