Listing 5. Shell Example #Construct SQL, place in $sql read -d 'EOF' sql<&1) if [ $? = "1" ] then # An error occurred. Print and exit printf "Error: $ret.\n" printf "SQL: $sql\n" exit 1 else # No errors, print the SQL for row in $ret do IFS="|" # Set variables from record. set $row # Assign for convenience. firstname=$1 lastname=$2 dir=$3 printf "%-14s %-15s\n" \ $firstname $lastname unset IFS done fi