I currently want to extract a value from a SQL command responde
somehting like this:
psql db -c "SELECT COUNT(test) FROM tbTest;"
the result is:
count
------
33176
(1 row)
I want to extract the 33176 value… is there any simple way to do this?
If it is always return in that format (expected result on line 3), you can use this:
The explanation: