help-recutils
[Top][All Lists]
Advanced

[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: Héctor A . Abreu
Subject: Re: [help-recutils] How can I assign a value returned from a SQL Aggregate Function to a variable?
Date: Tue, 30 Jan 2018 08:22:12 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Jan 30, 2018 at 01:52:19PM +0100, Jose E. Marchesi wrote:
>     
>     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)
> 

It works! Thank you very much, José!

Regards,
-- 
Héctor A. Abreu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]