Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    Usually, if you are using indices, you are doing something wrong. What is it you are actually trying to match? There is probably a much simpler, much more idiomatic solution. Commented Mar 19, 2017 at 23:47
  • I don't know what an indice is :S. But i was just trying to check for all the parameters given, and then check if a parameter contains multiple letters, such as "rm -rf ..." Commented Mar 19, 2017 at 23:53
  • Also, read about the getopts command in the bash man page. Commented Mar 19, 2017 at 23:54
  • Thanks for the hint on getopts i'll check that out! Commented Mar 20, 2017 at 0:07