Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spaces Headache

Status
Not open for further replies.

Igaduma

Technical User
Nov 23, 2001
322
BE
Hello all,

How can you mount correctly a directory that has white spaces in it ?
(this is a directory used by windows machines via samba sharing)

/etc/mnttab seems to be the problem when doing a df -k even tho it mounted correctly and is accesible from cmd or samba.

Example:

#mount srv1:/d/UMTS model calibration /mnt/UMTS model calibration

obviously doesn't work

Mounting it like this works:

mount 'srv1:/d/UMTS model calibration' '/mnt/UMTS model calibration'

But when doing a df -k it errors by saying there are too many values in /etc/mnttab
After umount df -k works again.

any idea's or do I need to start fishing for patches ?

Thanks!

 
in unix, because the antiques unix guy are still
using AND UNDERSTANDING the command line, a non
printable char like 'space,tab,newline,verticaltab...."
are command trailer.
modern DOSguys, buttons athletes, are not confronted with
this problem, because the button (offen) knows what's to
do. i expect (early 2521) an buttonized unix-release.
so, if a 'ls' prints something like:
111 aaa bbb ccc ddd
--------- or better:
111 aaa
bbb ccc ddd
you can bet, there is something strange between
'aaa' and 'bbb'
an ls|od -c will clear you, (octal dump)
for working on this file, put it's name in ""




don't forget, RTFMP :) guggach
 
putting it between "" doesn't make df -k happy, same err then putting it between ''

This is what I put in /etc/vfstab

srv1:/d/"UMTS model calibration" - "/d/UMTS model calibration" nfs - yes bg

doesnt want to mount it although cmd mount does the trick, but then df -k doesn't work anymore

When using mount as said before it mounts and is accessible from cmd, but still df -k is not happy.
od showed only spaces between words, no other special characters


 
currently both dirs are mounted and used, and everyone is happy, except me, I cant check df -k anymore ....
 
It has always been my understanding the white space should not be used when naming files... Since everything in the UNIX environment is looked at as if it is a file, that would include directories... My solution is to rename that directory. You can do this via the file manager since the command line command "mv" will not work.
 
mv dir\ with\ spaces dir_without_spaces


Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Hi all,

yes, I had a few problems in the past with this and renamed them to exclude white spaces.
But asking the users to rename their directory to exclude white spaces is *defeat*.

Curious enough it is now working, dirs are mapped and the application is happily doing file transactions to the directory via samba, no problem mainly thanks to mangling and such I think.
I on the other hand am know limited to right-mouse click on directories and select properties from the windows shell to check the space on them ...

Isn't that sooo ironic ?
 
another hint: how can I delete a file named "-l"

Code:
[fp@admin6] % echo test > -l
[fp@admin6] % ls -al
total 10
-rw-r--r--   1 fp       admins         5 Jul  2  2004 -l
drwxr-xr-x   2 fp       admins       512 Jul  2  2004 .
drwxr-xr-x   9 fp       admins      2560 Jul  2  2004 ..
[fp@admin6] % rm -l
rm: illegal option -- l
usage: rm [-fiRr] file ...
[fp@admin6] % rm "-l"
rm: illegal option -- l
usage: rm [-fiRr] file ...
[fp@admin6] % rm \-l
rm: illegal option -- l
usage: rm [-fiRr] file ...
[fp@admin6] % rm '-l'
rm: illegal option -- l
usage: rm [-fiRr] file ...
[fp@admin6] % rm -- -l
rm: remove -l (yes/no)? y
[fp@admin6] %

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
@Igaduma

do you have a service contract with Sun? I suggest to open a call; if mount works with blanks in mountpoints df should work too...

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
it should, but the error is linked to the actual mount entry in /etc/mnttab because that doesnt like spaces or encapsulated strings. /etc/vfstab has no problem.
vi editing that file ofcourse is a no can do.
Yes, we've got the gold support but on a friday evening....I'm in weekend mode already :)

The top level directory is nfs mounted on another system and from there df -k works, so I can still check the top level filesystem for usage from that console.
I am just gonna give the problem to Jesus and get really drunk tonight.

Thanks for the nice rm -- -l :)

Iga
 
>> I am just gonna give the problem to Jesus and get really drunk tonight.

so I guess you are Greec? ;-)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Belgian...:)


"godverdekke, it's great to be a belgian"
 
>> Belgian...:)

well, there are worse things in life... *no just kidding*
I had a co-worker from Belgium, he was realy sick ;-)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 


>> another hint: how can I delete a file named "-l"

below command can remove it too:
$rm ./-1

-sbs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top