What I have done in this test is: 1. Install a job in cron. The job is simple: grep a string in a very big file, which is a concatenation of rfcs; 2. After cron finished the job, cat the result and running time; 3. Execute the very same job under bash, then cat the result and running time; 4. The comparison of results shows that cron is more efficient than bash. I can't find a reason to explain this. 5. I hope bash can do a job as efficient as cron.
[EMAIL PROTECTED] work]# date Fri Mar 2 18:39:39 CST 2007 [EMAIL PROTECTED] work]# crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.11170 installed on Fri Mar 2 18:37:20 2007) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 38 18 * * * date > "/home/work/tm.log" ; grep comment /home/work/a_big_txt.file | wc -l > "/home/work/ln.cnt"; date >> "/home/work/tm.log" [EMAIL PROTECTED] work]# cat tm.log Fri Mar 2 18:38:00 CST 2007 Fri Mar 2 18:38:00 CST 2007 [EMAIL PROTECTED] work]# cat ln.cnt 5004 [EMAIL PROTECTED] work]# date > "/home/work/tm.log" ; grep comment /home/work/a_big_txt.file | wc -l > "/home/work/ln.cnt"; date >> "/home/work/tm.log" [EMAIL PROTECTED] work]# cat tm.log Fri Mar 2 18:40:09 CST 2007 Fri Mar 2 18:40:44 CST 2007 [EMAIL PROTECTED] work]# cat ln.cnt 5004 [EMAIL PROTECTED] work]# uname -a Linux localhost.localdomain 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] work]# cat /etc/issue Red Hat Linux release 9 (Shrike) Kernel \r on an \m [EMAIL PROTECTED] work]# ls -la a_big_txt.file -rw-r--r-- 1 root root 226942520 Feb 27 14:01 a_big_txt.file [EMAIL PROTECTED] work]# wc -l a_big_txt.file 5966449 a_big_txt.file [EMAIL PROTECTED] work]# _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash