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.

Required fields*

5
  • oh, wow. Yes, somehow. but I want quite more and tried to keep the question simple. But I keep this for later, thanks! Commented Jul 13, 2015 at 8:14
  • I edited something similar into my answer, refreshed, and saw your answer - great minds think alike? ;) I have one question though, are you avoiding nullglob intentionally or is that a stylistic choice? Commented Jul 13, 2015 at 8:19
  • I wasn't aware of nullglob until now … this changes things quite a bit … I'll be back later Commented Jul 13, 2015 at 8:22
  • 1
    @Score_Under - i never use that stuff if it can be helped. It doesn't require much to avoid it, and in doing so you can write code which you can expect to perform much the same in most any shell. I don't even use shell arrays - i kind of hate names and memory storage and would rather just process, but I think that's how the += thing works. If this were my script i wouldn't store anything, the above would be a function, would process args as needed, and return accordingly, This kind of thing aalways seems beside the point. Commented Jul 13, 2015 at 8:27
  • @mikeserv Could you plaese explain your solution a bit more? I think to get most of it, but then, it's just guesswork with missing bits. Thanks! Commented Jul 13, 2015 at 20:58