2023

We've noticed that some of our automatic tests fail when they run at 00:30 but work fine the rest of the day. They fail with the message

gimme gimme gimme

in stderr, which wasn't expected. Why are we getting this output?

AdminBee
  • 23,716
  • 25
  • 56
  • 78

3 Answers3

2692

Dear @colmmacuait, I think that if you type "man" at 0001 hours it should print "gimme gimme gimme". #abba
@marnanel - 3 November 2011

er, that was my fault, I suggested it. Sorry.

Pretty much the whole story is in the commit. The maintainer of man is a good friend of mine, and one day six years ago I jokingly said to him that if you invoke man after midnight it should print "gimme gimme gimme", because of the Abba song called "Gimme gimme gimme a man after midnight":

Well, he did actually put it in. A few people were amused to discover it, and we mostly forgot about it until today.

I can't speak for Col, obviously, but I didn't expect this to ever cause any problems: what sort of test would break on parsing the output of man with no page specified? I suppose I shouldn't be surprised that one turned up eventually, but it did take six years.

(The commit message calls me Thomas, which is my legal first name though I don't use it online much.)

This issue has been fixed with commit 84bde8: Running man with man -w will no longer trigger this easter egg.

Chris Davies
  • 130,320
  • 473
    Oops! It was never meant to affect non-error cases. I didn't take account of this when I implemented https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=e37bc92f352c97c61ef63de745e43574d27b1276.

    Fixed in master: https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=84bde8d8a9a357bd372793d25746ac6b49480525

    – Colin Watson Nov 21 '17 at 09:55
  • 3
    Comments are not for extended discussion; this conversation has been moved to chat. – terdon Nov 21 '17 at 17:45
  • 15
    The comments are for asking for clarification and/or discussing the technical points of an answer. If you want to discuss the merits of Easter eggs, please take it to chat. – terdon Nov 21 '17 at 17:46
522

This is an easter egg in man. When you run man without specifying the page or with -w, it outputs "gimme gimme gimme" to stderr, but only at 00:30:

# date +%T -s "00:30:00"
00:30:00
# man -w
gimme gimme gimme
/usr/local/share/man:/usr/share/man:/usr/man

The exit code is always 0.

The correct output should always be:

# man -w
/usr/local/share/man:/usr/share/man:/usr/man
# echo $?
0
# man
What manual page do you want?
# echo $?
1

The string "gimme gimme gimme" can be found in RHEL, OpenSUSE, Fedora, Debian and probably more, so it's not really distro specific. You can grep your man binary to verify.

This code is responsible for the output, added by this commit:

src/man.c-1167- if (first_arg == argc) {
src/man.c-1168-   /* 
http://twitter.com/#!/marnanel/status/132280557190119424 */
src/man.c-1169-   time_t now = time (NULL);
src/man.c-1170-   struct tm *localnow = localtime (&now);
src/man.c-1171-   if (localnow &&
src/man.c-1172-       localnow->tm_hour == 0 && localnow->tm_min == 30)
src/man.c:1173:     fprintf (stderr, "gimme gimme gimme\n");

I have contacted RHEL support about this issue.

The string comes from well known ABBA song Gimme! Gimme! Gimme! (A Man After Midnight).


The developer of the man-db, Colin Watson, decided that there was enough fun and the story won't get forgotten and removed the easter egg completely.

Thank you Colin!

  • 171
    On platforms with faketime available you can try this without even needing to change the system time: faketime '00:30:00' man (Debian 8). – Chris Davies Nov 20 '17 at 15:05
  • 2
    Other such: https://unix.stackexchange.com/questions/767/ https://unix.stackexchange.com/questions/92185/ https://unix.stackexchange.com/questions/224481/ https://unix.stackexchange.com/questions/150121/ – JdeBP Nov 20 '17 at 16:30
  • 6
    @rrauenza There is the buzilla ticket: https://bugzilla.redhat.com/show_bug.cgi?id=1515352 – Jaroslav Kucera Nov 21 '17 at 07:41
  • 47
    The author has now tightened the easter egg to only run on man, not man -w: http://git.savannah.nongnu.org/cgit/man-db.git/commit/src/man.c?id=84bde8d8a9a357bd372793d25746ac6b49480525 and Colin's comment on Marnanel's confessio^Wanswer. – Martijn Pieters Nov 21 '17 at 10:09
  • 44
    Let's mention that the initial commit triggered at 12:01am. A followup commit changed that to 12:30am with the commit log message "half past twelve" which is again quoted from the same song. – egmont Nov 21 '17 at 21:00
  • 9
    @0x90 man -w prints the current manual page search path, which is the sort of thing you might quite reasonably use as a building block for something else, for example if the thing you were automating involved installing or testing manual pages. – Colin Watson Nov 25 '17 at 20:06
487

After some reflection, I've removed this Easter egg. It'll be gone in the upcoming man-db 2.8.0.

I'm glad that it made some people smile, which after all was the whole purpose of it, and my Twitter notifications and so on today suggest that most people thought it was more amusing than annoying. Still, some people did find it annoying, and six years seems like a pretty good run for that sort of thing; it probably isn't going to get significantly better exposure than it already unexpectedly has by way of this question. Time to put it to bed.

Colin Watson
  • 4,186
  • 1
  • 12
  • 15