mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
18 lines
240 B
Bash
18 lines
240 B
Bash
#!/bin/bash
|
|
|
|
option="$1"
|
|
|
|
declare -A utils=(
|
|
["-b"]="bsdtar"
|
|
["--bsdtar"]="bsdtar"
|
|
["-t"]="tar"
|
|
["--tar"]="tar")
|
|
|
|
if [[ -z "$option" || ! -v utils["$option"] ]]
|
|
then
|
|
echo "Invalid option"
|
|
exit 1
|
|
fi
|
|
|
|
${utils["$option"]} "${@:2}"
|