Search code examples
unixstandards

What's the deal with the banner command?


In some versions of UNIX and Linux there's a banner command (usually /usr/bin/banner) that prints great output like this:

 #####  #######    #     #####  #    #
#     #    #      # #   #     # #   #
#          #     #   #  #       #  #
 #####     #    #     # #       ###
      #    #    ####### #       #  #
#     #    #    #     # #     # #   #
 #####     #    #     #  #####  #    #

In other versions, the banner command (frequently /usr/games/banner) prints an ENORMOUS banner like you'd make in 1980 with Printshop that are suited for use at birthday parties and stuff.

I tend to love using banner for my scripts but it inherently non-portable because of this issue. Is "banner" part of UNIX and why isn't part of the POSIX standards? This is some BSD vs SysV difference but why hasn't it been resolved?

I know there's figlet which reproduces the banner that I like. But my issue with this command is portability. Banner should be part of UNIX, IMHO, even if they need to include both versions under different names (although ideally the behavior should be merged into one command with an option for the desired output).

Am I just crap out of luck when it comes to portability in scripts if I use banner?


Solution

  • Because there were the two divergent behaviours when POSIX was standardized, back in the late 80s, banner was omitted from the standard. It was not essential and there wasn't a prevailing standard to select as 'the standard'.

    And yes, you are out of luck if you use banner in your script; the behaviour is not reliable across platforms.