#!/bin/bash quit(){ clear echo "***************************************" echo "* Thank you to use *" echo "***************************************" exit 0 } #load usb mountusb(){ clear mkdir /mnt/usb /sbin/fdisk -l | grep dev/sd echo -e "Please Enter the device name of usb as above:\c" read PARAMETER mount /dev/$ PARAMETER /mnt/usb } umountusb(){ clear umount /mnt/usb } display(){ clear ls -l /mnt/usb } copydisktousb(){ clear echo "Please Enter the filename in disk to usb:\c" read FILE echo "coping,please wait..." cp $FILE /mnt/usb } copyusbtodisk(){ clear echo "Please Enter the filename in usb to disk:\c" read FILE echo "coping,please wait..." cp /mnt/usb/$FILE . } clear while true do echo "============================================" echo "*** UNIX USB MANAGE PROGRAM ***" echo "============================================" echo " 1-MOUNT USB " echo " 2-UMOUNT USB " echo " 3-DISPLAY USB INFOMATION " echo " 4-COPY FILE IN DISK TO USB " echo " 5-COPY FILE IN USB TO DISK " echo " 0-EXIT " echo -e "Please enter a choice (0--5):\c" read CHOICE case $CHOICE in 1) mountusb ;; 2) umountusb ;; 3) display ;; 4) copydisktousb ;; 5) copyusbtodisk ;; 0) quit ;; *) echo "invalid choice!! correct choice is (0--5)" sleep 5 clear ;; esac done
本文出自 “小止” 博客,请务必保留此出处http://10541556.blog.51cto.com/10531556/1793285
原文地址:http://10541556.blog.51cto.com/10531556/1793285