Skip to main content

Timeline for Shift bash arguments from the right

Current License: CC BY-SA 3.0

4 events
when toggle format what by license comment
Apr 1, 2016 at 0:52 comment added Wildcard @dimo414 I'm well aware of that. As you can see I've now included the code example using flags. I just decided to post my answer without waiting until I finished the second example, since it's still useful without. Nothing wrong at all with optional positional parameters; I would happily use either of the code examples above in production scenarios.
Apr 1, 2016 at 0:50 history edited Wildcard CC BY-SA 3.0
added 737 characters in body
Apr 1, 2016 at 0:45 comment added dimo414 The "first and third but not second" argument applies equally to commands that shift left; as soon as you start needing arbitrary subsets of the arguments you should be using flags. That doesn't mean that programs with optional positional parameters are fundamentally flawed.
Apr 1, 2016 at 0:43 history answered Wildcard CC BY-SA 3.0