help-recutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Boolean comparison on fields with same name


From: Sven Wick
Subject: Boolean comparison on fields with same name
Date: Mon, 13 Jun 2022 22:27:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

Hi Jose,

I want to create a little database
about software packages and put some tags on them
but am stuck on querying fields with the same name.

Maybe I do it wrong or it is not supposed to work that way:

# Database

$ cat db.rec

name: ssh-tools
homepage: https://github.com/vaporup/ssh-tools
description: collection of various tools using ssh
tag: cli
tag: ssh

name: direnv
homepage: https://direnv.net
description: set directory specific environment variables
tag: cli
tag: env

# Example 1 (expected)

$ recsel -e "tag = 'ssh' || tag = 'env'" -p name,tag db.rec

name: ssh-tools
tag: cli
tag: ssh

name: direnv
tag: cli
tag: env

# Example 2 (expected)

$ recsel -e "tag[1] = 'ssh' && tag[0] = 'cli'" -p name,tag db.rec

name: ssh-tools
tag: cli
tag: ssh


# Example 3 (unexpected)

$ recsel -e "tag = 'ssh' && tag = 'cli'" -p name,tag db.rec

no result


Thanks for the help



--
Sysadmin by Nature




reply via email to

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