LDP/LDP/guide/docbook/abs-guide/poem.sh

41 lines
896 B
Bash

#!/bin/bash
# poem.sh: Pretty-prints one of the ABS Guide author's favorite poems.
# Lines of the poem (single stanza).
Line[1]="I do not know which to prefer,"
Line[2]="The beauty of inflections"
Line[3]="Or the beauty of innuendoes,"
Line[4]="The blackbird whistling"
Line[5]="Or just after."
# Note that quoting permits embedding whitespace.
# Attribution.
Attrib[1]=" Wallace Stevens"
Attrib[2]="\"Thirteen Ways of Looking at a Blackbird\""
# This poem is in the Public Domain (copyright expired).
echo
tput bold # Bold print.
for index in 1 2 3 4 5 # Five lines.
do
printf " %s\n" "${Line[index]}"
done
for index in 1 2 # Two attribution lines.
do
printf " %s\n" "${Attrib[index]}"
done
tput sgr0 # Reset terminal.
# See 'tput' docs.
echo
exit 0
# Exercise:
# --------
# Modify this script to pretty-print a poem from a text data file.