I currently want to extract a value from a SQL command responde
somehting like this:
psql db -c "SELECT COUNT(test) FROM tbTest;"
If it is always return in that format (expected result on line 3), you can use this:
psql db -c "SELECT COUNT(test) FROM tbTest;" | tail -n 2 | head -n 1
tail -n 2will get the last 2 line and then processed by
head -n 1which mean, get first 1 line.