border_set - Linux


Overview

border_set is a powerful command-line utility used to control the display of ASCII art borders around text and other elements in a terminal environment. It provides extensive customization options, allowing users to create visually appealing borders for various purposes, such as emphasizing text sections, creating tables, and enhancing the aesthetics of scripts.

Syntax

border_set [options] [text]

Options/Flags

  • -w, –width: Set the width of the border in characters. Default: 1
  • -h, –height: Set the height of the border in lines. Default: 1
  • -t, –top: Border style for the top. Options: 0, 1, 2, 3, 4, single, double, tb, tt, ttb
  • -b, –bottom: Border style for the bottom. Options: same as -t
  • -l, –left: Border style for the left. Options: same as -t
  • -r, –right: Border style for the right. Options: same as -t
  • -c, –corners: Border style for the corners. Options: 0, 1, 2, 3, +, o, O
  • -s, –space: Number of spaces between the text and the border. Default: 1
  • -p, –padding: Number of empty lines above and below the text. Default: 1
  • -a, –align: Text alignment within the border. Options: left, center, right
  • -f, –fill: Character to fill the empty space in the border. Default: (space)

Examples

  • Create a simple border around the text "Important Notice":
border_set "Important Notice"
  • Create a border with double lines on top and bottom, and single lines on the sides:
border_set -t double -b double "Section Heading"
  • Create a border with a width of 3 characters and rounded corners:
border_set -w 3 -corners O "Custom Design"
  • Create a border with a specific text alignment:
border_set -a right "Centered Text"

Common Issues

  • Incorrect border style: Ensure the provided border style is a valid option from the specified list.
  • Invalid dimensions: Check that the specified width and height are positive integers.

Integration

border_set can be used in conjunction with other commands to create advanced borders for complex scenarios. For instance, it can be combined with sed, tr, and printf to generate dynamic borders based on the length of the text.

Related Commands

  • ascii – Generates ASCII art
  • figlet – Creates large ASCII text banners
  • boxes – Draws ASCII boxes

border_set documentation