My OS is AIX5.1, ksh and DB2 UDB 8.1 for AIX, the following is my screen capture. Why the second echo command print a NULL string?
db2 "select count(*) from spe.reexecutepoint"
1
-----------
2
1 record(s) selected.
$ unset a
$ db2 "select count(*) from spe.reexecutepoint" | sed -n '4s/[[:blank:]]//gp' | read a
$ echo $a
2
$ unset a
$ a=`db2 "select count(*) from spe.reexecutepoint" | sed -n '4s/[[:blank:]]//gp'`
$ echo $a
$ unset a
$ a=`db2 connect to dl>/dev/null;db2 "select count(*) from spe.reexecutepoint" | sed -n '4s/[[:blank:]]//gp'`
$ echo $a
2
$