Timeline for How to parse positional parameters of Bash script when using "Bash Strict Mode"?
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 4, 2023 at 13:47 | comment | added | Kusalananda♦ | @ilkkachu I know they do, but I'm assuming they are not the only ones that will read the answer. I'm also assuming that people that read the answer do not necessarily read, understand, or care about the finer details of the code in the question. | |
| Apr 4, 2023 at 12:52 | comment | added | ilkkachu | @Kusalananda, though note that here, they're explicitly setting IFS=$'\n\t' as part of that hyperstrict preamble of theirs... out of the four things there, that's probably the most useful part (IMO anyway, and yes, they could still change it later) | |
| Apr 4, 2023 at 10:17 | comment | added | Kusalananda♦ | @TobySpeight See also the "What about [ $# -gt 1 ]" section here: Security implications of forgetting to quote a variable in bash/POSIX shells | |
| Apr 4, 2023 at 10:16 | comment | added | Toby Speight | Ah, that old edge-case! Thanks. :-) | |
| Apr 4, 2023 at 10:15 | comment | added | Kusalananda♦ | @TobySpeight If you can guarantee that everyone reading this answer never set IFS to a value containing digits. | |
| Apr 4, 2023 at 10:15 | comment | added | Toby Speight | When does $# need quoting? I thought it always expanded to a digit sequence, hence always safe without quotes. | |
| Apr 4, 2023 at 10:12 | vote | accept | Shuzheng | ||
| Apr 4, 2023 at 10:12 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 306 characters in body |
| Apr 4, 2023 at 10:00 | comment | added | Stéphane Chazelas | Or while (( $# )) in Korn-like shells such as bash. | |
| Apr 4, 2023 at 9:41 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 7 characters in body |
| Apr 4, 2023 at 9:35 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 86 characters in body |
| Apr 4, 2023 at 9:23 | history | answered | Kusalananda♦ | CC BY-SA 4.0 |