jabbrv icon indicating copy to clipboard operation
jabbrv copied to clipboard

Fix various style and security issues in shell scripts:

Open logological opened this issue 3 months ago • 0 comments

  • Use -- so that variables or globs that expand to names with dashes don't become command-line options
  • Use $(...) instead of legacy `...`
  • Quote variables when necessary to prevent globbing
  • Remove extraneous semicolons at ends of commands
  • Remove extraneous invocations of cat
  • Use built-in ${var//x/y} or ${var/%x/y} instead of echo $var | sed s/x/y/
  • Use while true instead of while [ 1 ]
  • Use -r with read to avoid mistaken interpretation of escape codes
  • Use [:lower:] and [:upper:] instead of a-z and A-Z with tr to support non-ASCII characters

logological avatar Sep 05 '25 00:09 logological