Subject: Bug#4316: cron -- crontab -l prints excess header

From: "Brian C. White" <[email-masked]>
Date: Tue, 27 Aug 1996 21:28:22 -0400

Package: cron
Version: 3.0pl1-34

Running "crontab -l" has a bad habit of displaying header information
that is not actually part of the crontab.

For example:

$ crontab -l -u gnats
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Mon Jul 29 14:07:28 1996)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
5,15,25,35,45,55 * * * * /usr/lib/gnats/queue-pr --run

Those first three lines do not appear when using "crontab -e" and they
cause problems if trying to modify the crontab using a script since
reading the crontab via "crontab -l", modifying it, and the sending
the changed data to "crontab" will end up with a duplicate header stored.
The output of "crontab -l" would then be something like:

$ crontab -l | <presumably some edit script here> | crontab; crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Mon Jul 29 14:07:28 1996)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Mon Jul 29 14:07:28 1996)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
5,15,25,35,45,55 * * * * /usr/lib/gnats/queue-pr --run

Would you mind stripping these first three lines from the "crontab -l"
output?
                                                  
                                               Brian
                                      ( [email-masked] )
                                                  
-------------------------------------------------------------------------------
 the difference between theory and practice is less in theory than in practice

---

From: Steve Greenland <[email-masked]>
Date: Tue, 27 Aug 1996 22:58:25 -0500 (CDT)

Brian C. White wrote:
> [snip]

Yes, because I think there is useful information there (primarily
the second line, with the file name (usually) and date).

Since it's in a script anyway, why not strip it yourself:

 crontab -l |sed -e '1,/^# (Cron version/ d'

(actually "sed -e '1,3 d'" would proably be sufficient.)

I'm going to close this one.

Steve Greenland

-- 
The Mole - I think, therefore I scream