Advertisement
Guest User

My Code for File Manager

a guest
Jul 13th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. clear
  4.  
  5. echo "File Manager 1.0"
  6. echo "Usage: file {backup | remove | display}"
  7.  
  8. read decision
  9.  
  10. if [ "$decision" == "file backup" ]; then
  11.     clear
  12.  
  13.     echo "What would you like to name the backed up file?"
  14.     read backupname
  15.  
  16.     echo "What is the directory of the file you want to back up?"
  17.     read backupdirectory
  18.  
  19.     cp $backupdirectory File_Backups/$backupname
  20.  
  21.     clear
  22.     echo " . "
  23.  
  24.     sleep 1
  25.     clear
  26.     echo "   . "
  27.  
  28.     sleep 1
  29.     clear
  30.     echo "        . "
  31.  
  32.     sleep 1
  33.     clear
  34.     echo "Your file has been backed up."
  35. fi
  36.  
  37. if [ "$decision" == "file remove" ]; then
  38.     clear
  39.  
  40.     echo "What is the directory of the file you want to remove?"
  41.     read fileremove
  42.  
  43.     echo "Are you sure you want to remove this file(You will never be able to get it back, I recommend backing it up first)"
  44.     read decision2
  45.  
  46.     if [ "$decision2" == "yes" ]; then
  47.         rm $fileremove
  48.  
  49.         sleep 1
  50.         clear
  51.         echo " . "
  52.  
  53.         sleep 1
  54.         clear
  55.         echo "    . "
  56.  
  57.         sleep 1
  58.         clear
  59.         echo "      . "
  60.  
  61.         sleep 1
  62.         clear
  63.         echo "The file has been removed."
  64.     fi
  65.  
  66.     if [ "$decision2" == "no" ]; then
  67.         echo "If you want to remove it later, go ahead and use file backup to back it up."
  68.     fi
  69. fi
  70.  
  71. if [ "$decision" == "file display" ]; then
  72.     clear
  73.  
  74.     echo "What file would you like to display?"
  75.     read filecat
  76.  
  77.     sleep 1
  78.     clear
  79.     echo " . "
  80.  
  81.     sleep 1
  82.     clear
  83.     echo "    . "
  84.  
  85.     sleep 1
  86.     clear
  87.     echo "       . "
  88.  
  89.     sleep 1
  90.     clear
  91.     echo "Displaying file now"
  92.    
  93.     sleep 1
  94.     cat $filecat
  95. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement