Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to figure out which version of sed that I've got on BusyBox 1.18.3. The --version output is cryptic.

$ sed --version
This is not GNU sed version 4.0

The following code is from the relevant sed.c.

    /* Lie to autoconf when it starts asking stupid questions. */
if (argv[1] && !strcmp(argv[1], "--version")) {
    puts("This is not GNU sed version 4.0");
    return 0;
}

This is the header:

/*
 * sed.c - very minimalist version of sed
 *
 * Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley
 * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>
 * Copyright (C) 2002  Matt Kraai
 * Copyright (C) 2003 by Glenn McGrath
 * Copyright (C) 2003,2004 by Rob Landley <rob@landley.net>
 *
 * MAINTAINER: Rob Landley <rob@landley.net>
 *
 * Licensed under GPLv2, see file LICENSE in this source tree.
 */

There is also a list of "supported features and commands in this version of sed". It looks like a special sed, but how is it special? Is it custom-made for BusyBox, or does it come from another source?

How should I refer to this sed, e.g. in SE questions?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

BusyBox sed doesn't really support --version. As the comment indicates, the output is intended for configure scripts, not for humans. (It's confusing to humans in a rather silly way!) Describe it as BusyBox sed indicating the Busybox version (obtained with busybox | head -n 1).

Some BusyBox commands have optional features, and there is no generic way to find which ones were compiled in. sed doesn't have any.

As for why BusyBox sed reports that it's not GNU sed, the point is in fact that it is trying to pass off as GNU sed because it is sufficiently compatible. Some configure scripts look for the string GNU sed version nnn, and this way BusyBox sed is acceptable. Specifically, the configure script of GNU libc needed to be “[shot] in the head with a bazooka full of broken glass and rusty nails” (© Rob Landley).

share|improve this answer

It's a custom version of sed written for BusyBox. I would refer to it by the BusyBox version you've got installed, .e.g BusyBox sed v-whatever

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.