Ask Your Question
0

Problems on terminal wildcards

asked 2018-12-26 15:28:21 -0600

christianbueno gravatar image

updated 2018-12-26 15:32:35 -0600

It is weird , but I don't know what is the problem there.
I am trying to listing all the eclipse packages but i can't do that


[harvey@localhost ~]$ dnf list eclipse*
Last metadata expiration check: 4:29:56 ago on Wed 26 Dec 2018 11:44:58 AM -05.
Error: No matching Packages to list
[harvey@localhost ~]$ 

It works with python*


[harvey@localhost ~]$ dnf list python*
Last metadata expiration check: 4:30:35 ago on Wed 26 Dec 2018 11:44:58 AM -05.
Installed Packages
python-pip-wheel.noarch                     18.1-1.fc29                @updates 
python-setuptools-wheel.noarch              40.4.3-1.fc29              @anaconda
python-srpm-macros.noarch                   3-37.fc29                  @fedora 
python-systemd-doc.x86_64 234-7.fc29 @koji-override-0 python-unversioned-command.noarch 2.7.15-11.fc29 @updates python2.x86_64 2.7.15-11.fc29 @updates

I have to use \* , but I remember have been used only *


[harvey@localhost ~]$ dnf list eclipse\*
Last metadata expiration check: 4:37:25 ago on Wed 26 Dec 2018 11:44:58 AM -05.
Installed Packages
eclipse-abrt.noarch                        0.0.3-7.fc29                 @updates
eclipse-ecf-core.noarch                    3.14.4-1.fc29                @updates
eclipse-egit.noarch                        5.2.0-1.fc29                 @updates
eclipse-emf-core.noarch                    1:2.16.0-1.fc29              @updates
eclipse-emf-runtime.noarch                 2.16.0-1.fc29                @updates
eclipse-emf-xsd.noarch                     2.16.0-1.fc29                @updates

Do you have the same problem? I want to know that because It is very weird.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-12-26 17:12:27 -0600

DirkHoffmann gravatar image

Try echo eclipse* (and compare to echo python*, and you may understand what is going on.

I guess (but am quite sure) that the pattern python* does not match any of your files in the current directory, whereas eclipse* does (and transmits the matches rather than the starred expression).

Illustration:

cd $(mktemp -d) # create empty temporary directory
echo regexpattern* # will issue regexpattern*
touch regexpattern_match
echo regexpattern* # will issue regexpattern_match
touch regexpattern_anothermatch
echo regexpattern* # will issue regexpattern_match AND regexpattern_anothermatch

The preservation of an unmatched pattern in a shell argument is a Bourne Shell specific pitfall, which is not present in C-Shells (as far as I know them), which always moans about unmatched patterns and needs "escaping" like eclipse\*, which is also a solution to your problem here. (dnf list eclipse\*)

edit flag offensive delete link more

Comments

But , Do you can use $ dnf list eclipse* ?

christianbueno gravatar imagechristianbueno ( 2018-12-26 19:33:09 -0600 )edit


[harvey@localhost ~]$ echo eclipse*
eclipse eclipse-workspace-ee
[harvey@localhost ~]$ echo python*
python*
[harvey@localhost ~]$ 

christianbueno gravatar imagechristianbueno ( 2018-12-26 19:35:32 -0600 )edit

You are right , from the root directory for example all work fine

christianbueno gravatar imagechristianbueno ( 2018-12-26 19:40:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-26 15:28:21 -0600

Seen: 42 times

Last updated: Dec 26 '18