diff --git a/Doc/Sd1/appendix.xml b/Doc/Sd1/appendix.xml index 4df9e152736fa65e618dbe1c9a9da8b8dcda3fee..9cd98d225b24a6c6cf09d506e15613249920c72b 100644 --- a/Doc/Sd1/appendix.xml +++ b/Doc/Sd1/appendix.xml @@ -243,7 +243,7 @@ <guimenuitem>Properties</guimenuitem> --> <guimenuitem>Java Compiler</guimenuitem> --> <guimenuitem>Javadoc</guimenuitem> if ticking - <quote>Project specific settings</quote>. </para> + <quote>Project specific settings</quote>.</para> </listitem> <listitem> @@ -309,10 +309,53 @@ </orderedlist> </section> + <section xml:id="sd1SectProjectGrep"> + <title>Poor man's <xref linkend="glo_UNIX"/> <command + xlink:href="http://linux.die.net/man/1/grep">grep</command>.</title> + + <para>The <xref linkend="glo_UNIX"/> operating system provides the + <command xlink:href="http://linux.die.net/man/1/grep">grep</command> + command which allows for retrieving occurrences of given strings in text + files. We consider an example text file <filename>input.txt</filename> + containing four lines:</para> + + <programlisting language="none" linenumbering="unnumbered">Roses are nice flowers. +Red wine is tasty +The red cross acts worldwide +Mayflower used to be a ship.</programlisting> + + <para>We search this file <filename>input.txt</filename> for the + occurrence of the string <quote>flower</quote> being contained in lines + 1 and 4:</para> + + <programlisting language="none">>grep <emphasis role="bold">flower</emphasis> input.txt +Roses are nice <emphasis role="bold">flower</emphasis>s. +May<emphasis role="bold">flower</emphasis> used to be a ship.</programlisting> + + <para>Thus the <command + xlink:href="http://linux.die.net/man/1/grep">grep</command> command + echoes all lines containing the search string in question to standard + output. Adding the command line option <option>-i</option> allows for + case insensitive searches:</para> + + <programlisting language="none" linenumbering="unnumbered">>grep <option>-i</option> <emphasis + role="bold">red</emphasis> input.txt +<emphasis role="bold">Red</emphasis> wine is tasty +The <emphasis role="bold">red</emphasis> cross acts worldwide</programlisting> + + <para>This time all possible variants like <quote>Red</quote>, + <quote>red</quote>, <quote>RED</quote> and so on will match. </para> + + <para><command + xlink:href="http://linux.die.net/man/1/grep">grep</command> also allows + for searching multiple files. Consider another text file + second.txt:</para> + </section> + <section xml:id="sd1ProjectSieveErathostenes"> <title>Project <link xlink:href="https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Euler.27s_Sieve">Euler's - sieve</link></title> + sieve</link> (Winter 2015)</title> <para>The project's goal is about:</para>