52 lines
2.9 KiB
HTML
52 lines
2.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>3.8.4 Non-destructive redirection</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value="3.8.4 Non-destructive redirection">
|
|
<meta name="keywords" value="gs">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3312 HREF="node124.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3310 HREF="node119.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3306 HREF="node122.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3314 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3315 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3313 HREF="node124.html">3.9 File Permissions</A>
|
|
<B>Up:</B> <A NAME=tex2html3311 HREF="node119.html">3.8 UNIX Plumbing</A>
|
|
<B> Previous:</B> <A NAME=tex2html3307 HREF="node122.html">3.8.3 Using pipes</A>
|
|
<BR> <HR> <P>
|
|
<H2><A NAME=SECTION00584000000000000000>3.8.4 Non-destructive redirection</A></H2>
|
|
<P>
|
|
<A NAME=3148> </A>
|
|
<A NAME=3149> </A>
|
|
Using ``<tt>></tt>'' to redirect output to a file is destructive: in other
|
|
words, the command
|
|
<P><TT> /home/larry/papers# <em>ls <b>></b> file-list</em>
|
|
<P></TT>
|
|
overwrites the contents of the file <tt>file-list</tt>. If, instead, you
|
|
redirect with the symbol ``<tt>>></tt>'', the output will be appended
|
|
to the named file, instead of overwriting it.
|
|
<P><TT> /home/larry/papers# <em>ls <b>>></b> file-list</em>
|
|
<P></TT>
|
|
will append the output of the <tt>ls</tt> command to <tt>file-list</tt>.
|
|
<P>
|
|
Just keep in mind that redirection and using pipes are features
|
|
provided by the shell---the shell provides this handy syntax using ``<tt>></tt>''
|
|
and ``<tt>>></tt>'' and ``<tt>|</tt>''. It has nothing to do with the commands
|
|
themselves, but the shell.
|
|
<P>
|
|
<A NAME=3164> </A>
|
|
<A NAME=3165> </A>
|
|
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3312 HREF="node124.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3310 HREF="node119.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3306 HREF="node122.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3314 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3315 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3313 HREF="node124.html">3.9 File Permissions</A>
|
|
<B>Up:</B> <A NAME=tex2html3311 HREF="node119.html">3.8 UNIX Plumbing</A>
|
|
<B> Previous:</B> <A NAME=tex2html3307 HREF="node122.html">3.8.3 Using pipes</A>
|
|
<BR> <HR> <P>
|
|
<BR> <HR>
|
|
<P><ADDRESS>
|
|
<I>Matt Welsh <BR>
|
|
mdw@sunsite.unc.edu</I>
|
|
</ADDRESS>
|
|
</BODY>
|