getfsent(3) and spaces in fstab

Chris BeHanna behanna at behanna.org
Thu Jul 31 19:16:47 PDT 2003


On Thu, 31 Jul 2003, Simon Barner wrote:

> > Just a thort, not having tried it ..
> >
> > does either of the 'standard' methods of including spaces actually work
> > in fstab ??
> >
> > I speak of quoting (either single or double) and backslashing the space
> >
> > "/mnt/space/silly long dirname/filename also with spaces"
> >
> > or
> >
> > /mnt/space/silly\ long\ dirname/filename\ also\ with\ spaces
>
> Sorry, I should have written that I have performed tests:
>
> Here is what I did:
>
> test\ 1         /mnt/test\ 1            ufs     ro              0       0
> 'test 2'        '/mnt/test 2'           ufs     ro              0       0
> "test 3"        "/mnt/test 3"           ufs     ro              0       0
>
> This test program
>
> [...snipped...]
>
> Gives me the following output:
>
> fstab: /etc/fstab:14: Inappropriate file type or format
> fstab: /etc/fstab:15: Inappropriate file type or format
> fstab: /etc/fstab:16: Inappropriate file type or format

    What about

    test%201    /mnt/test%201   ufs     ro      0       0

?
Ugly, yes, but that's how a lot of tools escape spaces.

-- 
Chris BeHanna
Software Engineer                   (Remove "bogus" before responding.)
chris at bogus.behanna.org
                 Turning coffee into software since 1990.


More information about the freebsd-hackers mailing list