Beta

BASH commands: Wildcards I

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • notingpersonnel Avatar

    There's a general convention to return zero when everything is ok (one way to do it) or when error has occured (many ways, hence many numbers).

  • FArekkusu Avatar

    I'm pretty sure this is a duplicate as well. I vaguely remember doing an exact same task in Python or some similar language with "." instead of "?".

  • FArekkusu Avatar

    Tests shouldn't log anything.

  • FArekkusu Avatar

    Tests throw warnings.

  • FArekkusu Avatar

    It's not clear whether the pattern will always have the same length as the filename.

    • user9644768 Avatar

      The question mark wildcard ? is very similar in its behavior to the . in Regexp, that is, it matches any character as long as its there. For example, .? will match .a and ._, but not a and not .. This effectively implies that the pattern length should equal the length of the matched string.

    • FArekkusu Avatar

      This says nothing about the actual function inputs.

    • user9644768 Avatar

      Yeah, you're right. What's bad in assuming that they can be of any length, and for valid match they gotta be same?

  • dinglemouse Avatar

    Please remove all the compiler warnings caused by test code

  • siebenschlaefer Avatar

    This comment has been hidden.

    • siebenschlaefer Avatar

      BTW: I like your idea of extending criterion.

      Do you know a good alternative to your _write_t_buf(what) assignment trick in the describe, context and it macros? I like to solve and translate some katas on my computer and my compiler warns a lot that there is a unused variable ‘_’ in

      for(..., _ = (...); ...; ...)
      
    • lilsweetcaligula Avatar

      Danke sehr, Siebenschlaefer!

      I will address the issues immediately.

      Let me think a little how I could help you and come back with an answer in a few.

    • lilsweetcaligula Avatar

      I think this should fix it:

      for(int _i = 0, _ = (_write_t_buf(what), _print_descr(), _rewind_t_buf()); _i < 1; (void)_, ++_i) ...
      

      Please let me know if it works for you.

      I will update the test suite now. Thank you for letting me know!

    • siebenschlaefer Avatar

      Yes, that does it. Thank you very much! BTW: Are you on Gitter?

    • lilsweetcaligula Avatar

      Thank you very much! I will update all of the katas using the suite right now.

      You've coded up a cool solution there, btw!

      Indeed, I'm on Gitter, same nickname as here: lilsweetcaligula. If you'd like, I could send you a PM on Gitter right now so it'll be easier for you to find me.

    • siebenschlaefer Avatar

      This comment has been hidden.