|
|
|
|
| file courrepted with ftp Shell programming on suse 10.0 |
|
|
|
[Original]
[Print]
[Top]
|
Hi, i am completely new with linux. i want to transfer file from linux to windows Machine. i wrote this Script.
HOST="host name" USER="anonymous" PASSWD="abcd" FILE="$1" ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE 1.mpg quit END_SCRIPT exit 0
After running script,i got file on windows,i don't know what happen with file but i can't able to play that file. if i will transfer the file manually that it will play on windows.
My requirement is such that i have to use variable as a file name.
please tell me where might be problem?
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
Hi,
Script looks ok to me, but i think your problem is in the ftp. Ftp has two modes: binary and ascii. Ascii can be used to transfer pure ascii files, like config files of your linux machine, or for example your script. This mode takes care of the different ways OS's write their end-of-line. Some use only the LineFeed character, some use CarriageReturn/LineFeed combinations. In binary mode, files are transferred exactly as they are, this should be used for about every file, except for pure ascii :-)
Now the supid part: winthing (so i assume it's ftp server you're using), defaults to ascii.
The solution (or just to be sure), is to send the "bin" command to the ftp server in your script.
Hope this helps.
Best regards, pa4wdh
|
|
|
----
The biggest difference between M$ stuff and the rest ? Most stuff is secure by design, M$ stuff is secure by accident.
bash# killall gaim killall: Don't shoot the messenger !
If we have /dev/powerbutton, what would touch /dev/powerbutton do ?
|
|
[Original]
[Print]
[Top]
|
|
|