summaryrefslogtreecommitdiff
path: root/shasum
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2025-08-30 01:09:18 -0500
committerzachir <zachir@librem.one>2025-08-30 01:09:18 -0500
commitf28d694879239d5d9c319185a278236d317a49b6 (patch)
tree3f684e05c6372c8f0fc0b9f126a184f3aaad68d4 /shasum
parent7d3cbe8f708772e40608260590b717dea6735908 (diff)
Make sh scrips POSIX compliant
Using shellcheck, I went through all of them to make them standards compliant. I also tested as many as I could.
Diffstat (limited to 'shasum')
-rwxr-xr-xshasum11
1 files changed, 5 insertions, 6 deletions
diff --git a/shasum b/shasum
index 18efefd..ce40ba2 100755
--- a/shasum
+++ b/shasum
@@ -1,22 +1,21 @@
#!/bin/sh
-for i in "$@"; do
+for i; do
case $i in
"-a") BITS="y"
continue
;;
*)
- ARGS="$i "
+ ARGS="$i"
;;
esac
if [ -n "$BITS" ]; then
- case $i in
+ case "$i" in
256|512)
- PROGRAM="sha"$i"sum"
+ PROGRAM="sha${i}sum"
;;
esac
unset BITS
fi
done
-cat - | "$PROGRAM" $ARGS
-echo "$PROGRAM $ARGS"
+"$PROGRAM" ${ARGS:+"$ARGS"}