Why does a shell script fail in crontab?

Maarten Litmaath maart at cs.vu.nl
Tue Oct 18 15:02:44 AEST 1988


In article <287 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
\when it runs from crontab it produces a zero size Index file, yet when I
\run it by hand from a uid 0 shell it succedes, and generates the correct
\Index file.
\...
\bm "#N" [du].* | sed 's/:#N/ /' | tr -s '\011, ' ' ' | \
\    awk '{ for (i = NF; i > 1; --i) printf "%s\t%s\n", $i, $1 }' | \
\    sort -u > Index

I bet `bm' is in /usr/local, which is not in sh's standard PATH, but IS in
yours!
The `Index' file is created, but the command fails.

\Note: this is a setuid
\root shell script - yes I am aware of the possible security leak, but there
\are only two people who use lakart that are unix.wizards, and we both know
\the root password.

Some people will never learn...
-- 
Hippic sport:                         |Maarten Litmaath @ Free U Amsterdam:
             a contradiction in terms.|maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list