Hello everyone, I need your help.
I want to write a script that Performs a recursive directory listing on the user's home directory and save the information to a file. Compress the file, have the script prompt the user to insert a USB flash drive, then press ENTER. Finally, save the file to the flash drive after making certain the flash drive has properly mounted by parsing the output of df. Note that the flash drive must be unmounted before it is removed.
this is what i have so far... but am stuck
#!/bin/bash
ls -R > groupfour.txt #performing recursive home directory listing and copying to a text file groupfour
gzip groupfour.txt # compressing the file
echo "insert a USB flash drive," #prompting the user to insert a flash drive
echo "and then press ENTER."
read ans
cp groupfour.txt.gz /cygdrive/h
Thank you in advance.
I want to write a script that Performs a recursive directory listing on the user's home directory and save the information to a file. Compress the file, have the script prompt the user to insert a USB flash drive, then press ENTER. Finally, save the file to the flash drive after making certain the flash drive has properly mounted by parsing the output of df. Note that the flash drive must be unmounted before it is removed.
this is what i have so far... but am stuck
#!/bin/bash
ls -R > groupfour.txt #performing recursive home directory listing and copying to a text file groupfour
gzip groupfour.txt # compressing the file
echo "insert a USB flash drive," #prompting the user to insert a flash drive
echo "and then press ENTER."
read ans
cp groupfour.txt.gz /cygdrive/h
Thank you in advance.