Advertisement
v1ral_ITS

Untitled

Jan 6th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. question="$(echo -e "Add - [a] or Extract - [x]")"
  3. prep_archive () {
  4.     echo -e "Name the 7z archive: "
  5.     read new_archive
  6. }
  7. prep_files () {
  8.     echo -e "\nType files to add to archive"
  9.     read add_files
  10. }
  11.  
  12. clean () {
  13.     \clear
  14.     \ls
  15.     echo ''
  16.     echo ''
  17. }
  18. extr () {
  19.     echo -e "Choose archive to extract"
  20.     read extract_file
  21. }
  22. echo $question
  23. read answer
  24.  
  25. if [[ $answer = a ]]; then
  26.     clean
  27.     prep_archive
  28.     prep_files
  29.         7z a "$new_archive".7z ./$add_files
  30. fi
  31. if [[ $answer == x ]]; then
  32.     clean
  33.     extr
  34.     7z x ./"$extract_file"
  35. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement