Files
bash-programming-from-scratch/manuscript/resources/code/BashScripting/archiving-case.sh
2020-10-17 10:22:39 +02:00

23 lines
313 B
Bash

#!/bin/bash
operation="$1"
case "$operation" in
"-a")
bsdtar -c -f documents.tar ~/Documents
;;
"-c")
bsdtar -c -j -f documents.tar.bz2 ~/Documents
;;
"-x")
bsdtar -x -f documents.tar*
;;
*)
echo "Указана недопустимая опция"
exit 1
;;
esac