А дальше
for i in ${result[*]} ; do
echo $i
done
Advanced Bash scripting Guide Вам в помощь.
http://tldp.org/LDP/abs/html/$ aptitude show abs-guide
Package: abs-guide
State: not installed
Version: 4.1-1
Priority: optional
Section: multiverse/doc
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Uncompressed Size: 4436k
Recommends: lynx | www-browser
Description: The Advanced Bash-Scripting Guide
An in-depth exploration of the art of shell scripting.
This tutorial assumes no previous knowledge of scripting or programming, but progresses rapidly toward an
intermediate/advanced level of instruction ... all the while sneaking in little snippets of UNIX(R) wisdom and lore. It
serves as a textbook, a manual for self-study, and a reference and source of knowledge on shell scripting techniques. The
exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really
learn scripting is to write scripts.
This book is suitable for classroom use as a general introduction to programming concepts.
Tags: role::documentation
Или можно на AWK обработку писать:
mysql -e 'select ... ' | awk ' программа '