summaryrefslogtreecommitdiff
path: root/shasum
blob: 18efefdc968b76a7e85e075798e0ca480915eca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

for i in "$@"; do
  case $i in
    "-a") BITS="y"
      continue
      ;;
    *)
      ARGS="$i "
      ;;
  esac
  if [ -n "$BITS" ]; then
    case $i in
      256|512)
        PROGRAM="sha"$i"sum"
        ;;
    esac
    unset BITS
  fi
done
cat - | "$PROGRAM" $ARGS
echo "$PROGRAM $ARGS"