tags:

views:

690

answers:

3

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

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

In other's the banner command (frequently /usr/games/banner) prints an ENORMOUS banner intended for use at birthday parties and stuff like you'd make in 1980 in Printshop.

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?

+4  A: 

It isn't really essential to a unix system, I am not sure why it would be part of the standard. There are a many other things that are arguably more important that the standard setting bodies should be focused on.

If it isn't available on the system you could simply install it or build a equivalent.

There is a banner clone on debian it has a single c file with 155 lines of code, and most of that is just the glyphs. The source can be found on the package page. http://packages.debian.org/testing/misc/sysvbanner

It shouldn't be too difficult to even build another clone in the scripting language of your choice.

Zoredache
+2  A: 

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.

Jonathan Leffler
This is the answer that I was fearing. It's a shame it's not in the UNIX standard. From my perspective, it is important enough to have been there. I'll wait a couple days for additional answers but if nothing conflicts, I'll mark your answer as accepted. Thanks.
Dr. Person Person II
+3  A: 

There's always FIGLet. Gives source for unix, windows, dos, mac etc. hope this points you in the right direction.

Also, there's TOIlet, which could be considered figlet++.

MikeJ
http://www.network-science.de/ascii/
guns
thats pretty cool, but I thing the propoent is looking for something they can put into makefiles during builds for use as a header on a build report etc.
MikeJ