Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash problem?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 575

PostPosted: Fri Apr 12, 2024 10:37 am    Post subject: bash problem? Reply with quote

Code:

g64 ~ # bash -x d=($(equery l \*))
bash: syntax error near unexpected token `('


is it problem in bash or equery?
:oops: :roll:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1745
Location: Germany

PostPosted: Fri Apr 12, 2024 11:08 am    Post subject: Reply with quote

What is your goal here?
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9612
Location: beyond the rim

PostPosted: Fri Apr 12, 2024 11:10 am    Post subject: Reply with quote

bash expects a filename as argument, not some random code.
Also not sure what your plan was with that, equery is a python script, so bash -x has no effect on it.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 454
Location: Naarm/Melbourne, Australia

PostPosted: Fri Apr 12, 2024 1:54 pm    Post subject: Reply with quote

Assuming you're trying to do this in a bash session, and not in some other interactive shell:

If you simply want to assign the output of `equery l *` to the variable `d`, and want `*` as a wildcard/glob for all the entries in the current directory, rather than passing an asterisk as an argument to equery (which would be .... odd), you can just do:

Code:
$ d=$(equery l *)

Which means: "Run `equery l *` in a subshell, and put resulting output in the `d` variable."
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22687

PostPosted: Fri Apr 12, 2024 2:46 pm    Post subject: Reply with quote

flexibeast wrote:
If you simply want to assign the output of `equery l *` to the variable `d`, and want `*` as a wildcard/glob for all the entries in the current directory, rather than passing an asterisk as an argument to equery (which would be .... odd), you can just do:
Although unusual in general, for equery l, this is well-defined. Per the manual, this instructs equery to list all installed packages.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 454
Location: Naarm/Melbourne, Australia

PostPosted: Sat Apr 13, 2024 12:24 am    Post subject: Reply with quote

Hu wrote:
Per the manual, this instructs equery to list all installed packages.

Ah okay, thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum