https://www.linux.fi/w/index.php?title=Standardivirrat&feed=atom&action=history
Standardivirrat - Muutoshistoria
2024-03-28T13:38:19Z
Tämän sivun muutoshistoria
MediaWiki 1.41.0
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=53324&oldid=prev
LinuxMan (26. tammikuuta 2021 kello 09.02)
2021-01-26T09:02:03Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 26. tammikuuta 2021 kello 12.02</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l2">Rivi 2:</td>
<td colspan="2" class="diff-lineno">Rivi 2:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että standardisyötteellä on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että standardisyötteellä on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] [[/dev/null]]. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] [[<ins style="font-weight: bold; text-decoration: none;">:</ins>/dev/null]]. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td></tr>
</table>
LinuxMan
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=53323&oldid=prev
LinuxMan (26. tammikuuta 2021 kello 09.01)
2021-01-26T09:01:55Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 26. tammikuuta 2021 kello 12.01</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l2">Rivi 2:</td>
<td colspan="2" class="diff-lineno">Rivi 2:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että standardisyötteellä on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että standardisyötteellä on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] /dev/null. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] <ins style="font-weight: bold; text-decoration: none;">[[</ins>/dev/null<ins style="font-weight: bold; text-decoration: none;">]]</ins>. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td></tr>
</table>
LinuxMan
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=43975&oldid=prev
153.1.124.52: Kirjoitusvirheen korjaus
2015-11-02T08:19:24Z
<p>Kirjoitusvirheen korjaus</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 2. marraskuuta 2015 kello 11.19</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Rivi 1:</td>
<td colspan="2" class="diff-lineno">Rivi 1:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Tiedosto:Stdstreams-notitle.svg|thumb|right|200px|Standardisyöttövirrat tilanteessa, jossa prosessia ajetaan [[terminaaliemulaattori|pääteikkunassa]] tms.]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Tiedosto:Stdstreams-notitle.svg|thumb|right|200px|Standardisyöttövirrat tilanteessa, jossa prosessia ajetaan [[terminaaliemulaattori|pääteikkunassa]] tms.]]</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että <del style="font-weight: bold; text-decoration: none;">stanrdisyötteellä </del>on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaaliemulaattori|pääteikkunan]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että <ins style="font-weight: bold; text-decoration: none;">standardisyötteellä </ins>on numerokoodi '''0''' ja standardivirheellä numerokoodi '''2'''.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] /dev/null. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] /dev/null. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan.</div></td></tr>
</table>
153.1.124.52
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=36419&oldid=prev
193.64.20.108: /* Katso myös */ xargs
2012-10-17T15:15:38Z
<p><span dir="auto"><span class="autocomment">Katso myös: </span> xargs</span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 17. lokakuuta 2012 kello 18.15</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l69">Rivi 69:</td>
<td colspan="2" class="diff-lineno">Rivi 69:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Katso myös==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Katso myös==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[Komentorivin perusteet]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[Komentorivin perusteet]]</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">*[[Xargs]]</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[Nimetty putki]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[Nimetty putki]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Luokka:Järjestelmä]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Luokka:Järjestelmä]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Luokka:Komentorivi]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Luokka:Komentorivi]]</div></td></tr>
</table>
193.64.20.108
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=35915&oldid=prev
84.250.87.76 (22. huhtikuuta 2012 kello 11.19)
2012-04-22T11:19:06Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 22. huhtikuuta 2012 kello 14.19</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l36">Rivi 36:</td>
<td colspan="2" class="diff-lineno">Rivi 36:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tai</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tai</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 2>&1 > kaikki.txt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 2>&1 > kaikki.txt</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Nimestään huolimatta stderr ei ole pelkkä virhe- vaan myös infotuloste. Esimerkiksi dd-komennolla voi kopioida dataa ja muokata sitä muutamalla yksinkertaisella tavalla</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> echo heippa | dd conv=ucase</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">tulostaa HEIPPA ja kertoo sitten stderr-virtaan paljonko dataa käsitteli. Tämä voidaan putkittaa esimerkiksi</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> echo heippa | dd conv=ucase | rev > tulos.txt</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">jolloin putkessa eteenpäin ja lopuksi tiedostoon siirtyy stdout, ja stderr (ja näin mahdolliset virheilmoitukset) tulostuvat heti ruudulle. Tarvittaessa kunkin komennon stderr-tuloste voidaan ottaa talteen em. 2> -merkinnällä.</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Standardivirhe eroaa standardisyötteestä myös siten, että se on järjestelmän standardikirjaston tasolla oletuksena [[wikipedia:fi:Puskurimuisti|puskuroimaton]]. Näin ohjelman virheilmoitukset tulostuvat ruudulle aina heti.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Standardivirhe eroaa standardisyötteestä myös siten, että se on järjestelmän standardikirjaston tasolla oletuksena [[wikipedia:fi:Puskurimuisti|puskuroimaton]]. Näin ohjelman virheilmoitukset tulostuvat ruudulle aina heti.</div></td></tr>
</table>
84.250.87.76
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=30686&oldid=prev
Ordyh: /* Esimerkki */ huom.
2010-02-15T19:01:56Z
<p><span dir="auto"><span class="autocomment">Esimerkki: </span> huom.</span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 15. helmikuuta 2010 kello 22.01</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l22">Rivi 22:</td>
<td colspan="2" class="diff-lineno">Rivi 22:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Tässä cat lukee tiedostoa tiedosto1, ja ohjaa sen stdoutin kautta tiedostoon /tmp/data1.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Tässä cat lukee tiedostoa tiedosto1, ja ohjaa sen stdoutin kautta tiedostoon /tmp/data1.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 >> /tmp/data1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 >> /tmp/data1</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Tämä on täysin sama, mutta cat:in tuloste (tiedosto1) lisätään tiedoston /tmp/data1 loppuun.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Tämä on täysin sama, mutta cat:in tuloste (tiedosto1) lisätään tiedoston /tmp/data1 loppuun<ins style="font-weight: bold; text-decoration: none;">. Yhden suurempi kuin -merkin tapauksessa /tmp/data1 päällekirjoitetaan, eli tiedoston mahdollinen aiempi sisältö katoaa pysyvästi</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Stderr ===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Stderr ===</div></td></tr>
</table>
Ordyh
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=30679&oldid=prev
LP: graafiset ohjelmat; terminaali -> pääteikkuna
2010-02-15T11:24:50Z
<p>graafiset ohjelmat; terminaali -> pääteikkuna</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 15. helmikuuta 2010 kello 14.24</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Rivi 1:</td>
<td colspan="2" class="diff-lineno">Rivi 1:</td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Tiedosto:Stdstreams-notitle.svg|thumb|right|200px|Standardisyöttövirrat tilanteessa, jossa prosessia ajetaan [[<del style="font-weight: bold; text-decoration: none;">terminaali</del>]]<del style="font-weight: bold; text-decoration: none;">ssa</del>.]]</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Tiedosto:Stdstreams-notitle.svg|thumb|right|200px|Standardisyöttövirrat tilanteessa, jossa prosessia ajetaan [[<ins style="font-weight: bold; text-decoration: none;">terminaaliemulaattori|pääteikkunassa</ins>]] <ins style="font-weight: bold; text-decoration: none;">tms</ins>.]]</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[<del style="font-weight: bold; text-decoration: none;">terminaali</del>]]<del style="font-weight: bold; text-decoration: none;">n</del>) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että stanrdisyötteellä on numerokoodi '''0''' ja <del style="font-weight: bold; text-decoration: none;">stanrdivirheellä </del>numerokoodi '''2'''.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Standardivirroilla''' (engl. '''standard streams''') tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[<ins style="font-weight: bold; text-decoration: none;">terminaaliemulaattori|pääteikkunan</ins>]]) kanssa. Jokaisella [[prosessi]]lla on sen käynnistyksessä avattuna kolme standardivirtaa: ''standardisyöte'' ('''stdin'''), ''standardituloste'' ('''stdout''') ja ''standardivirhe'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] (''file descriptor'') ovat numeroitu nollasta kahteen siten, että stanrdisyötteellä on numerokoodi '''0''' ja <ins style="font-weight: bold; text-decoration: none;">standardivirheellä </ins>numerokoodi '''2'''<ins style="font-weight: bold; text-decoration: none;">.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Kun ohjelma käynnistetään valikosta tai kuvakkeen avulla, sillä ei yleensä ole pääteikkunaa, jonne lähettää standardivirtojaan, eikä näppäimistöä saa yhdistettyä standardisyötteeseen. Osa ohjelmista yhdistää standardivirran johonkin tiedostoon (usein [[piilotiedosto]]on ~/.xsession-errors) tai lokituksesta huolehtivalle ohjelmalle, mutta usein kaikki standardivirrat ohjataan [[laitetiedostot|laitetiedostoon]] /dev/null. Kun ohjelman virheilmoitukset haluaa talteen, sen voi käynnistää komentoriviltä, jolloin standardivirtoja voi käsitellä normaaliin tapaan</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Esimerkki ==</div></td></tr>
</table>
LP
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=30650&oldid=prev
Ordyh: /* Erikoistapauksia */
2010-02-14T13:16:22Z
<p><span dir="auto"><span class="autocomment">Erikoistapauksia</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 14. helmikuuta 2010 kello 16.16</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l39">Rivi 39:</td>
<td colspan="2" class="diff-lineno">Rivi 39:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Erikoistapauksia==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Erikoistapauksia==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Eräät ohjelmat, jotka oletuksena tulostavat tiedostoon, voidaan saada tulostamaan stdoutiin antamalla tiedostonnimeksi "-" tai "-&ensp<del style="font-weight: bold; text-decoration: none;">;</del>;-", esimerkiksi</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Eräät ohjelmat, jotka oletuksena tulostavat tiedostoon, voidaan saada tulostamaan stdoutiin antamalla tiedostonnimeksi "-" tai "-&ensp;-", esimerkiksi</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat /home/juliste.ps | [[Ghotstscript|gs]] -q -dNOPAUSE -sDEVICE=ljet4 -r600 -sOutputFile=- -</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat /home/juliste.ps | [[Ghotstscript|gs]] -q -dNOPAUSE -sDEVICE=ljet4 -r600 -sOutputFile=- -</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Tässä gs eli Ghostscript muuntaa catilta saamansa [[PostScript]]-tiedoston ljet4-tulostimelle sopivalle kuvauskielelle ja ohjaa tuloksen stdoutiin eli tässä tapauksessa näytölle.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Tässä gs eli Ghostscript muuntaa catilta saamansa [[PostScript]]-tiedoston ljet4-tulostimelle sopivalle kuvauskielelle ja ohjaa tuloksen stdoutiin eli tässä tapauksessa näytölle.</div></td></tr>
</table>
Ordyh
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=30649&oldid=prev
Ordyh: Laajennettu. Uudelleensuomennettu standarisisääntulo > standardisyöte ja stdulostulo>stdtuloste. Virtojen nimet kirjoitetaan kirjallisuudessa yleensä pienellä.
2010-02-14T13:09:32Z
<p>Laajennettu. Uudelleensuomennettu standarisisääntulo > standardisyöte ja stdulostulo>stdtuloste. Virtojen nimet kirjoitetaan kirjallisuudessa yleensä pienellä.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 14. helmikuuta 2010 kello 16.09</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Rivi 1:</td>
<td colspan="2" class="diff-lineno">Rivi 1:</td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Standardivirroilla tarkoitetaan Unix- ja Linux-ohjelmien <del style="font-weight: bold; text-decoration: none;">standardeja </del>syöttö- ja <del style="font-weight: bold; text-decoration: none;">tulostuskanavia</del>. <del style="font-weight: bold; text-decoration: none;">Niitä </del>on kolme<del style="font-weight: bold; text-decoration: none;">, standardisisääntulo </del>(<del style="font-weight: bold; text-decoration: none;">STDIN</del>), <del style="font-weight: bold; text-decoration: none;">standardiulostulo </del>(<del style="font-weight: bold; text-decoration: none;">STDOUT</del>) ja standardivirhe (<del style="font-weight: bold; text-decoration: none;">STDERR</del>). Kun [[komentorivi]]llä annetaan <del style="font-weight: bold; text-decoration: none;">esimerkiksi </del>komento</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Tiedosto:Stdstreams-notitle.svg|thumb|right|200px|Standardisyöttövirrat tilanteessa, jossa prosessia ajetaan [[terminaali]]ssa.]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''</ins>Standardivirroilla<ins style="font-weight: bold; text-decoration: none;">''' (engl. '''standard streams''') </ins>tarkoitetaan Unix- ja Linux-ohjelmien syöttö- ja <ins style="font-weight: bold; text-decoration: none;">tulostusvirtoja, joilla ohjelma kommunikoi ajoympäristönsä (useimmiten [[terminaali]]n) kanssa</ins>. <ins style="font-weight: bold; text-decoration: none;">Jokaisella [[prosessi]]lla </ins>on <ins style="font-weight: bold; text-decoration: none;">sen käynnistyksessä avattuna </ins>kolme <ins style="font-weight: bold; text-decoration: none;">standardivirtaa: ''standardisyöte'' </ins>(<ins style="font-weight: bold; text-decoration: none;">'''stdin'''</ins>), <ins style="font-weight: bold; text-decoration: none;">''standardituloste'' </ins>(<ins style="font-weight: bold; text-decoration: none;">'''stdout'''</ins>) ja <ins style="font-weight: bold; text-decoration: none;">''</ins>standardivirhe<ins style="font-weight: bold; text-decoration: none;">'' ('''stderr'''). Kolmen standardivirran [[tiedostokuvain|tiedostokuvaimet]] </ins>(<ins style="font-weight: bold; text-decoration: none;">''file descriptor''</ins>) <ins style="font-weight: bold; text-decoration: none;">ovat numeroitu nollasta kahteen siten, että stanrdisyötteellä on numerokoodi '''0''' ja stanrdivirheellä numerokoodi '''2'''</ins>.</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== Esimerkki ==</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Kun [[komentorivi]]llä annetaan komento</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> [[cat]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> [[cat]]</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">tarkoittaa tämä sitä</del>, <del style="font-weight: bold; text-decoration: none;">että catin </del>standardivirrat on liitetty <del style="font-weight: bold; text-decoration: none;">oletuksiin</del>, eli <del style="font-weight: bold; text-decoration: none;">STDIN </del>näppäimistöön ja <del style="font-weight: bold; text-decoration: none;">STDOUT </del>ja <del style="font-weight: bold; text-decoration: none;">STDERR </del>näyttöön. Käytännössä tämä tarkoittaa sitä, että cat odottaa merkkejä näppäimistöltä syöttääkseen ne välittömästi näytölle <del style="font-weight: bold; text-decoration: none;">([[virtuaalikonsoli]]n [[laitetiedosto]]on)</del>. Jos catin toiminnassa tapahtuu virhe, <del style="font-weight: bold; text-decoration: none;">tulostetaan siitä kertova ilmoitus näytölle</del>.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">cat tutkii [[argumentti]]nsa</ins>, <ins style="font-weight: bold; text-decoration: none;">ja huomaa ettei sille ole annettu tiedostonimeä. Tällöin cat yksinkertaisesti kopioi sille annetun standardisyötteen standarditulosteelle.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Komentorivillä </ins>standardivirrat on liitetty <ins style="font-weight: bold; text-decoration: none;">terminaaliin</ins>, eli <ins style="font-weight: bold; text-decoration: none;">stdin </ins>näppäimistöön ja <ins style="font-weight: bold; text-decoration: none;">stdout </ins>ja <ins style="font-weight: bold; text-decoration: none;">stderr </ins>näyttöön. Käytännössä tämä <ins style="font-weight: bold; text-decoration: none;">siis </ins>tarkoittaa sitä, että cat odottaa merkkejä näppäimistöltä syöttääkseen ne välittömästi näytölle. Jos catin toiminnassa tapahtuu virhe, <ins style="font-weight: bold; text-decoration: none;">se tulostaa ilmoituksen standardivirheelle</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos taas annetaan komento</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos taas annetaan komento</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">lukee </del>cat <del style="font-weight: bold; text-decoration: none;">tiedostoa </del>tiedosto1 ja <del style="font-weight: bold; text-decoration: none;">tulostaa sen STDOUTiin </del>eli näytölle.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>cat <ins style="font-weight: bold; text-decoration: none;">avaa tiedoston </ins>tiedosto1 ja <ins style="font-weight: bold; text-decoration: none;">lukee sitä kunnes kohtaa [[EOF|loppumerkin]], kopioiden tiedoston sisällön standarditulosteelle, </ins>eli näytölle. <ins style="font-weight: bold; text-decoration: none;">Komento</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Johtaa </del>samaan lopputulokseen kuin ylläoleva komento, mutta tässä tiedosto1 ohjataan <del style="font-weight: bold; text-decoration: none;">erillisellä komennolla </del>catin <del style="font-weight: bold; text-decoration: none;">STDINiin</del>, josta cat sitten <del style="font-weight: bold; text-decoration: none;">syöttää </del>sen <del style="font-weight: bold; text-decoration: none;">STDOUTiin</del>.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">johtaa käyttäjän kannalta täysin </ins>samaan lopputulokseen kuin ylläoleva komento, mutta tässä tiedosto1 ohjataan <ins style="font-weight: bold; text-decoration: none;">[[komentotulkki|komentotulkin]] [[uudelleenohjaus]] operaattorilla < </ins>catin <ins style="font-weight: bold; text-decoration: none;">standardisyötteelle</ins>, josta cat sitten <ins style="font-weight: bold; text-decoration: none;">kopioi </ins>sen <ins style="font-weight: bold; text-decoration: none;">standarditulosteelle</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Jos <del style="font-weight: bold; text-decoration: none;">tulostus </del>halutaan <del style="font-weight: bold; text-decoration: none;">ohjata </del>toiselle ohjelmalle, voidaan käyttää <del style="font-weight: bold; text-decoration: none;">esimerkiksi </del>syntaksia</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Jos <ins style="font-weight: bold; text-decoration: none;">ohjelman standardituloste </ins>halutaan <ins style="font-weight: bold; text-decoration: none;">[[putki|putkittaa]] </ins>toiselle ohjelmalle, voidaan käyttää syntaksia</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1 | [[less]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1 | [[less]]</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>jossa catin tuloste putkitetaan lessille lisäkäsittelyä varten. Tässä catin <del style="font-weight: bold; text-decoration: none;">STDIN </del>on liitetty tiedostoon tiedosto1 ja <del style="font-weight: bold; text-decoration: none;">STDOUT </del>uudelleenohjattu lessille. Jos catin tuloste halutaan ohjata tiedostoon, voidaan siihen käyttää suurempi kuin -<del style="font-weight: bold; text-decoration: none;">merkkiä </del>esimerkiksi seuraavasti:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>jossa catin tuloste putkitetaan lessille lisäkäsittelyä varten. Tässä catin <ins style="font-weight: bold; text-decoration: none;">stdin </ins>on liitetty tiedostoon tiedosto1<ins style="font-weight: bold; text-decoration: none;">, </ins>ja <ins style="font-weight: bold; text-decoration: none;">stdout </ins>uudelleenohjattu lessille. Jos catin tuloste halutaan ohjata tiedostoon, voidaan siihen käyttää <ins style="font-weight: bold; text-decoration: none;">komentotulkin </ins>suurempi kuin -<ins style="font-weight: bold; text-decoration: none;">operaattoria </ins>esimerkiksi seuraavasti:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 > /tmp/data1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 > /tmp/data1</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Tässä cat lukee tiedostoa tiedosto1 ja ohjaa sen <del style="font-weight: bold; text-decoration: none;">STDOUTin </del>kautta tiedostoon /tmp/data1. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Tässä cat lukee tiedostoa tiedosto1<ins style="font-weight: bold; text-decoration: none;">, </ins>ja ohjaa sen <ins style="font-weight: bold; text-decoration: none;">stdoutin </ins>kautta tiedostoon /tmp/data1<ins style="font-weight: bold; text-decoration: none;">.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> cat tiedosto1 >> /tmp/data1</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Tämä on täysin sama, mutta cat:in tuloste (tiedosto1) lisätään tiedoston /tmp/data1 loppuun</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">STDERRiä </del>ei <del style="font-weight: bold; text-decoration: none;">vielä sen sijaan </del>ole liitetty mihinkään <del style="font-weight: bold; text-decoration: none;">erityiseen paikkaan</del>, vaan virheilmoitukset tulostuvat <del style="font-weight: bold; text-decoration: none;">edelleenkin </del>ruudulle. <del style="font-weight: bold; text-decoration: none;">STDERRin käsittelyyn </del>voidaan <del style="font-weight: bold; text-decoration: none;">käyttää kolmea erilaista syntaksia</del>:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=== Stderr ===</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Stderriä eli standardivirhettä </ins>ei <ins style="font-weight: bold; text-decoration: none;">yllä </ins>ole liitetty mihinkään <ins style="font-weight: bold; text-decoration: none;">tiedostoon tai putkeen</ins>, vaan virheilmoitukset tulostuvat <ins style="font-weight: bold; text-decoration: none;">suoraan </ins>ruudulle. <ins style="font-weight: bold; text-decoration: none;">Tämä on yleensä toivottua. Myös stderr </ins>voidaan <ins style="font-weight: bold; text-decoration: none;">kuitenkin uudelleenohjata komentotulkkisyntaksilla</ins>:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 2> lista.txt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 2> lista.txt</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Ohjaa catin tulosteesta vain <del style="font-weight: bold; text-decoration: none;">STDERRin </del>tiedostoon lista.txt. Vastaavasti</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Ohjaa catin tulosteesta vain <ins style="font-weight: bold; text-decoration: none;">stderrin </ins>tiedostoon lista.txt. Vastaavasti</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 1> lista.txt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 1> lista.txt</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi normaaliin tapaan vain <del style="font-weight: bold; text-decoration: none;">STDOUTin </del>tiedostoon ja <del style="font-weight: bold; text-decoration: none;">STDERR </del>tulostuisi näytölle.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi normaaliin tapaan vain <ins style="font-weight: bold; text-decoration: none;">stdoutin </ins>tiedostoon ja <ins style="font-weight: bold; text-decoration: none;">stderr </ins>tulostuisi näytölle <ins style="font-weight: bold; text-decoration: none;">(1> on siis täysin sama kuin >)</ins>.</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Sekä stdoutin että stderrin uudelleenohjaukseen samaan paikkaan voi käyttää komentotulkin syntaksia</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> cat tiedosto1 >& kaikki.txt</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">tai</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> cat tiedosto1 2>&1 > kaikki.txt</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Sekä STDOUTin </del>että <del style="font-weight: bold; text-decoration: none;">STDERRin uudelleenohjaukseen samaan paikkaan voi käyttää syntaksia</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Standardivirhe eroaa standardisyötteestä myös siten, </ins>että <ins style="font-weight: bold; text-decoration: none;">se on järjestelmän standardikirjaston tasolla oletuksena [[wikipedia:fi:Puskurimuisti|puskuroimaton]]. Näin ohjelman virheilmoitukset tulostuvat ruudulle aina heti</ins>.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> cat tiedosto1 >& lista</del>.<del style="font-weight: bold; text-decoration: none;">txt</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Erikoistapauksia==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Erikoistapauksia==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Eräät ohjelmat, jotka oletuksena tulostavat tiedostoon, voidaan saada tulostamaan <del style="font-weight: bold; text-decoration: none;">STDOUTiin </del>antamalla tiedostonnimeksi "-" tai "- -", esimerkiksi</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Eräät ohjelmat, jotka oletuksena tulostavat tiedostoon, voidaan saada tulostamaan <ins style="font-weight: bold; text-decoration: none;">stdoutiin </ins>antamalla tiedostonnimeksi "-" tai "-<ins style="font-weight: bold; text-decoration: none;">&ensp;;</ins>-", esimerkiksi</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat /home/juliste.ps | [[Ghotstscript|gs]] -q -dNOPAUSE -sDEVICE=ljet4 -r600 -sOutputFile=- -</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat /home/juliste.ps | [[Ghotstscript|gs]] -q -dNOPAUSE -sDEVICE=ljet4 -r600 -sOutputFile=- -</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Tässä gs eli Ghostscript muuntaa catilta saamansa [[PostScript]]-tiedoston ljet4-tulostimelle sopivalle kuvauskielelle ja ohjaa tuloksen <del style="font-weight: bold; text-decoration: none;">STDOUTiin </del>eli tässä tapauksessa näytölle.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Tässä gs eli Ghostscript muuntaa catilta saamansa [[PostScript]]-tiedoston ljet4-tulostimelle sopivalle kuvauskielelle ja ohjaa tuloksen <ins style="font-weight: bold; text-decoration: none;">stdoutiin </ins>eli tässä tapauksessa näytölle.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Tee ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Tee ==</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Komentoa [[tee]] voidaan käyttää ohjaamaan sen <del style="font-weight: bold; text-decoration: none;">STDINiin </del>syötetty data sekä tiedostoon että <del style="font-weight: bold; text-decoration: none;">uudelleen STDOUTiin</del>. Esimerkiksi komento</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Komentoa [[tee]] voidaan käyttää ohjaamaan sen <ins style="font-weight: bold; text-decoration: none;">standardisyötteelle </ins>syötetty data sekä tiedostoon että <ins style="font-weight: bold; text-decoration: none;">standarditulosteelle</ins>. Esimerkiksi komento</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tulostaisi tiedosto1:n sekä näytölle että tiedostoon lista.txt.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tulostaisi tiedosto1:n sekä näytölle että tiedostoon lista.txt.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l37">Rivi 37:</td>
<td colspan="2" class="diff-lineno">Rivi 50:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komento</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komento</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt >> lista2.txt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt >> lista2.txt</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi tiedosto1:n sekä tiedostoon lista.txt (ylikirjoittaen sen vanhan sisällön) että myös tiedoston lista2.txt loppuun (>-merkki annettu tuplana). Näytölle ei tulostu mitään, koska teen <del style="font-weight: bold; text-decoration: none;">STDOUT </del>on ohjattu tiedostoon lista2.txt.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi tiedosto1:n sekä tiedostoon lista.txt (ylikirjoittaen sen vanhan sisällön) että myös tiedoston lista2.txt loppuun (>-merkki annettu tuplana). Näytölle ei tulostu mitään, koska teen <ins style="font-weight: bold; text-decoration: none;">stdout </ins>on ohjattu tiedostoon lista2.txt.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos halutaan, että tiedoston lista.txt sisältöä ei ylikirjoiteta, vaan uusi teksti lisätään sen loppuun, voidaan käyttää valitsinta -a:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos halutaan, että tiedoston lista.txt sisältöä ei ylikirjoiteta, vaan uusi teksti lisätään sen loppuun, voidaan käyttää valitsinta -a:</div></td></tr>
</table>
Ordyh
https://www.linux.fi/w/index.php?title=Standardivirrat&diff=30647&oldid=prev
Ordyh: standardimpi shellisyntaksi
2010-02-14T12:17:46Z
<p>standardimpi shellisyntaksi</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fi">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Vanhempi versio</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Versio 14. helmikuuta 2010 kello 15.17</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l6">Rivi 6:</td>
<td colspan="2" class="diff-lineno">Rivi 6:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>lukee cat tiedostoa tiedosto1 ja tulostaa sen STDOUTiin eli näytölle.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>lukee cat tiedostoa tiedosto1 ja tulostaa sen STDOUTiin eli näytölle.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> cat <tiedosto1</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Johtaa samaan lopputulokseen kuin ylläoleva komento, mutta tässä tiedosto1 ohjataan erillisellä komennolla catin STDINiin, josta cat sitten syöttää sen STDOUTiin.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Johtaa samaan lopputulokseen kuin ylläoleva komento, mutta tässä tiedosto1 ohjataan erillisellä komennolla catin STDINiin, josta cat sitten syöttää sen STDOUTiin.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos tulostus halutaan ohjata toiselle ohjelmalle, voidaan käyttää esimerkiksi syntaksia</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos tulostus halutaan ohjata toiselle ohjelmalle, voidaan käyttää esimerkiksi syntaksia</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1|[[less]]</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> cat < tiedosto1 | [[less]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>jossa catin tuloste putkitetaan lessille lisäkäsittelyä varten. Tässä catin STDIN on liitetty tiedostoon tiedosto1 ja STDOUT uudelleenohjattu lessille. Jos catin tuloste halutaan ohjata tiedostoon, voidaan siihen käyttää suurempi kuin -merkkiä esimerkiksi seuraavasti:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>jossa catin tuloste putkitetaan lessille lisäkäsittelyä varten. Tässä catin STDIN on liitetty tiedostoon tiedosto1 ja STDOUT uudelleenohjattu lessille. Jos catin tuloste halutaan ohjata tiedostoon, voidaan siihen käyttää suurempi kuin -merkkiä esimerkiksi seuraavasti:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 > /tmp/data1</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 > /tmp/data1</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l32">Rivi 32:</td>
<td colspan="2" class="diff-lineno">Rivi 32:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Tee ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Tee ==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komentoa [[tee]] voidaan käyttää ohjaamaan sen STDINiin syötetty data sekä tiedostoon että uudelleen STDOUTiin. Esimerkiksi komento</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komentoa [[tee]] voidaan käyttää ohjaamaan sen STDINiin syötetty data sekä tiedostoon että uudelleen STDOUTiin. Esimerkiksi komento</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1|tee lista.txt</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tulostaisi tiedosto1:n sekä näytölle että tiedostoon lista.txt.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>tulostaisi tiedosto1:n sekä näytölle että tiedostoon lista.txt.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komento</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Komento</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1|tee lista.txt>>lista2.txt</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee lista.txt >> lista2.txt</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi tiedosto1:n sekä tiedostoon lista.txt (ylikirjoittaen sen vanhan sisällön) että myös tiedoston lista2.txt loppuun (>-merkki annettu tuplana). Näytölle ei tulostu mitään, koska teen STDOUT on ohjattu tiedostoon lista2.txt.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>ohjaisi tiedosto1:n sekä tiedostoon lista.txt (ylikirjoittaen sen vanhan sisällön) että myös tiedoston lista2.txt loppuun (>-merkki annettu tuplana). Näytölle ei tulostu mitään, koska teen STDOUT on ohjattu tiedostoon lista2.txt.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos halutaan, että tiedoston lista.txt sisältöä ei ylikirjoiteta, vaan uusi teksti lisätään sen loppuun, voidaan käyttää valitsinta -a:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jos halutaan, että tiedoston lista.txt sisältöä ei ylikirjoiteta, vaan uusi teksti lisätään sen loppuun, voidaan käyttää valitsinta -a:</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1|tee -a lista.txt</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> cat tiedosto1 | tee -a lista.txt</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Katso myös==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Katso myös==</div></td></tr>
</table>
Ordyh