setterm syntax changed

Richard W.M. Jones rjones at redhat.com
Wed Jun 25 14:02:40 UTC 2014


On Wed, Jun 25, 2014 at 12:06:10AM -0400, Felix Miata wrote:
> Was there good reason to change it? For well over a decade across
> all distros I've used, I've included this line in root's .bashrc,
> always:
> 
> 	setterm -foreground white -bold -background blue -blank 59 -store
> 
> The current man page has changed to require "--" where "-" was
> sufficient previously. Now my ancient .bashrc generates
> 
> 	setterm: argument error: -backgound
> 
> on login, and nothing that worked before works now. :-(

This is a non backwards compatible change in upstream util-linux:

  commit fb27f91cac9702ad1858d782dd840d5868547423
  Author: Sami Kerola <kerolasa iki.fi>
  Date:   Mon May 19 22:21:14 2014 +0100

    setterm: recommend long options with double hyphen
    
    While the -version style options will work for next unknown number of
    years start moving towards user interface that has way of invoking long
    options as most of the other commands.
    
    Signed-off-by: Sami Kerola <kerolasa iki.fi>

so sooner or later it's going to affect all distros ...

My suggestion would be to replace your command with:

  if setterm --help 2>&1 | grep -q -- --background; then
    setterm --foreground white --bold --background blue --blank 59 --store
  else
    setterm -foreground white -bold -background blue -blank 59 -store
  fi

But yes, backwards incompatible changes suck, although in this case
setterm has historically done something non-standard.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top


More information about the devel mailing list