<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>1.3.1 Redirection</TITLE> <META NAME="description" CONTENT="1.3.1 Redirection"> <META NAME="keywords" CONTENT="GMT_Tutorial"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="GMT_Tutorial.css"> <LINK REL="next" HREF="node16.html"> <LINK REL="previous" HREF="node14.html"> <LINK REL="up" HREF="node14.html"> <LINK REL="next" HREF="node16.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html599" HREF="node16.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html593" HREF="node14.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html587" HREF="node14.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html595" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html597" HREF="node63.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html600" HREF="node16.html">1.3.2 Piping ()</A> <B> Up:</B> <A NAME="tex2html594" HREF="node14.html">1.3 The UNIX Environment:</A> <B> Previous:</B> <A NAME="tex2html588" HREF="node14.html">1.3 The UNIX Environment:</A> <B> <A NAME="tex2html596" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html598" HREF="node63.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00331000000000000000"> 1.3.1 Redirection</A> </H2> <A NAME="430"></A> <A NAME="431"></A> <P> Most <A NAME="tex2html84" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> programs read their input from the terminal (called <I>stdin</I>) or from files, and write their output to the terminal (called <I>stdout</I>). To use files instead one can use <I>UNIX</I> redirection: <P> <PRE> GMTprogram input-file > output-file GMTprogram < input-file > output-file GMTprogram input-file >> output-file # Append to existing file </PRE> <P> In this example, and in all those to follow, it is assumed that you do not have the shell variable <B>noclobber</B> set. If you do, it prevents accidental overwriting of existing files. That may be a noble cause, but it is extremely annoying. So please, <B>unset noclobber</B>. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html599" HREF="node16.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html593" HREF="node14.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html587" HREF="node14.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html595" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html597" HREF="node63.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html600" HREF="node16.html">1.3.2 Piping ()</A> <B> Up:</B> <A NAME="tex2html594" HREF="node14.html">1.3 The UNIX Environment:</A> <B> Previous:</B> <A NAME="tex2html588" HREF="node14.html">1.3 The UNIX Environment:</A> <B> <A NAME="tex2html596" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html598" HREF="node63.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2010-07-14 </ADDRESS> </BODY> </HTML>