crontab Daemon-from-Hell
Daniel R. Levy
levy at cbnewsc.ATT.COM
Mon Jun 5 14:23:54 AEST 1989
In article <694 at galaxia.Newport.RI.US>, dave at galaxia.Newport.RI.US (David H. Brierley) writes:
< >>> cd /usr/spool/uucppublic
< >>> find . -type f -mtime +30 -exec rm -f {} \;
< If you execute a 'cd' command to a directory that
< does not exist the only thing that happens is that you get a stupid little
< error message. If your current directory is '/', which is normally the case
< for the 'smgr' process, and you execute the two commands listed above, and
< for some reason the 'cd' command fails, this will have the effect of wiping out
< every file on your machine which has not been modified within the last 30 days.
This only happens if the commands are entered into an interactive shell session.
If they are in a script being run by /bin/sh, a "cd" that fails will abort the
script (O.K., will abort the shell running the script). Korn shell (/bin/ksh)
will not abort, however, on a failed cd in a script. This is a feature to
permit recovery from inability to cd somewhere but for the unwary script-writer
it can cause trouble like the above....
--
Daniel R. Levy UNIX(R) mail: att!ttbcad!levy, att!cbnewsc!levy
AT&T Bell Laboratories
5555 West Touhy Avenue Any opinions expressed in the message above are
Skokie, Illinois 60077 mine, and not necessarily AT&T's.
More information about the Unix-pc.general
mailing list