97 lines
2.5 KiB
HTML
97 lines
2.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of fstab-decode</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>fstab-decode</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: May 2006<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
fstab-decode - run a command with fstab-encoded arguments
|
|
<P>
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>fstab-decode</B> <I>COMMAND</I> [<I>ARGUMENT</I>]...
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>fstab-decode</B>
|
|
|
|
decodes escapes (such as newline characters and other whitespace)
|
|
in the specified <I>ARGUMENT</I>s and uses them to run <I>COMMAND</I>.
|
|
The argument escaping uses the same rules as path escaping in
|
|
<B>/etc/fstab</B>,
|
|
<B>/etc/mtab</B>
|
|
|
|
and <B>/proc/mtab</B>.
|
|
<P>
|
|
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:
|
|
<P>
|
|
<PRE>
|
|
/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.
|
|
|
|
</PRE><A NAME="lbAE"> </A>
|
|
<H2>EXIT STATUS</H2>
|
|
|
|
<B>fstab-decode</B>
|
|
|
|
exits with status 127 if
|
|
<I>COMMAND</I>
|
|
|
|
can't be run.
|
|
Otherwise it exits with the status returned by <I>COMMAND</I>.
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<PRE>
|
|
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 '$3 == "vfat" { print $2 }' /etc/fstab)</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+fstab">fstab</A></B>(5)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">EXIT STATUS</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:12 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|