"Fossies" - the Fresh Open Source Software Archive

Member "sysvinit-2.99/man/fstab-decode.8" (21 Feb 2021, 2356 Bytes) of package /linux/misc/sysvinit-2.99.tar.xz:


Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "fstab-decode.8": 2.98_vs_2.99.

fstab-decode

NAME
SYNOPSIS
DESCRIPTION
EXIT STATUS
EXAMPLES
SEE ALSO

NAME

fstab-decode − run a command with fstab-encoded arguments

SYNOPSIS

fstab-decode COMMAND [ARGUMENT]...

DESCRIPTION

fstab-decode decodes escapes (such as newline characters and other whitespace) in the specified ARGUMENTs and uses them to run COMMAND. The argument escaping uses the same rules as path escaping in /etc/fstab, /etc/mtab and /proc/mtab.

In essence fstab-decode can be used anytime we want to pass multiple parameters to a command as a list of command line arguments. It turns output like this:

/root
/mnt/remote-disk
/home

Into one long list of parameters, "/root /mnt/remote-disk /home". This
can be useful when trying to work with multiple filesystems at once. For
instance, we can use it to unmount multiple NFS shares. This program also
removes whitespace and other characters which might cause programs such
as mount or umount to fail.

EXIT STATUS

fstab-decode exits with status 127 if COMMAND can’t be run. Otherwise it exits with the status returned by COMMAND.

EXAMPLES

The following example reads fstab, finds all instances of VFAT filesystems and
prints their mount points (argument 2 in the fstab file). fstab-decode then runs
the specified program, umount, and passes it the list of VFAT mountpoints.
This unmounts all VFAT partitions.

fstab-decode umount $(awk '$3 == "vfat" { print $2 }' /etc/fstab)

SEE ALSO

fstab(5)