Tech Tip: Using Figlet to Spice Up Your Scripts
Shell Scripts are very useful but not all that fun to look at. They have simple user input and output text. But, there is a way to spice up your scripts and make them a bit more eye catching with a simple program called "Figlet".
Figlet is in the repositories for most distributions of Linux and is very simple to use. If you've used the "echo" command (which you probably have) you already know how to use the basic functionality of Figlet. Here's an example of "echo" and "Figlet" next to each other:
You can see that Figlet's ASCII art style output will catch someone's attention more then the regular echo output would.
You can display the content of a file using Figlet like this:
If you would like to display the output of a command using Figlet simply pipe the command into Figlet:
Figlet comes with a few different font styles. To see a list of available fonts use the "figlist" command. To choose a font use the "-f" switch:
Here is a little script I wrote to display what each font looks like.
#!/bin/bash figlist | while read font do figlet -f $font "$font" done
If you would like to have a nice looking clock in your terminal window you can use this script
#!/bin/bash while [ 1 ]; do clear date +%r | figlet sleep 1 done
Practical Task Scheduling Deployment
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released