I have a file test.sh in which i have a query which gives me the count of total records in the table, as shown below:
Query:
echo db2 -x "select count(*) from testable”
Now I want to assign the whatever value it returns after executing it to the variable as totalRecords using the Unix Shell Script.