SUMMARY (Preliminary): at jobs from bash

From: Ray Schnitzler (
Date: Tue Oct 20 1992 - 20:19:38 CDT

I've received a number of replies, most of which don't work, perhaps because I
was not clear enough in the problem statment.

Most of the suggestions were various methods of making sure that my shell of
choice executed my script. This is not the problem; it does that just fine.
The problem is that a typical atjob file looks like this:
# at job
# owner: root
# jobname: stdin
# shell: sh
# notify by mail: no

export llargs
export cpu
export CDPATH
export term
export DISPLAY
....<more var defs>
lln='() { \ ls -bCF $llargs -t $* | head\}'
export lln
....<more function defs>
$SHELL << '...the rest of this file is shell input'
# @(#).proto 1.3 88/02/08 SMI; from S5R3 1.1
cd mydir


The last piece, "my_shell_commands" is executed correctly by $SHELL (and this
does the right thing if I use -s or -c), but ALL OF THE PRECEEDING STUFF is
executed by /bin/sh REGARDLESS of my shell.

Further research suggests that the problem is that bash thinks of functions as
sort-of, almost variables (whereas ksh and sh do not). That is, if I say
"set" to bash, I see functions and variables (unlike ksh, sh, or csh).

The part of "at" that constructs this preamble of envariable settings
therefore contains variable settings for functions, which of course don't
work when executed by sh in the preamble.

What limited experimentation that I can do with ksh suggests that functions
are not available in atjobs; there are no functions represented in the
preamble at all, in any form. (Under bash, they pretend to be available,
though they clearly don't work.)

Unless someone knows of an "at" that filters out these bogosities or rewrites
functions into legal function-definition syntax, it seems that I am out of

I think that I will write such a beast.

Thanks for your help.

Ray Schnitzler
UniPress Software (Adam Shostack)
Dieter Muller <>
John A. Murphy <> (Brett Lymn)
Torsten Metzner <> (Timothy G. Smith - Special Projects) (Dick St.Peters)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:52 CDT