Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- question="$(echo -e "Add - [a] or Extract - [x]")"
- prep_archive () {
- echo -e "Name the 7z archive: "
- read new_archive
- }
- prep_files () {
- echo -e "\nType files to add to archive"
- read add_files
- }
- clean () {
- \clear
- \ls
- echo ''
- echo ''
- }
- extr () {
- echo -e "Choose archive to extract"
- read extract_file
- }
- echo $question
- read answer
- if [[ $answer = a ]]; then
- clean
- prep_archive
- prep_files
- 7z a "$new_archive".7z ./$add_files
- fi
- if [[ $answer == x ]]; then
- clean
- extr
- 7z x ./"$extract_file"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement