2011-04-27 19:11:04 +05:30
|
|
|
'\" -*- coding: UTF-8 -*-
|
2010-03-23 20:07:01 +05:30
|
|
|
.\" A man page for fstab-decode(8).
|
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This copyrighted material is made available to anyone wishing to use,
|
|
|
|
.\" modify, copy, or redistribute it subject to the terms and conditions of the
|
|
|
|
.\" GNU General Public License v.2.
|
|
|
|
.\"
|
|
|
|
.\" This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
.\" more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public License along
|
|
|
|
.\" with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
.\"
|
|
|
|
.\" Author: Miloslav Trmac <mitr@redhat.com>
|
2022-02-16 02:31:41 +05:30
|
|
|
.TH FSTAB-DECODE 8 "May 2006" "sysvinit " "Linux System Administrator's Manual"
|
2010-03-23 20:07:01 +05:30
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
fstab-decode \- run a command with fstab-encoded arguments
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
2010-05-19 13:41:05 +05:30
|
|
|
\fBfstab-decode\fR \fICOMMAND\fR [\fIARGUMENT\fR]...
|
2010-03-23 20:07:01 +05:30
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B fstab-decode
|
2019-03-04 03:05:22 +05:30
|
|
|
decodes escapes (such as newline characters and other whitespace)
|
|
|
|
in the specified \fIARGUMENT\fRs and uses them to run \fICOMMAND\fR.
|
2010-03-23 20:07:01 +05:30
|
|
|
The argument escaping uses the same rules as path escaping in
|
2021-12-28 01:44:42 +05:30
|
|
|
\fI/etc/fstab\fR, \fI/etc/mtab\fR and \fI/proc/mtab\fR.
|
2010-03-23 20:07:01 +05:30
|
|
|
|
2021-12-28 01:44:42 +05:30
|
|
|
In essence \fBfstab-decode\fR can be used anytime we want to pass multiple
|
2020-11-18 06:01:37 +05:30
|
|
|
parameters to a command as a list of command line arguments. It turns output
|
2019-02-22 00:39:48 +05:30
|
|
|
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
|
2019-03-04 03:05:22 +05:30
|
|
|
instance, we can use it to unmount multiple NFS shares. This program also
|
|
|
|
removes whitespace and other characters which might cause programs such
|
2021-12-28 01:44:42 +05:30
|
|
|
as \fBmount\fR(8) or \fBumount\fR(8) to fail.
|
2019-02-22 00:39:48 +05:30
|
|
|
|
2010-03-23 20:07:01 +05:30
|
|
|
.SH EXIT STATUS
|
|
|
|
.B fstab-decode
|
|
|
|
exits with status 127 if
|
|
|
|
.I COMMAND
|
|
|
|
can't be run.
|
|
|
|
Otherwise it exits with the status returned by \fICOMMAND\fR.
|
|
|
|
|
|
|
|
.SH EXAMPLES
|
2021-12-28 01:44:42 +05:30
|
|
|
The following example reads \fIfstab\fR, finds all instances of VFAT filesystems
|
|
|
|
and prints their mount points (argument 2 in the \fIfstab\fR file).
|
|
|
|
\fBfstab-decode\fR then runs the specified program, \fBumount\fR(8), and passes
|
|
|
|
it the list of VFAT mountpoints. This unmounts all VFAT partitions.
|
2019-02-22 00:39:48 +05:30
|
|
|
|
2021-12-28 01:44:42 +05:30
|
|
|
.nf
|
2010-05-19 13:41:05 +05:30
|
|
|
.B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] /etc/fstab)
|
|
|
|
.fi
|
2019-03-05 21:24:10 +05:30
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR fstab (5)
|