Networking Forums

Networking Forums > Computer Networking > Linux Networking > Windows shares using samba: problems with blank spaces.

Reply
Thread Tools Display Modes

Windows shares using samba: problems with blank spaces.

 
 
Mike Barba
Guest
Posts: n/a

 
      09-16-2004, 06:11 PM
Our network has a window machine that needs to have disk space cleaned
up. We are trying to delete files in specific folders that are more
than 3 months old. We are trying to run a script on a linux box that
will find all files older than three months old on the win box
(through a samba share). However, samba returns error messages on the
windows files/folders that have blank spaces in the name (ex: My
Documents).

Does anyone have a good solution to this problem?

Your help is much appreciated.

-Mike Barba
 
Reply With Quote
 
 
 
 
Juhan Leemet
Guest
Posts: n/a

 
      09-16-2004, 07:03 PM
On Thu, 16 Sep 2004 11:11:30 -0700, Mike Barba wrote:
> Our network has a window machine that needs to have disk space cleaned
> up. We are trying to delete files in specific folders that are more
> than 3 months old. We are trying to run a script on a linux box that
> will find all files older than three months old on the win box
> (through a samba share). However, samba returns error messages on the
> windows files/folders that have blank spaces in the name (ex: My
> Documents).


That's an old one, that has been covered in other threads. Use Google
and/or "man find" and "man xargs". The key is to use the GNU switches that
pass on file names intact, without breaking them at every white space.

BTW, it is not samba that is returning the errors. It is your file delete
application (which is probably being fed from some shell script?) which is
getting upset when it tries to use a "word" (only part of a file name with
which space) as a file name. No such file exists, but samba is still happy.

--
Juhan Leemet
Logicognosis, Inc.

 
Reply With Quote
 
JM
Guest
Posts: n/a

 
      09-18-2004, 07:06 AM
Mike Barba wrote:

> Our network has a window machine that needs to have disk space cleaned
> up. We are trying to delete files in specific folders that are more
> than 3 months old. We are trying to run a script on a linux box that
> will find all files older than three months old on the win box
> (through a samba share). However, samba returns error messages on the
> windows files/folders that have blank spaces in the name (ex: My
> Documents).
>
> Does anyone have a good solution to this problem?
>
> Your help is much appreciated.
>
> -Mike Barba



The best way I have found to deal with file names that have spaces is to set
the variable IFS. Something like this:

#!/bin/bash

IFS=$'\t\n'

for i in $( ls /samba )
do
echo $i #this will echo the file names with spaces.
done

IFS=null




 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba shares vs. OS/2 Don Guy Linux Networking 1 04-05-2006 05:22 PM
Shares with blanks in the name with samba Daniel Camps Linux Networking 1 01-15-2005 06:57 PM
Shares with blanks in the name with samba Daniel Camps Linux Networking 1 01-15-2005 01:32 AM
Problems with Samba, can't see or mount shares Mark Landreville Linux Networking 0 11-11-2004 05:27 AM
Two problems with Samba on Suse 9.1 and Windows 98 (reposted) A. Naim Linux Networking 1 08-05-2004 05:45 AM



1 2 3 4 5 6 7 8 9 10 11