Skip to content

somebody explain me wildcard * in fish,for bash i have no issues.  #4175

Closed

Description

@sk0x1234

fish, version 2.5.0
Arch linux, URxvt
scannig my private local hosts discovery

nmap 192.168.1-3.*
No matches for wildcard '192.168.1-3.'. (Tip: empty matches are allowed in 'set', 'count', 'for'.)
fish: nmap 192.168.1-3.

$ bash shell it runs Okay ??

Activity

  1. krader1961 commented on Jul 2, 2017

    @krader1961
    Contributor

    Fish version 2.3 made "failglob" the default behavior (see issue #2719). This was done to catch mistakes made by the user. This is equivalent to shopt -o failglob in bash. In fish you should quote the string containing a glob character: nmap '192.168.1-3.*'.

  2. krader1961 commented on Jul 2, 2017

    @krader1961
    Contributor

    Also, the default bash behavior is what could be described as "passglob" although that option isn't valid and thus can't be explicitly set in bash. That is, a glob that doesn't match any files is passed to the command without expansion. See also the "nullglob" option in bash.

  3. faho commented on Jul 2, 2017

    @faho
    Member

    To explain the bash behavior a bit more:

    With that command, it tries to find files that match 192.168.1-3.*. If it doesn't find them, it runs the command with a literal 192.168.1-3.*. If it does, it passes the matching filenames instead.

    So try touch 192.168.1-3.banana (which creates a file called 192.168.1-3.banana) and run that command again in bash. It'll fail.

    What you should have done even in bash is to quote the argument - nmap '192.168.1-3.*'. That will also work in fish.

  4. anordal commented on Jul 3, 2017

    @anordal
    Contributor

    Essentially the same issue as #3649. In response to that, fish 2.6 got a new error message: #3919

  5. krader1961 commented on Jul 5, 2017

    @krader1961
    Contributor

    Closing since I think we've answered the question. Feel free to reopen, @narutowindy, if that isn't the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions