Skip to main content
6 events
when toggle format what by license comment
Dec 15, 2021 at 13:31 vote accept Edward
Dec 13, 2021 at 13:26 comment added Toby Speight Oh, forgot to say: the entire script appears to use only the POSIX features of Bash, so could easily write #!/bin/sh for more portable script - check Shellcheck results with both as an extra check.
Dec 13, 2021 at 13:22 history edited Toby Speight CC BY-SA 4.0
added 18 characters in body
Dec 13, 2021 at 13:21 comment added Toby Speight The only thing simple that comes to mind is a quick case "$source" in *[][/*.+]*) exit 1;; esac to outright refuse to work in those cases (extend the [] to include all regex metacharacters plus newline, and add a friendly message). That was what I was cryptically referencing with my "constrain the allowed characters" reference (sorry - v. busy today). I think it's easier to transform a pattern to regexp than vice versa, if you're considering trying to make both substitutions equivalent; I imagine you'd want some pretty rigorous testing if you go that way.
Dec 13, 2021 at 13:14 comment added Edward Good stuff. Have you a suggestion for addressing the "worrying" code?
Dec 13, 2021 at 13:03 history answered Toby Speight CC BY-SA 4.0