mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
18 lines
298 B
Bash
18 lines
298 B
Bash
#!/bin/bash
|
|
|
|
operation="$1"
|
|
|
|
if [[ "$operation" == "-a" ]]
|
|
then
|
|
bsdtar -c -f documents.tar ~/Documents
|
|
elif [[ "$operation" == "-c" ]]
|
|
then
|
|
bsdtar -c -j -f documents.tar.bz2 ~/Documents
|
|
elif [[ "$operation" == "-x" ]]
|
|
then
|
|
bsdtar -x -f documents.tar*
|
|
else
|
|
echo "Invalid option"
|
|
exit 1
|
|
fi
|