It appears that during the install of the oss642a patch, a new
/etc/default/cron is installed. It sets a more secure PATH than
before (TA117784)[1] and also appears to set other variables:
NOTESHELL, INPUT, OLDPARSING.
I have checked the man pages, the SCO site and on pcunix.com and
cannot determine what they are for. A script run from cron does
not get passed these as envvars so should I worry about them? Are
they internal to the cron daemon?
Regards,
Alex
[1] I guess a thorough audit of shell scripts run from cron is
required to ensure the PATH is explicitly set or that each command
has a full pathname. Oh joy!
But /etc/default/cron describes the purpose of each of those
variables; which part of the text leaves you with "cannot
determine what they are for"?
--
JP
Did it? I read only the lines that appeared to be shell envvar assignment
statements. I'm sorry I can't recheck this: I lost my job yesterday and
now don't have access to an OpenServer box.
/etc/default/cron appeared to have the same syntax as a shell script. It
has lines like "OLDPARSING=YES" which appears to be an assignment; and
comments are introduced with a "#". When I ran a shell script from cron,
I could echo the PATH variable, set as above, but was unable to access
the NOTESHELL, INPUT and OLDPARSING envvars (l.h.sides?). I did not notice
a new man page distributed with the VOLS containing descriptions.
It's been an education reading this group. Many Thanks CUSM via google.
Alex
A new man page was not included, but comments were added to
/etc/default/cron, as JPR stated. I just downloaded a fresh copy of
oss642a, extracted etc/default/cron from it, and here is an excerpt:
# NOTESHELL - If set to YES, users submitting cron and at jobs are
# notified if their login shell is different from the shell
# that is used by cron to run jobs.
Setting this to NO turns off the annoying warning:
"warning: commands will be executed using /bin/sh"
# INPUT - If set to NO, the cron job input mechanism is disabled:
# neither % nor \ are changed, removed, or otherwise treated
# specially.
# OLDPARSING - If set to YES, \ and % in cron jobs are acted on in the
# way they were up through OpenServer 5.0.6.
These control the parsing of lines in a crontab. It is an attempt to
get control over an old feature that few people knew about, but which
caused trouble in some crontabs: '%' means `newline'.
There are three combinations:
INPUT=YES, OLDPARSING=YES -- acts like cron in OSR506 and earlier. If
there are any '%' chars in a crontab command field, they are converted
to newlines. The command (everything before the first newline) is
passed the rest as standard input. So:
* * * * * cat%foo%bar%
means: ``every minute, run `cat`, passing as standard input a file
with 2 lines containing the texts "foo" and "bar"''.
=========================================================================
INPUT=YES, OLDPARSING=NO (default configuration in OSR507 and oss642a)
-- same, except now you can prevent the special interpretation of '%'
chars with a backslash. So:
* * * * * echo foo%bar
means: ``every minute, run `echo foo`, passing as stdin a file with
one line containing "bar"''. But:
* * * * * echo foo\%bar
means: ``every minute, run `echo foo%bar`''.
NOTICE that this changes the meaning of '\' in existing crontabs. To
express a literal '\' you need two of them:
* * * * * printf "This outputs\\ntwo lines."
=========================================================================
INPUT=NO, OLDPARSING=(ignored) -- characters '%' and '\' have no
special meaning in crontab lines. So:
* * * * * echo foo%bar
* * * * * echo foo\%bar
means: ``every minute, run `echo foo%bar`'', and ``every minute, run
`echo foo\%bar`''
>Bela<