[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-recutils] How can I assign a value returned from a SQL Aggrega
From: |
Jose E. Marchesi |
Subject: |
Re: [help-recutils] How can I assign a value returned from a SQL Aggregate Function to a variable? |
Date: |
Tue, 30 Jan 2018 13:52:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
If a have a line like this in a bash script:
recsel -p "Count(Category):NumCategories" items.rec
How can I get the value of Count(Category) or NumCategories and assign
it to a variable? The example in the manual includes the -p option,
but I need to assign it to a variable and not just to print it on a
screen. I tried by removing the -p option and assigning
Count(Category) to a variable, no success. I also tried to assign
NumCategories, same result. I even tried to assign the whole recsel
instruction with is Count(Category) to a variable, but I guess I am
missing something.
Please help. Thank you in advance for any hint or help.
Would something like this help?
FOO=$(recsel -P "Count(Category)" items.rec)