Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fixing swap1_stop

On Mon, Aug 14, 2017, at 02:12, Christos Zoulas wrote:
> On Aug 13,  7:57pm, ("Ian D. Leroux") wrote:
> -- Subject: Re: Fixing swap1_stop
> | On Wed, 9 Aug 2017 03:38:20 -0400 (Christos Zoulas)
> | wrote:
> | > I think it is better to modify mount to either pass a format string
> | > to it or to quote the pathnames so that the output is predictable.
> | 
> | Here's my second attempt at the latter solution (the first attempt
> | involved writing a utility functional called shquote which gcc
> | subsequently informed me was already in the standard library. oops).
> | It's intended to leave the output completely unchanged in all "normal"
> | cases, but to quote the mount point (or the device file) if either
> | filename contains white space or shell operators.
> | 
> I am not sure if it is a good idea to change the output in the default
> case. Perhaps we should add a flag to make the behavior explicit. But
> at that point (if we add a flag), we might as well make the new output
> convenient to parse.

Any preferences for a conveniently-parseable format?  My first
instinct is to simply drop the spacer words ("on", "type"),
systematically shquote() the device and mount-point and space-separate
the flags.  That would look like:

'/dev/wd0a' '/' ffs synchronous local
'tmpfs' '/var/shm' tmpfs nosuid local

That's directly parseable in shell (first three fields are device, mount
point and fstype, any leftovers are individual flags) and doesn't
require the design of another date-style formatting language.  Are there
other, better ideas?

-- IDL

Home | Main Index | Thread Index | Old Index