<!--
  canonical-url: https://www.avonture.be/blog/bash-ascii-art
  published:     2023-12-19
  This is a static plain-Markdown mirror generated at build time.
  Visit the canonical URL above for the fully rendered page, with images and interactive components.
-->

# Bash - ASCII art

> Learn how to add eye-catching ASCII art banners to your Bash scripts for a bigger visual impact. Includes a full sample code implementation.

---
![Bash - ASCII art](/img/v2/ascii_art.webp)

**TL;DR**

This short article shows how to add an ASCII-art banner to Bash scripts for a bit of visual flair, generated with the free patorjk.com/software/taag tool and echoed at the top of the script.

I write a lot of Bash scripts, and I like to have a similar approach for each one: a banner, [a logging function](/blog/bash-logging), [doc blocks above each function](/blog/linux-generate-documentation-from-bash-scripts). One of the things I always do is to include a good old-fashioned *ASCII Art* banner, perhaps for the geek factor, but mostly to make a bigger visual impact.

I use <https://patorjk.com/software/taag> to create my banners, so let's take a closer look. *The same idea, applied to a website instead of a console: [Inject ASCII Art in any HTML pages rendered by Docusaurus](/blog/docusaurus-ascii-art).*

![Sample ASCII art](./images/sample.webp)

For my part, I'm implementing the banner like this:

**script.sh**

```bash
#!/usr/bin/env bash
set -euo pipefail

function __main() {

    clear

    # http://patorjk.com/software/taag/#p=display&f=Big&t=My%20Nice%20Script
    cat <<\EOF
  __  __         _   _ _             _____           _       _
 |  \/  |       | \ | (_)           / ____|         (_)     | |
 | \  / |_   _  |  \| |_  ___ ___  | (___   ___ _ __ _ _ __ | |_
 | |\/| | | | | | . ` | |/ __/ _ \  \___ \ / __| '__| | '_ \| __|
 | |  | | |_| | | |\  | | (_|  __/  ____) | (__| |  | | |_) | |_
 |_|  |_|\__, | |_| \_|_|\___\___| |_____/ \___|_|  |_| .__/ \__|
          __/ |                                       | |
         |___/                                        |_|

EOF
    printf "%s\n\n" "(c) Copyright ..."

    # Program the functions of your script here,
    # such as calling your functions

    return 0
}

__main "$@"
```

And this is how it'll look in my bash terminal:

![Terminal](./images/terminal.webp)
