View previous topic :: View next topic |
Author |
Message |
honeymak Guru
Joined: 30 Dec 2002 Posts: 575
|
Posted: Fri Apr 12, 2024 10:37 am Post subject: bash problem? |
|
|
Code: |
g64 ~ # bash -x d=($(equery l \*))
bash: syntax error near unexpected token `('
|
is it problem in bash or equery?
_________________ hackers - make sth real
academics - read sth said to be real |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1745 Location: Germany
|
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9612 Location: beyond the rim
|
Posted: Fri Apr 12, 2024 11:10 am Post subject: |
|
|
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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 454 Location: Naarm/Melbourne, Australia
|
Posted: Fri Apr 12, 2024 1:54 pm Post subject: |
|
|
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:
Which means: "Run `equery l *` in a subshell, and put resulting output in the `d` variable." |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22687
|
Posted: Fri Apr 12, 2024 2:46 pm Post subject: |
|
|
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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 454 Location: Naarm/Melbourne, Australia
|
Posted: Sat Apr 13, 2024 12:24 am Post subject: |
|
|
Hu wrote: | Per the manual, this instructs equery to list all installed packages. |
Ah okay, thank you! |
|
Back to top |
|
|
|