How to convert tcsh script so it can run with "at"?

How to convert tcsh script so it can run with "at"?

Post by tim wern » Wed, 26 Jul 1995 04:00:00



Hi,

I have a nice little script that starts/restarts dip for me, written for
tcsh.

The problem is that it fails miserably when run under "at".  The man
page for "at" reveals that it uses only /bin/sh.  I tried to write a
/bin/sh script that ran tcsh with my script as input, but that didn't
work, either.

Cron has the same problem under Linux.

So, have any of you Linuxen got a tip-sheet or something that will help
a csh programmer convert his script to /bin/sh?  I can read sh, but not
write it.  I am just looking for sufficient guidelines to get something
written, that I could then debug myself.  I asked this question on
comp.unix.shell, but so far, no one has come forward with any such
information.

thanks,
tw

--

Well, Bust My Britches!  Eggs Almondine and a Bottle of Beaujolais!

 
 
 

How to convert tcsh script so it can run with "at"?

Post by Karl_Kleinpa.. » Thu, 27 Jul 1995 04:00:00



> I have a nice little script that starts/restarts dip for me, written for
> tcsh.
> The problem is that it fails miserably when run under "at".  The man
> page for "at" reveals that it uses only /bin/sh.  I tried to write a
> /bin/sh script that ran tcsh with my script as input, but that didn't
> work, either.

You should be able to do one of several things.  One, make the first
line of your script
        #!/bin/tcsh -fb
which should force the system, below the level of at or cron, to run
the script with tcsh.  Otherwise, two, invoke the script properly out
of at, e.g.,
        tcsh -fb /full/path/to/script
You can't use
        tcsh < /full/path/to/script
for a variety of reasons, but direct invocation without stdio redirect
should work.