From 80e83960da3f77fd2957cf4025ea4785be971de7 Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Thu, 21 Feb 2019 15:09:48 -0400 Subject: [PATCH] Updated the fstab-decode manual page to explain what the utility does. --- doc/Changelog | 1 + man/fstab-decode.8 | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index da706af..9e56953 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -33,6 +33,7 @@ sysvinit (2.94) unreleased; urgency=low else (it's rude and security risk). Set up "when" as its own buffer that has data from optargs and/or argv copied into it. * Fixed typo in init.8 manual page. + * Updated text of fstab-decode to explain what the utility does. sysvinit (2.93) released; urgency=low diff --git a/man/fstab-decode.8 b/man/fstab-decode.8 index f4ad394..afc7def 100644 --- a/man/fstab-decode.8 +++ b/man/fstab-decode.8 @@ -27,13 +27,26 @@ fstab-decode \- run a command with fstab-encoded arguments .SH DESCRIPTION .B fstab-decode -decodes escapes in the specified \fIARGUMENT\fRs +decodes escapes (such as newline characters) in the specified \fIARGUMENT\fRs and uses them to run \fICOMMAND\fR. The argument escaping uses the same rules as path escaping in \fB/etc/fstab\fR, .B /etc/mtab and \fB/proc/mtab\fR. +In essence fstab-decode can be used anytime we want to pass multiple +parameters to a command as a list of command line argments. It turns output +like this: + +.nf +/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. + .SH EXIT STATUS .B fstab-decode exits with status 127 if @@ -43,5 +56,11 @@ Otherwise it exits with the status returned by \fICOMMAND\fR. .SH EXAMPLES .nf +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. + + .B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] /etc/fstab) .fi