News for hackers. Stuff that matters.
Re:Write Posix Shell by _dain_ on Saturday March 11, 2023 @12:37PM (#35110602)

    $ shellcheck myscript
     
    Line 1:
    #!/bin/bash -eux -o pipefail
    ^-- SC2096 (error): On most OS, shebangs can only specify a single parameter.
     
    Line 4:
    trap "rm -rf $TMPDIR" SIGINT SIGTERM ERR EXIT
                 ^-- SC2064 (warning): Use single quotes, otherwise this expands now rather than when signalled.
     
    Line 6:
          cd $TMPDIR
             ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

    Did you mean: (apply this, apply all SC2086)
          cd "$TMPDIR"
     
    Line 9:
          baz $TMP | tee baz.out &
              ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

    Did you mean: (apply this, apply all SC2086)
          baz "$TMP" | tee baz.out &
     
    Line 13:
    tar -cf - -C $TEMPDIR | zstd -6 -z - | pv | ssh server.com bash -c "cat - > out.tag.zstd"
                 ^-- SC2086 (info): Double quote to prevent globbing and word splitting.
                 ^-- SC2153 (info): Possible misspelling: TEMPDIR may not be assigned. Did you mean TMPDIR?

    Did you mean: (apply this, apply all SC2086)
    tar -cf - -C "$TEMPDIR" | zstd -6 -z - | pv | ssh server.com bash -c "cat - > out.tag.zstd"

There are no comments on this comment yet.