Hi All! I have a small problem with my script maybe someone can help me with it. The problem is not so bad but it is just for my curies. This script is about to create some kind of mirror on your disk, (just like the "wget" app). Program is creating the provisory file in the home dir.I couldn't erase this file when the app is finishing the file so i put it in the begining of the scritp. But i don't like it :)). Please take a look at the script and tell me what can be wrong with it. All i wan't to know is how to erese the file when the script will finish the job (but all sugestions are nice to come) | Patryk Czopowik /\ Polish Linux Users Group ~/home/+48-61-8257-175| | RTFM /\ Ludzie rozsadni nie zmieniaja swiata [0:0] alias nightcom |
#!/bin/sh # FTPGET v1.0 by Patryk Czopowik [EMAIL PROTECTED] # # This program is written to get files via ftp without entering the # site by your own. I know tha this looks like the shit but this is my # first bigger program written in bash shell ;)) be patience i'll do my # best to make it work even beter. # !!! IF YOU DON'T LIKE IT DON'T USE IT, BUT IF YOU LIKE IT AND YOU WAN'T # TO CHANGE ENYTHING EMAIL ME YOUR SUGESTIONS rm $HOME/.netrc echo ---- FTPGETY v1.0 by Patryk Czopowik [EMAIL PROTECTED] ---- echo Please enter the host name: read a echo Please enter the path name: echo Example: /pub/kernel/ read b echo =============================================================== echo Host name is: $a echo Path is: $b echo =============================================================== # Change if you want USERNAME=anonymous [EMAIL PROTECTED] # Hier the program creates temprotary the file (.netrc) in your home dir # When you will start next time the program this file will be changed # in to the new one echo "machine $a" >> ~/.netrc echo "login $USERNAME" >> ~/.netrc echo "password $PASSWORD" >> ~/.netrc echo Connecting to the server and sucking the file ftp << ** prompt open $a cd $b mget * bye ** echo I have finished sucking the file end.