I am assigning the count from a sql query to a shell variable. But there seems to be some other blank spaces coming up.
output=$(
$ORACLEHOME/bin/sqlplus -s $DBUSER/$DBPASSWORD <<EOF
set pages 0 feed off echo off
SELECT COUNT(1)
FROM TABLE_NAME
exit;
EOF
)
echo "output is $output"
echo "length of output is ${#output}"
the length should be coming as 1. But it is coming as 3. Any help is appreciated.
db queryalone in the question please. Also post the output.