Issue on smbclient

Hi All,
I've been facing on this issue.
From SunOS to Windows

/usr/local/samba/bin/smbclient \\IP\<source dir> -D $TARGET_DIR -U dir1/$WINDOWS_USER%$WINDOWS_PWD -c "put $SOURCE_FILE $TAR
GET_FILE;exit" 

This command in my shell script work fine but the file saved on windows environment contains EOL character. I need to use, for example the EOL converter free tool.

Is it possible to solve this issue?

Thanks in advance for your kind support.

Regards,

Giovanni

samba does not have a way to window-ize or unix-ize files by changing carriage returns.

So, you have characters on the Windows side that you do not want, they came over from unix to start with. The same is true with samba going from windows to unix.

I would run the

unix2dos

command on the file on the unix side to clean it up for windows beforehand

If you are sending a tar file to windows you cannot run unix2dos on it. You have to rely on 7zip or some other windows utility to convert it for you, after it has been extracted.

You could also do tr -d '\r' < inputfile > outputfile

This is safe to do even for files that don't have a carriage return.

To me the command seems to put a unix file into a windows environment, so <CR>s too many should not be the problem, rather missing <CR>s will make MS's editors fail. What do you mean by EOL char (which binary code)? Are they missing or too many?