Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Issue on smbclient

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 12-11-2012   -   Original Discussion by gio123bgg
gio123bgg's Unix or Linux Image
gio123bgg gio123bgg is offline
Registered User
Join Date: Mar 2012
Last Activity: 11 December 2012, 7:32 PM EST
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
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

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.



Last edited by Franklin52; 12-12-2012 at 03:10 AM.. Reason: Please use code tags for data and code samples
Sponsored Links
Old Unix and Linux 12-11-2012   -   Original Discussion by gio123bgg
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
Join Date: Feb 2004
Last Activity: 16 December 2017, 11:59 AM EST
Location: NM
Posts: 11,253
Thanks: 578
Thanked 1,122 Times in 1,034 Posts
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

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.
Sponsored Links
Old Unix and Linux 12-11-2012   -   Original Discussion by gio123bgg
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
Join Date: Aug 2005
Last Activity: 14 December 2017, 4:58 PM EST
Location: Saskatchewan
Posts: 22,547
Thanks: 1,159
Thanked 4,287 Times in 3,955 Posts
You could also do tr -d '\r' < inputfile > outputfile

This is safe to do even for files that don't have a carriage return.
Old Unix and Linux 12-11-2012   -   Original Discussion by gio123bgg
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 16 December 2017, 11:08 AM EST
Location: Aachen, Germany
Posts: 11,815
Thanks: 341
Thanked 3,659 Times in 3,357 Posts
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?
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
smbclient - check if 'cd' is sucessful? FreddyDaKing Shell Programming and Scripting 17 08-23-2012 08:04 AM
smbclient & dd dr_mabuse UNIX for Advanced & Expert Users 11 03-04-2012 02:43 PM
Using the smbclient forstudy3 Shell Programming and Scripting 1 02-11-2010 07:47 AM
Smbclient on Unix welldone UNIX for Dummies Questions & Answers 2 07-11-2009 02:42 PM
smbclient print while preserving windows printer settings? raidzero UNIX for Dummies Questions & Answers 2 12-29-2008 01:48 PM

All times are GMT -4. The time now is 06:44 PM.