I have a set of commands in a bash script, eg running a query in impala.
#! /bin/sh
RESULT=`impala-shell -q "select count(*) from testable"`
The result of the shell script is.
Starting Impala Shell without Kerberos authentication
Connected to mycomp.cool-cluster.com:21000
Server version: impalad version 2.0.0-cdh5 RELEASE (build 12323323)
Query: select count(*) from enriched_call
Fetched 1 row(s) in 0.62s
+----------+ | count(*) | +----------+ | 234343 | +----------+
I would want to get only the value from this output ie, 234343 and try to assert the count in a script using Regex, split etc.
If I try to eliminate non numeric vaules, numbers from the version also come in. I want to split by say '|' and get the value 234343