38

I'm looking for a program that turns an ASCII string into something like the "ascii art" below:

    .-"^`\                                        /`^"-.
  .'   ___\                                      /___   `.
 /    /.---.                                    .---.\    \
|    //     '-.  ___________________________ .-'     \\    |
|   ;|         \/--------------------------//         |;   |
\   ||       |\_)          Red Hat         (_/|       ||   /
 \  | \  . \ ;  |     Enterprise Linux     || ; / .  / |  /
  '\_\ \\ \ \ \ |                          ||/ / / // /_/'
        \\ \ \ \|    Server Release 5.3    |/ / / //
         `'-\_\_\     Codename Tikanga     /_/_/-'`
                '--------------------------'

I don't have a matching example but I would like the string be turned into some multi line text, like:

 __    __
/  |  /  |
|  |  |  |
|  |--|  |
|  |--|  |
|  |  |  | 
|_/   |_/

for the letter H and so on... I would like to use this to show certain warning messages, for example when the user is about to run a script that will delete the production database and so on...

Thanks!

raoulsson
  • 4,633
  • 10
  • 32
  • 29

6 Answers6

80
$ figlet you want figlet
                                         _      __ _       _      _   
 _   _  ___  _   _  __      ____ _ _ __ | |_   / _(_) __ _| | ___| |_ 
| | | |/ _ \| | | | \ \ /\ / / _` | '_ \| __| | |_| |/ _` | |/ _ \ __|
| |_| | (_) | |_| |  \ V  V / (_| | | | | |_  |  _| | (_| | |  __/ |_ 
 \__, |\___/ \__,_|   \_/\_/ \__,_|_| |_|\__| |_| |_|\__, |_|\___|\__|
 |___/                                               |___/            

jeff
  • 3,006
  • 1
  • 19
  • 10
17

There's also the old-school command "banner". It is crude but effective.

$ banner banner

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

A bit of googling showed me that rpmfind knows where to find it (although rpmfind appears to be having problems themselves these days...)

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77
5

cowsay

$ cowsay cowsay makes banners
 ______________________
< cowsay makes banners >
 ----------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

$ cowsay -f tux cowsay is customisable
 ________________________
< cowsay is customisable >
 ------------------------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/

cowsay is amusingly '90s and provides a bunch of options for tweaking the cow's appearance. Read man cowsay.

It's still packaged for Ubuntu and Debian: sudo apt install cowsay

william.berg
  • 51
  • 1
  • 2
4

Toilet is even better. ;) I always used it as code banner for my applications

  ▞▀▖         ▐     ▜  ▙▗▌      ▗▐         
  ▌  ▙▀▖▌ ▌▞▀▘▜▀ ▝▀▖▐  ▌▘▌▞▀▖▛▀▖▄▜▀ ▞▀▖▙▀▖ 
  ▌ ▖▌  ▚▄▌▝▀▖▐ ▖▞▀▌▐  ▌ ▌▌ ▌▌ ▌▐▐ ▖▌ ▌▌   
  ▝▀ ▘  ▗▄▘▀▀  ▀ ▝▀▘ ▘ ▘ ▘▝▀ ▘ ▘▀▘▀ ▝▀ ▘   

There's a pretty good write-up of how to use it over on cyberciti.biz, titled: UNIX / Linux: Display Large Colourful Text Banner On Screen

slm
  • 7,355
  • 16
  • 54
  • 72
smihael
  • 143
  • 5
4

Figlet can do that, and is in the Ubuntu Repos sudo apt-get install figlet:

"Using Figlet to Spice Up your Scripts" is a recent Linux Journal Article on the Topic.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
3

It is likely that your first example was created using boxes.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148