Timeline for Check if any of the parameters to a bash script match a string
Current License: CC BY-SA 2.5
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 2, 2022 at 18:03 | review | Suggested edits | |||
Sep 3, 2022 at 2:47 | |||||
May 25, 2022 at 10:22 | comment | added | mirekphd | If you like me think that loops in scripted languages are not a good idea, here's an alternative (the answer below): superuser.com/a/186304/1276328 | |
Jan 22, 2015 at 22:57 | comment | added | Serge Stroobandt |
Here is a similar example with additional echo $1 | sed argument value processing.
|
|
Jan 22, 2015 at 22:47 | comment | added | Serge Stroobandt |
A shift statement is used when the number of arguments to a command is not known in advance, for instance when users can give as many arguments as they like. In such cases, the arguments are processed in a while loop with a test condition of $# . This condition is true as long as the number of arguments is greater than zero. The $1 variable and the shift statement process each argument. The number of arguments is reduced each time shift is executed and eventually becomes zero, upon which the while loop exits. source
|
|
Sep 9, 2010 at 20:07 | vote | accept | iman453 | ||
Sep 8, 2010 at 19:48 | history | answered | Norman Gray | CC BY-SA 2.5 |