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
- Readers' Choice Awards 2013
- Linux Kernel News - November 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- Sublime Text: One Editor to Rule Them All?
- RSS Feeds
- Raspberry Pi: the Perfect Home Server
- Advanced Hard Drive Caching Techniques
- New Products
- Web Administration Scripts
- thanks for share, great
10 hours 4 min ago
- There are factors which are
15 hours 4 min ago
- Gnome 3 ?
15 hours 49 min ago
- Reply to comment | Linux Journal
19 hours 56 min ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 6 hours ago
- on the ground
1 day 12 hours ago
- I was able to read the whole
1 day 13 hours ago
- since i have read the title i
1 day 17 hours ago
- Belanja Online Cari Voucher Diskon
1 day 17 hours ago
- The kernel doesn't really
2 days 5 hours ago