Fix shellcheck errors and warnings

Created by: oxr463

shellcheck genfstab
 
Line 51:
out() { printf "$1 $2\n" "${@:3}"; }
               ^-- SC2059: Don't use variables in the printf format string. Use printf '..%s..' "$foo".
 
Line 72:
  local i= chr= out=
         ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
              ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
 
Line 90:
  local i= chr= out= len=$(( ${#1} - 4 ))
         ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
              ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
                   ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
 
Line 164:
  local options_=$1
        ^-- SC2178: Variable was used as an array but is now assigned a string.
 
Line 194:
  read dm_name <"/sys/class/block/${1#/dev/}/dm/name"
  ^-- SC2162: read without -r will mangle backslashes.
 
Line 215:
  local src=$1 spec= label= uuid= comment=()
                   ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
                          ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
                                ^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
 
Line 243:
  [[ $comment ]] && printf '# %s\n' "${comment[*]}"
     ^-- SC2128: Expanding an array without an index only gives the first element.
 
Line 276:
      if optstring_get_option "$varname" codepage && [[ $codepage = cp* ]]; then
                                                        ^-- SC2154: codepage is referenced but not assigned.
 
Line 417:
  read
  ^-- SC2162: read without -r will mangle backslashes.

Reference(s):

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information