On Thu, 31 Jul 2003, McKown, John wrote:

> This is definately for the MVS transplants. I'm looking at doing something
> akin to what ISPF does with its skeleton facility. That is, I have a file
> which contains JCL. Instead of hard-coding some things, there would be
> "variables" which would be replaced by the appropriate content when a script
> is executed. For instance, suppose I have a script similar to:
>
> #!/bin/sh
> mfid=$(id -an | tr 'a-z' 'A-Z')
> acct='(A,B)'
> jobclass='A'
> msgclass='C'
> pgmrid='John McKown'
> .. do skeleton processing here
> .. more processing
>
> The "skeleton" would contain something like:
>
> //{mfid}A JOB ${acct},\'${pgmrid}\',
> // MSGCLASS=${msgclass},
> // CLASS=${jobclass}
>
> After processing, some output file would contain:
>
> //JMCKOWNA JOB (A,B),'John McKown',
> // MSGCLASS=C,
> // CLASS=A
>
> What I was thinking, but obviously doesn't work is:
>
> cat <<EOF >output.file
> .skeleton
> EOF
>
> If I make the "cat" command as the first statement in the skeleton and the
> EOF the last statement, this works as I want. For some reason, I find this
> inelegant.
>
> Where "skeleton" contains the above. But I can't thing of a way to "source"
> a file within a HERE document. So far, I'm only using BASH. But this may be
> a case where I'm force to something more powerful such as Perl.

or m4.

Take a look at your sendmail configuration files for what you can do
with m4.

This is the start of the file that generates sendmail.cf:
[EMAIL PROTECTED] mail]$ head -20 /etc/mail/sendmail.mc
divert(-1)
dnl This is the sendmail macro config file. If you make changes to this
file,
dnl you need the sendmail-cf rpm installed and then have to generate a
dnl new /etc/sendmail.cf by running the following command:
dnl
dnl        m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
OSTYPE(`linux')
define(`confDEF_USER_ID',``8:12'')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/mail/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
[EMAIL PROTECTED] mail]$



--


Cheers
John.

Join the "Linux Support by Small Businesses" list at
http://mail.computerdatasafe.com.au/mailman/listinfo/lssb
Copyright John Summerfield. Reproduction prohibited.

Reply via email to