diff options
author | FRIGN <dev@frign.de> | 2016-09-07 23:10:05 +0200 |
---|---|---|
committer | FRIGN <dev@frign.de> | 2016-09-07 23:10:05 +0200 |
commit | 1f8903d1689e5f796fbe227587081d28f864cb07 (patch) | |
tree | 0d8ba9d4510bdac6298548b9dad64042e3c3ec4a | |
parent | 3fa775e1dfd5dc38648f88c2f385be1f0fe45605 (diff) |
Shellcheck 2ff fixes
I was inspired by the current discussion on dev@ to use shellcheck to
check my scripts and thought it might be a good choice to do this for
the 2ff script.
Not much had to be changed, because I was careful writing it, but still
it won't hurt to but $TMP in double quotes.
-rwxr-xr-x | 2ff | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -5,17 +5,17 @@ if [ "$#" -ne 0 ]; then fi TMP=$(mktemp) -cat > $TMP; +cat > "$TMP"; -FORMAT=$(file -ib $TMP | cut -d ";" -f 1); +FORMAT=$(file -ib "$TMP" | cut -d ";" -f 1); case "$FORMAT" in - image/png) png2ff < $TMP; ret=$? ;; - image/jpeg) jpg2ff < $TMP; ret=$? ;; - *) convert $TMP png:- 2>/dev/null | png2ff 2>/dev/null; ret=$? ;; + image/png) png2ff < "$TMP"; ret=$? ;; + image/jpeg) jpg2ff < "$TMP"; ret=$? ;; + *) convert "$TMP" png:- 2>/dev/null | png2ff 2>/dev/null; ret=$? ;; esac -rm $TMP; +rm "$TMP"; if [ $ret -ne 0 ]; then printf "%s: failed to convert %s\n" "$0" "$FORMAT" >&2; |