From ef26c2e37d24fc31bdef0444bea61ff7d4a2a10e Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Sat, 1 Dec 2018 02:32:13 +0900 Subject: [PATCH 01/59] More readable Japanese --- TranslatorGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index ebc4a6c0..057e0bd5 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -3,7 +3,7 @@ ## レッスンのタイトル 最初に翻訳を始めた人が決めます。 -そのあとは統一しましょう。 +そのあとに統一しましょう。 ## 本文 From 309078b3aa5af3d1314b6abbb0aeb93900918b91 Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Sat, 1 Dec 2018 02:34:42 +0900 Subject: [PATCH 02/59] Little bit fluent Japanese --- TranslatorGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index 057e0bd5..24bbfcb6 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -9,7 +9,7 @@ 「です・ます調」を基本とします。 -直訳よりも、分かりやすいかつ自然な日本語を優先します。 +直訳よりも、分かりやすい自然な日本語を優先します。 したがって、言葉を逐一訳す必要もなく、文章のフレーズの順番を守る必要もありません。 `.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入る)。 From 4cdcc5735432a181358aba1c63253825c9f169e6 Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Sat, 1 Dec 2018 02:35:07 +0900 Subject: [PATCH 03/59] Update TranslatorGuidelines.md --- TranslatorGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index 24bbfcb6..a0e4c0b3 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -9,7 +9,7 @@ 「です・ます調」を基本とします。 -直訳よりも、分かりやすい自然な日本語を優先します。 +直訳よりも、分かりやすく自然な日本語を優先します。 したがって、言葉を逐一訳す必要もなく、文章のフレーズの順番を守る必要もありません。 `.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入る)。 From 50c04d274889e0fcbdcc9a2ebd06440669e3f039 Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Sat, 1 Dec 2018 02:48:08 +0900 Subject: [PATCH 04/59] Update TranslatorGuidelines.md --- TranslatorGuidelines.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index a0e4c0b3..6568cb01 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -10,11 +10,11 @@ 「です・ます調」を基本とします。 直訳よりも、分かりやすく自然な日本語を優先します。 -したがって、言葉を逐一訳す必要もなく、文章のフレーズの順番を守る必要もありません。 +従って、言葉を逐一訳す必要もなく、文章のフレーズの順番を守る必要もありません。 `.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入る)。 なので、`\n`は無視して下さい(英語と日本語で`\n`の数・場所を合わせる必要はありません)。 -翻訳をする際、`\n`を入れると書きやすく・見やすくなるのであれば、入れても構いません。 +翻訳をする際、改行を入れると書きやすく・見やすくなるのであれば、改行(`\n`)を入れても構いません。 ### 専門用語 @@ -33,7 +33,7 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン ### 句読点 -「、。」を使うようにしましょう(,.ではなく)。 +カンマ(,)やピリオド(.)ではなく「、。」を使うようにしましょう。 ### 数字 @@ -47,7 +47,8 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン - 12,500 が 1万2千5百 より短くて読みやすい -- 日付は半角 (8月12日 とする。8月12日 とはしない)、そして西暦を使うように。 +- 西暦を使い、日付は半角を使いましょう。 + - 8月12日 とします。一桁だからといって8月12日 と8を全角を使いません ### 漢数字と算用数字 @@ -75,7 +76,7 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン このような場合に参照する国語辞典としては広辞苑が定番ですが、あいにく広辞苑はネットで無料で使えるようになっていません。 ネットで引けるものとしては三省堂の大辞林 [http://www.excite.co.jp/dictionary/japanese/](http://www.excite.co.jp/dictionary/japanese/) や小学館の大辞泉 [http://dictionary.goo.ne.jp/jn/](http://dictionary.goo.ne.jp/jn/) があります。 -国語辞典に載っていない語について最も標準的な表記を調べるには、googleで検索したときのヒット件数が参考になります。 +国語辞典に載っていない語について最も標準的な表記を調べるには、Googleで検索したときのヒット件数が参考になります。 ### 題名 @@ -92,16 +93,16 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン 組織名称などの処理の工夫として定訳がない組織名は「英語(日本語訳)」とか、長いものなら「略語(日本語訳)」。 以下のようなことを考えて、組織名称ごとに判断します。 -組織名、固有名詞などは、英字を維持した方が、検索しさらに勉強したい人の便宜にかなうかもしれません (カタカナ表記してしまうと、検索してもこのレッスンだけがヒットする状況が生まれることがある)。 +組織名、固有名詞などは、英字を維持した方が、検索しさらに勉強したい人にとってよいかもしれません (無理にカタカナ表記にしてしまうと、検索してもこのレッスンだけがヒットする状況が生まれることがあります)。 -組織名が、日本の視聴者にとって意味ある情報かを考えましょう。 +組織名が、日本語を読む人にとって意味ある情報かを考えましょう。 -例えば、略称の読みが、別の単語と同じ音になっている、韻を踏んでいるなど、学生にとって意味がある場合はカッコ書きで音訳を添えるのは親切かもしれません。 +例えば、略称の読みが、別の単語と同じ音になっている、韻を踏んでいるなど、学生にとって意味がある場合はカッコ書きで音訳を添えると親切かもしれません。 メロドラマのタイトルだったら、「オール・マイ・チルドレン」などと音訳するのも、雰囲気を伝える一つの手です。 -『戻ってきた帽子をかぶったネコ(The Cat in the Hat Comes Back)』と両方書いてあると、両方検索した段階で、実は日本語訳がないことがわかる。 -一読したときには、物語のタイトルとわかる。 +『戻ってきた帽子をかぶったネコ(The Cat in the Hat Comes Back)』と両方書いてあると、両方検索した段階で、実は日本語訳がないことがわかり、 +一読したときに、物語のタイトルとわかります。 ### 地名 From 3013b0045bb75e1898cf8e2e8bdbddd62ca5be6d Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Sat, 1 Dec 2018 02:57:47 +0900 Subject: [PATCH 05/59] Unification of notation --- TranslatorGuidelines.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index 6568cb01..7feb5636 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -12,7 +12,7 @@ 直訳よりも、分かりやすく自然な日本語を優先します。 従って、言葉を逐一訳す必要もなく、文章のフレーズの順番を守る必要もありません。 -`.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入る)。 +`.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入ります)。 なので、`\n`は無視して下さい(英語と日本語で`\n`の数・場所を合わせる必要はありません)。 翻訳をする際、改行を入れると書きやすく・見やすくなるのであれば、改行(`\n`)を入れても構いません。 @@ -56,9 +56,9 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン ### 単位 -- メートル法に変換 +- メートル法に変換します -- ドル以外の場合は必要に応じて日本円に換算する。()に入れても良い +- ドル以外の場合は必要に応じて日本円に換算します。()の中に入れても良いです - 大雑把な数字は大雑把な数字として訳して、数字の精度について誤った印象を与えないようにします。 @@ -80,10 +80,10 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン ### 題名 -本、雑誌、記事、映画、番組、コンピューターゲームは『』でくくる。 +本、雑誌、記事、映画、番組、コンピューターゲームは『』でくくります。 オフィシャルな訳がない作品のタイトルは訳しません。 -文字数が許せば『英語(日本語訳)』とするのが親切かもしれません。 +文字数が許せば『英語(日本語訳)』とするのが親切になるでしょう。 例:『 Visual Explanations (説明図の技法)』← 未訳の本です。 説明図の技法というのは、内容を伝えるために仮に訳したタイトルです。 @@ -111,7 +111,7 @@ DC/SWCのレッスンは専門用語がかなり多く、複数のレッスン ### 解説・訂正 日本語の文字とのバランスを考え、全角のかな文字を囲むときには、全角の()がおすすめです。 -半角英数文字を囲むときには、半角の()を使ってください。                   +半角英数文字を囲むときには、半角の()を使いましょう。                   訳者の解説は() From 4760815047d02e5a0b7e9948665a27f6fb402f05 Mon Sep 17 00:00:00 2001 From: megane0-0 Date: Fri, 19 Jul 2019 15:30:17 -0700 Subject: [PATCH 06/59] add translation in background --- .gitmodules | 3 +++ po/git-novice | 1 + 2 files changed, 4 insertions(+) create mode 160000 po/git-novice diff --git a/.gitmodules b/.gitmodules index f9be339e..680c47ee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "po4gitbook"] path = po4gitbook url = https://github.com/swcarpentry-i18n/po4gitbook.git +[submodule "po/git-novice"] + path = po/git-novice + url = https://github.com/swcarpentry/git-novice.git diff --git a/po/git-novice b/po/git-novice new file mode 160000 index 00000000..08b3bae1 --- /dev/null +++ b/po/git-novice @@ -0,0 +1 @@ +Subproject commit 08b3bae10aa2b4ce96cffbbde533da2374c57d44 From bac9739426b7b3dca5585980db4799240166298e Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Fri, 9 Aug 2019 07:17:34 +0900 Subject: [PATCH 07/59] translated writing data --- po/r-novice-gapminder.ja.po | 113 +++++++++++++++--------------------- 1 file changed, 48 insertions(+), 65 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 1e81d510..11950f17 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2019-07-03 06:58+0900\n" +"PO-Revision-Date: 2019-08-09 06:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -15630,31 +15630,31 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 11-writing-data.md in _episodes_rmd/\n" -"title: Writing Data\n" -"teaching: 10\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I save plots and data created in R?\"\n" -"objectives:\n" -"- \"To be able to write out plots and data from R.\"\n" -"keypoints:\n" -"- \"Save plots from RStudio using the 'Export' button.\"\n" -"- \"Use `write.table` to save tabular data.\"\n" +"title: データの出力\n" +"講義: 10\n" +"練習: 10\n" +"質問:\n" +"- \"Rで作った図を保存するにはどうしますか?\"\n" +"目標:\n" +"- \"図やデータを R から書き出せるようになりましょう。\"\n" +"要点:\n" +"- \"RStudio のエクスポートボタンを使って図を保存しましょう。\"\n" +"- \"`write.table` を使って表形式のデータを保存しましょう。\"\n" "source: Rmd\n" "---" # header #: r-novice-gapminder/_episodes/11-writing-data.md:20 msgid "## Saving plots" -msgstr "## Saving plots" +msgstr "## 図を保存する" #: r-novice-gapminder/_episodes/11-writing-data.md:22 msgid "" "You have already seen how to save the most recent plot you create in `ggplot2`,\n" "using the command `ggsave`. As a refresher:" msgstr "" -"You have already seen how to save the most recent plot you create in `ggplot2`,\n" -"using the command `ggsave`. As a refresher:" +"`ggsave` 関数を使って、`ggplot2` を用いて作った直近の図を保存する方法は既に学んだ通りです。\n" +"おさらいしておきましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:26 @@ -15673,9 +15673,8 @@ msgid "" "in the 'Plot' window. This will give you the option of saving as a\n" ".pdf or as .png, .jpg or other image formats." msgstr "" -"You can save a plot from within RStudio using the 'Export' button\n" -"in the 'Plot' window. This will give you the option of saving as a\n" -".pdf or as .png, .jpg or other image formats." +"RStudio から図を保存するには \"Plot\" ウィンドウにある \"Export\" ボタンを使います。\n" +"この機能を使うと、図を .pdf や .png、.jpg など様々が画像形式を選ぶことができます。" #: r-novice-gapminder/_episodes/11-writing-data.md:35 msgid "" @@ -15686,12 +15685,10 @@ msgid "" "each subset, and you want to save each plot, but obviously can't stop\n" "the loop to click 'Export' for each one." msgstr "" -"Sometimes you will want to save plots without creating them in the\n" -"'Plot' window first. Perhaps you want to make a pdf document with\n" -"multiple pages: each one a different plot, for example. Or perhaps\n" -"you're looping through multiple subsets of a file, plotting data from\n" -"each subset, and you want to save each plot, but obviously can't stop\n" -"the loop to click 'Export' for each one." +"図を \"Plot\" ウィンドウに表示することなく保存したいこともあるでしょう。\n" +"ページごとに一つの図を含むような複数のページから成る PDF を出力したいこともあるでしょう。\n" +"あるいはループを使ってファイル中のデータの絞り込み条件を変えながら複数の図を作成していて、\n" +"一つずつ保存するために一々ループをとめて \"Export\" ボタンを押すことが不可能な場合もあるでしょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:42 msgid "" @@ -15699,9 +15696,9 @@ msgid "" "`pdf` creates a new pdf device. You can control the size and resolution\n" "using the arguments to this function." msgstr "" -"In this case you can use a more flexible approach. The function\n" -"`pdf` creates a new pdf device. You can control the size and resolution\n" -"using the arguments to this function." +"このような場合、より柔軟な方法を使います。\n" +"`pdf` 関数は新たに PDF デバイスを作ります。\n" +"この関数に引数を指定することで、サイズや解像度を調整できます。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:47 @@ -15723,14 +15720,14 @@ msgstr "" " geom_line() +\n" " theme(legend.position = \"none\")\n" "\n" -"# You then have to make sure to turn off the pdf device!\n" +"# PDF デバイスを確実に終了しておく必要があります!\n" "\n" "dev.off()\n" "~~~" #: r-novice-gapminder/_episodes/11-writing-data.md:59 msgid "Open up this document and have a look." -msgstr "Open up this document and have a look." +msgstr "このドキュメントを開いて内容を確認して見て下さい。" #: r-novice-gapminder/_episodes/11-writing-data.md:62 msgid "" @@ -15753,10 +15750,8 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Rewrite your 'pdf' command to print a second\n" -"> page in the pdf, showing a facet plot (hint: use `facet_grid`)\n" -"> of the same data with one panel per continent.\n" -"> > ## Solution to challenge 1\n" +"> `pdf` コマンドを書き直して、2ページ目に同じデータを大陸ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" +"> > ## チャレンジ1の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -15774,34 +15769,30 @@ msgstr "" msgid "" "The commands `jpeg`, `png` etc. are used similarly to produce\n" "documents in different formats." -msgstr "" -"The commands `jpeg`, `png` etc. are used similarly to produce\n" -"documents in different formats." +msgstr "同様にして `jepg` や `png` などのコマンドを使うことで、他の形式のドキュメントを作成できます。" # header #: r-novice-gapminder/_episodes/11-writing-data.md:86 msgid "## Writing data" -msgstr "## Writing data" +msgstr "## データを書き出す" #: r-novice-gapminder/_episodes/11-writing-data.md:88 msgid "At some point, you'll also want to write out data from R." -msgstr "At some point, you'll also want to write out data from R." +msgstr "R からデータを書き出したいこともあります。" #: r-novice-gapminder/_episodes/11-writing-data.md:90 msgid "" "We can use the `write.table` function for this, which is\n" "very similar to `read.table` from before." -msgstr "" -"We can use the `write.table` function for this, which is\n" -"very similar to `read.table` from before." +msgstr "これには、既に使った `read.table` 関数とよく似た `write.table` 関数を使います。" #: r-novice-gapminder/_episodes/11-writing-data.md:93 msgid "" "Let's create a data-cleaning script, for this analysis, we\n" "only want to focus on the gapminder data for Australia:" msgstr "" -"Let's create a data-cleaning script, for this analysis, we\n" -"only want to focus on the gapminder data for Australia:" +"データを綺麗にするスクリプトを書きましょう。\n" +"今回の分析では、gapminder データの中のオーストラリアに該当する部分だけを使います。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:97 @@ -15828,9 +15819,7 @@ msgstr "" msgid "" "Let's switch back to the shell to take a look at the data to make sure it looks\n" "OK:" -msgstr "" -"Let's switch back to the shell to take a look at the data to make sure it looks\n" -"OK:" +msgstr "シェルに戻ってデータが正しく出力されているか確認しましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:111 @@ -15879,17 +15868,14 @@ msgid "" "quotation marks come from? Also the row numbers are\n" "meaningless." msgstr "" -"Hmm, that's not quite what we wanted. Where did all these\n" -"quotation marks come from? Also the row numbers are\n" -"meaningless." +"どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" +"また、無意味な行番号があります。" #: r-novice-gapminder/_episodes/11-writing-data.md:137 msgid "" "Let's look at the help file to work out how to change this\n" "behaviour." -msgstr "" -"Let's look at the help file to work out how to change this\n" -"behaviour." +msgstr "ヘルプファイルを見てこの挙動の変更を試みましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:141 @@ -15908,13 +15894,12 @@ msgid "" "when writing out to file. It will also write out the row and\n" "column names." msgstr "" -"By default R will wrap character vectors with quotation marks\n" -"when writing out to file. It will also write out the row and\n" -"column names." +"既定では、R は文字列をファイルに出力する時に引用符で囲みます。\n" +"また、行と列の名前も出力します。" #: r-novice-gapminder/_episodes/11-writing-data.md:150 msgid "Let's fix this:" -msgstr "Let's fix this:" +msgstr "以下のように修正しましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:153 @@ -15937,7 +15922,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:162 msgid "Now lets look at the data again using our shell skills:" -msgstr "Now lets look at the data again using our shell skills:" +msgstr "もう一度シェルの技術を使ってデータを確認してみましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:173 @@ -15970,7 +15955,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:187 msgid "That looks better!" -msgstr "That looks better!" +msgstr "よくなりました!" #: r-novice-gapminder/_episodes/11-writing-data.md:190 msgid "" @@ -15993,12 +15978,10 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Write a data-cleaning script file that subsets the gapminder\n" -"> data to include only data points collected since 1990.\n" +"> gapminder データを1990年以降のデータのみに絞り込むスクリプトを書いて下さい。\n" ">\n" -"> Use this script to write out the new subset to a file\n" -"> in the `cleaned-data/` directory.\n" -"> > ## Solution to challenge 2\n" +"> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに書き出しましょう。\n" +"> > ## チャレンジ2の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -21988,17 +21971,17 @@ msgstr "" # header #: r-novice-gapminder/reference.md:204 msgid "## [Writing data]({{ page.root }}/11-writing-data/)" -msgstr "## [Writing data]({{ page.root }}/11-writing-data/)" +msgstr "## [データの出力]({{ page.root }}/11-writing-data/)" # unordered list #: r-novice-gapminder/reference.md:206 msgid " - `write.table` to write out objects in regular format" -msgstr " - `write.table` to write out objects in regular format" +msgstr " - `write.table` を使ってオブジェクトを一般的な形式に出力しましょう。" # unordered list #: r-novice-gapminder/reference.md:207 msgid " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" -msgstr " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" +msgstr " - `quote=FALSE` を指定して文字列が引用符に囲われないようにしましょう。" # header #: r-novice-gapminder/reference.md:209 From 89dc642927ab8d9dd176023cfd9e45df6a6267f9 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:10:28 +0900 Subject: [PATCH 08/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 11950f17..e3b5ec9e 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15636,7 +15636,7 @@ msgstr "" "質問:\n" "- \"Rで作った図を保存するにはどうしますか?\"\n" "目標:\n" -"- \"図やデータを R から書き出せるようになりましょう。\"\n" +"- \"R から図やデータを 出力出来るようになりましょう。\"\n" "要点:\n" "- \"RStudio のエクスポートボタンを使って図を保存しましょう。\"\n" "- \"`write.table` を使って表形式のデータを保存しましょう。\"\n" From 7cbf186aa01128747b87c971bbe506971ee578ac Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:05 +0900 Subject: [PATCH 09/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index e3b5ec9e..550fd6dd 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15727,7 +15727,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:59 msgid "Open up this document and have a look." -msgstr "このドキュメントを開いて内容を確認して見て下さい。" +msgstr "このドキュメントを開いて内容を確認してみましょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:62 msgid "" From 8a5df497c218e4fac754e0f7cb8c4b27bd05dec7 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:34 +0900 Subject: [PATCH 10/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 550fd6dd..ff408e8c 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15869,7 +15869,7 @@ msgid "" "meaningless." msgstr "" "どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" -"また、無意味な行番号があります。" +"また、行番号には意味がありません。" #: r-novice-gapminder/_episodes/11-writing-data.md:137 msgid "" From ee26302cd5a6d087d57afd922cb827537217acf8 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:46 +0900 Subject: [PATCH 11/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index ff408e8c..d9f0e05e 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15875,7 +15875,7 @@ msgstr "" msgid "" "Let's look at the help file to work out how to change this\n" "behaviour." -msgstr "ヘルプファイルを見てこの挙動の変更を試みましょう。" +msgstr "ヘルプファイルを見てこの動作を変更しましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:141 From feb4e7ff71348487089e7da0889178d400fe89c8 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:55 +0900 Subject: [PATCH 12/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index d9f0e05e..68df2f9d 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15922,7 +15922,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:162 msgid "Now lets look at the data again using our shell skills:" -msgstr "もう一度シェルの技術を使ってデータを確認してみましょう。" +msgstr "もう一度シェルを使ってデータを確認してみましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:173 From 1a614e72ff62bf63e495d3dba557fed535bbaf71 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:12:27 +0900 Subject: [PATCH 13/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 68df2f9d..86eac730 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15980,7 +15980,7 @@ msgstr "" ">\n" "> gapminder データを1990年以降のデータのみに絞り込むスクリプトを書いて下さい。\n" ">\n" -"> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに書き出しましょう。\n" +"> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに出力しましょう。\n" "> > ## チャレンジ2の解答\n" "> >\n" "> > \n" From 96c14b4ebb8222cdba83691ac0a8fafb973a03ce Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:12:58 +0900 Subject: [PATCH 14/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 86eac730..3426c3fc 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15688,7 +15688,7 @@ msgstr "" "図を \"Plot\" ウィンドウに表示することなく保存したいこともあるでしょう。\n" "ページごとに一つの図を含むような複数のページから成る PDF を出力したいこともあるでしょう。\n" "あるいはループを使ってファイル中のデータの絞り込み条件を変えながら複数の図を作成していて、\n" -"一つずつ保存するために一々ループをとめて \"Export\" ボタンを押すことが不可能な場合もあるでしょう。" +"一つずつ保存するためにいちいちループを止めて \"Export\" ボタンを押すことが不可能な場合もあるでしょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:42 msgid "" From 242d965929281db1d1282bb46eb7b8ae9f582788 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:13:09 +0900 Subject: [PATCH 15/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 3426c3fc..430eb549 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15750,7 +15750,7 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> `pdf` コマンドを書き直して、2ページ目に同じデータを大陸ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" +"> `pdf` コマンドを書き直して、2ページ目に同じデータを `continent` ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" "> > ## チャレンジ1の解答\n" "> >\n" "> > \n" From 9aef0a60a298e8caff7f63f3f8cea2d01305e8cf Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Thu, 26 Mar 2020 16:40:30 +0900 Subject: [PATCH 16/59] Revert "Translated writing data - r-novice-gapminder" --- po/r-novice-gapminder.ja.po | 113 +++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 48 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 65b71ac0..90a7126b 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2019-08-09 06:57+0900\n" +"PO-Revision-Date: 2019-08-09 06:17+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -15478,31 +15478,31 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 11-writing-data.md in _episodes_rmd/\n" -"title: データの出力\n" -"講義: 10\n" -"練習: 10\n" -"質問:\n" -"- \"Rで作った図を保存するにはどうしますか?\"\n" -"目標:\n" -"- \"R から図やデータを 出力出来るようになりましょう。\"\n" -"要点:\n" -"- \"RStudio のエクスポートボタンを使って図を保存しましょう。\"\n" -"- \"`write.table` を使って表形式のデータを保存しましょう。\"\n" +"title: Writing Data\n" +"teaching: 10\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I save plots and data created in R?\"\n" +"objectives:\n" +"- \"To be able to write out plots and data from R.\"\n" +"keypoints:\n" +"- \"Save plots from RStudio using the 'Export' button.\"\n" +"- \"Use `write.table` to save tabular data.\"\n" "source: Rmd\n" "---" # header #: r-novice-gapminder/_episodes/11-writing-data.md:20 msgid "## Saving plots" -msgstr "## 図を保存する" +msgstr "## Saving plots" #: r-novice-gapminder/_episodes/11-writing-data.md:22 msgid "" "You have already seen how to save the most recent plot you create in `ggplot2`,\n" "using the command `ggsave`. As a refresher:" msgstr "" -"`ggsave` 関数を使って、`ggplot2` を用いて作った直近の図を保存する方法は既に学んだ通りです。\n" -"おさらいしておきましょう。" +"You have already seen how to save the most recent plot you create in `ggplot2`,\n" +"using the command `ggsave`. As a refresher:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:26 @@ -15521,8 +15521,9 @@ msgid "" "in the 'Plot' window. This will give you the option of saving as a\n" ".pdf or as .png, .jpg or other image formats." msgstr "" -"RStudio から図を保存するには \"Plot\" ウィンドウにある \"Export\" ボタンを使います。\n" -"この機能を使うと、図を .pdf や .png、.jpg など様々が画像形式を選ぶことができます。" +"You can save a plot from within RStudio using the 'Export' button\n" +"in the 'Plot' window. This will give you the option of saving as a\n" +".pdf or as .png, .jpg or other image formats." #: r-novice-gapminder/_episodes/11-writing-data.md:35 msgid "" @@ -15533,10 +15534,12 @@ msgid "" "each subset, and you want to save each plot, but obviously can't stop\n" "the loop to click 'Export' for each one." msgstr "" -"図を \"Plot\" ウィンドウに表示することなく保存したいこともあるでしょう。\n" -"ページごとに一つの図を含むような複数のページから成る PDF を出力したいこともあるでしょう。\n" -"あるいはループを使ってファイル中のデータの絞り込み条件を変えながら複数の図を作成していて、\n" -"一つずつ保存するためにいちいちループを止めて \"Export\" ボタンを押すことが不可能な場合もあるでしょう。" +"Sometimes you will want to save plots without creating them in the\n" +"'Plot' window first. Perhaps you want to make a pdf document with\n" +"multiple pages: each one a different plot, for example. Or perhaps\n" +"you're looping through multiple subsets of a file, plotting data from\n" +"each subset, and you want to save each plot, but obviously can't stop\n" +"the loop to click 'Export' for each one." #: r-novice-gapminder/_episodes/11-writing-data.md:42 msgid "" @@ -15544,9 +15547,9 @@ msgid "" "`pdf` creates a new pdf device. You can control the size and resolution\n" "using the arguments to this function." msgstr "" -"このような場合、より柔軟な方法を使います。\n" -"`pdf` 関数は新たに PDF デバイスを作ります。\n" -"この関数に引数を指定することで、サイズや解像度を調整できます。" +"In this case you can use a more flexible approach. The function\n" +"`pdf` creates a new pdf device. You can control the size and resolution\n" +"using the arguments to this function." # code block #: r-novice-gapminder/_episodes/11-writing-data.md:47 @@ -15568,14 +15571,14 @@ msgstr "" " geom_line() +\n" " theme(legend.position = \"none\")\n" "\n" -"# PDF デバイスを確実に終了しておく必要があります!\n" +"# You then have to make sure to turn off the pdf device!\n" "\n" "dev.off()\n" "~~~" #: r-novice-gapminder/_episodes/11-writing-data.md:59 msgid "Open up this document and have a look." -msgstr "このドキュメントを開いて内容を確認してみましょう。" +msgstr "Open up this document and have a look." #: r-novice-gapminder/_episodes/11-writing-data.md:62 msgid "" @@ -15598,8 +15601,10 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> `pdf` コマンドを書き直して、2ページ目に同じデータを `continent` ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" -"> > ## チャレンジ1の解答\n" +"> Rewrite your 'pdf' command to print a second\n" +"> page in the pdf, showing a facet plot (hint: use `facet_grid`)\n" +"> of the same data with one panel per continent.\n" +"> > ## Solution to challenge 1\n" "> >\n" "> > \n" "> > ~~~\n" @@ -15617,30 +15622,34 @@ msgstr "" msgid "" "The commands `jpeg`, `png` etc. are used similarly to produce\n" "documents in different formats." -msgstr "同様にして `jepg` や `png` などのコマンドを使うことで、他の形式のドキュメントを作成できます。" +msgstr "" +"The commands `jpeg`, `png` etc. are used similarly to produce\n" +"documents in different formats." # header #: r-novice-gapminder/_episodes/11-writing-data.md:86 msgid "## Writing data" -msgstr "## データを書き出す" +msgstr "## Writing data" #: r-novice-gapminder/_episodes/11-writing-data.md:88 msgid "At some point, you'll also want to write out data from R." -msgstr "R からデータを書き出したいこともあります。" +msgstr "At some point, you'll also want to write out data from R." #: r-novice-gapminder/_episodes/11-writing-data.md:90 msgid "" "We can use the `write.table` function for this, which is\n" "very similar to `read.table` from before." -msgstr "これには、既に使った `read.table` 関数とよく似た `write.table` 関数を使います。" +msgstr "" +"We can use the `write.table` function for this, which is\n" +"very similar to `read.table` from before." #: r-novice-gapminder/_episodes/11-writing-data.md:93 msgid "" "Let's create a data-cleaning script, for this analysis, we\n" "only want to focus on the gapminder data for Australia:" msgstr "" -"データを綺麗にするスクリプトを書きましょう。\n" -"今回の分析では、gapminder データの中のオーストラリアに該当する部分だけを使います。" +"Let's create a data-cleaning script, for this analysis, we\n" +"only want to focus on the gapminder data for Australia:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:97 @@ -15667,7 +15676,9 @@ msgstr "" msgid "" "Let's switch back to the shell to take a look at the data to make sure it looks\n" "OK:" -msgstr "シェルに戻ってデータが正しく出力されているか確認しましょう。" +msgstr "" +"Let's switch back to the shell to take a look at the data to make sure it looks\n" +"OK:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:111 @@ -15716,14 +15727,17 @@ msgid "" "quotation marks come from? Also the row numbers are\n" "meaningless." msgstr "" -"どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" -"また、行番号には意味がありません。" +"Hmm, that's not quite what we wanted. Where did all these\n" +"quotation marks come from? Also the row numbers are\n" +"meaningless." #: r-novice-gapminder/_episodes/11-writing-data.md:137 msgid "" "Let's look at the help file to work out how to change this\n" "behaviour." -msgstr "ヘルプファイルを見てこの動作を変更しましょう。" +msgstr "" +"Let's look at the help file to work out how to change this\n" +"behaviour." # code block #: r-novice-gapminder/_episodes/11-writing-data.md:141 @@ -15742,12 +15756,13 @@ msgid "" "when writing out to file. It will also write out the row and\n" "column names." msgstr "" -"既定では、R は文字列をファイルに出力する時に引用符で囲みます。\n" -"また、行と列の名前も出力します。" +"By default R will wrap character vectors with quotation marks\n" +"when writing out to file. It will also write out the row and\n" +"column names." #: r-novice-gapminder/_episodes/11-writing-data.md:150 msgid "Let's fix this:" -msgstr "以下のように修正しましょう。" +msgstr "Let's fix this:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:153 @@ -15770,7 +15785,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:162 msgid "Now lets look at the data again using our shell skills:" -msgstr "もう一度シェルを使ってデータを確認してみましょう。" +msgstr "Now lets look at the data again using our shell skills:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:173 @@ -15803,7 +15818,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:187 msgid "That looks better!" -msgstr "よくなりました!" +msgstr "That looks better!" #: r-novice-gapminder/_episodes/11-writing-data.md:190 msgid "" @@ -15826,10 +15841,12 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> gapminder データを1990年以降のデータのみに絞り込むスクリプトを書いて下さい。\n" +"> Write a data-cleaning script file that subsets the gapminder\n" +"> data to include only data points collected since 1990.\n" ">\n" -"> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに出力しましょう。\n" -"> > ## チャレンジ2の解答\n" +"> Use this script to write out the new subset to a file\n" +"> in the `cleaned-data/` directory.\n" +"> > ## Solution to challenge 2\n" "> >\n" "> > \n" "> > ~~~\n" @@ -21784,17 +21801,17 @@ msgstr "" # header #: r-novice-gapminder/reference.md:204 msgid "## [Writing data]({{ page.root }}/11-writing-data/)" -msgstr "## [データの出力]({{ page.root }}/11-writing-data/)" +msgstr "## [Writing data]({{ page.root }}/11-writing-data/)" # unordered list #: r-novice-gapminder/reference.md:206 msgid " - `write.table` to write out objects in regular format" -msgstr " - `write.table` を使ってオブジェクトを一般的な形式に出力しましょう。" +msgstr " - `write.table` to write out objects in regular format" # unordered list #: r-novice-gapminder/reference.md:207 msgid " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" -msgstr " - `quote=FALSE` を指定して文字列が引用符に囲われないようにしましょう。" +msgstr " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" # header #: r-novice-gapminder/reference.md:209 From 1a4fea798c892522b113bc485288a3abca536e9a Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:05 +0900 Subject: [PATCH 17/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 90a7126b..eb5dcbe6 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15577,8 +15577,7 @@ msgstr "" "~~~" #: r-novice-gapminder/_episodes/11-writing-data.md:59 -msgid "Open up this document and have a look." -msgstr "Open up this document and have a look." +msgstr "このドキュメントを開いて内容を確認してみましょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:62 msgid "" From 64bc8fe5219a072f04af3871b7d5539771717324 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:34 +0900 Subject: [PATCH 18/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index eb5dcbe6..70f46d81 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15726,9 +15726,14 @@ msgid "" "quotation marks come from? Also the row numbers are\n" "meaningless." msgstr "" +<<<<<<< HEAD "Hmm, that's not quite what we wanted. Where did all these\n" "quotation marks come from? Also the row numbers are\n" "meaningless." +======= +"どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" +"また、行番号には意味がありません。" +>>>>>>> 8a5df49... Update po/r-novice-gapminder.ja.po #: r-novice-gapminder/_episodes/11-writing-data.md:137 msgid "" From cd3658abe8649eef7fb2e706db8571ec2c7614a0 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:46 +0900 Subject: [PATCH 19/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 70f46d81..86ce23d2 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15726,22 +15726,15 @@ msgid "" "quotation marks come from? Also the row numbers are\n" "meaningless." msgstr "" -<<<<<<< HEAD -"Hmm, that's not quite what we wanted. Where did all these\n" -"quotation marks come from? Also the row numbers are\n" -"meaningless." -======= "どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" "また、行番号には意味がありません。" ->>>>>>> 8a5df49... Update po/r-novice-gapminder.ja.po #: r-novice-gapminder/_episodes/11-writing-data.md:137 msgid "" "Let's look at the help file to work out how to change this\n" "behaviour." msgstr "" -"Let's look at the help file to work out how to change this\n" -"behaviour." +msgstr "ヘルプファイルを見てこの動作を変更しましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:141 From 0e3575b89f528293784b05359cb9e4af45fcec57 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:11:55 +0900 Subject: [PATCH 20/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 86ce23d2..531804f5 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15782,7 +15782,8 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:162 msgid "Now lets look at the data again using our shell skills:" -msgstr "Now lets look at the data again using our shell skills:" +msgstr "もう一度シェルを使ってデータを確認してみましょう。" +>>>>>>> feb4e7f... Update po/r-novice-gapminder.ja.po # code block #: r-novice-gapminder/_episodes/11-writing-data.md:173 From 98d0a4bfbe5f8fa126fd3f049c0b263868e08ced Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:12:27 +0900 Subject: [PATCH 21/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 531804f5..7e1c0253 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15842,9 +15842,8 @@ msgstr "" "> Write a data-cleaning script file that subsets the gapminder\n" "> data to include only data points collected since 1990.\n" ">\n" -"> Use this script to write out the new subset to a file\n" -"> in the `cleaned-data/` directory.\n" -"> > ## Solution to challenge 2\n" +"> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに出力しましょう。\n" +"> > ## チャレンジ2の解答\n" "> >\n" "> > \n" "> > ~~~\n" From 1767136a54a652eed7698d472b83f4ff1db2eed8 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:12:58 +0900 Subject: [PATCH 22/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 7e1c0253..79ee0a2c 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15534,12 +15534,10 @@ msgid "" "each subset, and you want to save each plot, but obviously can't stop\n" "the loop to click 'Export' for each one." msgstr "" -"Sometimes you will want to save plots without creating them in the\n" -"'Plot' window first. Perhaps you want to make a pdf document with\n" -"multiple pages: each one a different plot, for example. Or perhaps\n" -"you're looping through multiple subsets of a file, plotting data from\n" -"each subset, and you want to save each plot, but obviously can't stop\n" -"the loop to click 'Export' for each one." +"図を \"Plot\" ウィンドウに表示することなく保存したいこともあるでしょう。\n" +"ページごとに一つの図を含むような複数のページから成る PDF を出力したいこともあるでしょう。\n" +"あるいはループを使ってファイル中のデータの絞り込み条件を変えながら複数の図を作成していて、\n" +"一つずつ保存するためにいちいちループを止めて \"Export\" ボタンを押すことが不可能な場合もあるでしょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:42 msgid "" From c0d499c42ef34b6d5b8bda8059859dbe101a0df9 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:13:09 +0900 Subject: [PATCH 23/59] Update po/r-novice-gapminder.ja.po Co-Authored-By: masamiy --- po/r-novice-gapminder.ja.po | 2 ++ 1 file changed, 2 insertions(+) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 79ee0a2c..3a98607b 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15602,6 +15602,8 @@ msgstr "" "> page in the pdf, showing a facet plot (hint: use `facet_grid`)\n" "> of the same data with one panel per continent.\n" "> > ## Solution to challenge 1\n" +"> `pdf` コマンドを書き直して、2ページ目に同じデータを `continent` ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" +"> > ## チャレンジ1の解答\n" "> >\n" "> > \n" "> > ~~~\n" From 7e56a535b20ea2b868c404c64657ada95509ad88 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Thu, 26 Mar 2020 17:37:28 +0900 Subject: [PATCH 24/59] revert changes to restore PR https://github.com/swcarpentry-ja/i18n/pull/50 with proposed changes in review --- po/r-novice-gapminder.ja.po | 98 ++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 3a98607b..3b9420bd 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15478,31 +15478,31 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 11-writing-data.md in _episodes_rmd/\n" -"title: Writing Data\n" -"teaching: 10\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I save plots and data created in R?\"\n" -"objectives:\n" -"- \"To be able to write out plots and data from R.\"\n" -"keypoints:\n" -"- \"Save plots from RStudio using the 'Export' button.\"\n" -"- \"Use `write.table` to save tabular data.\"\n" +"title: データの出力\n" +"講義: 10\n" +"練習: 10\n" +"質問:\n" +"- \"Rで作った図を保存するにはどうしますか?\"\n" +"目標:\n" +"- \"R から図やデータを 出力出来るようになりましょう。\"\n" +"要点:\n" +"- \"RStudio のエクスポートボタンを使って図を保存しましょう。\"\n" +"- \"`write.table` を使って表形式のデータを保存しましょう。\"\n" "source: Rmd\n" "---" # header #: r-novice-gapminder/_episodes/11-writing-data.md:20 msgid "## Saving plots" -msgstr "## Saving plots" +msgstr "## 図を保存する" #: r-novice-gapminder/_episodes/11-writing-data.md:22 msgid "" "You have already seen how to save the most recent plot you create in `ggplot2`,\n" "using the command `ggsave`. As a refresher:" msgstr "" -"You have already seen how to save the most recent plot you create in `ggplot2`,\n" -"using the command `ggsave`. As a refresher:" +"`ggsave` 関数を使って、`ggplot2` を用いて作った直近の図を保存する方法は既に学んだ通りです。\n" +"おさらいしておきましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:26 @@ -15521,9 +15521,8 @@ msgid "" "in the 'Plot' window. This will give you the option of saving as a\n" ".pdf or as .png, .jpg or other image formats." msgstr "" -"You can save a plot from within RStudio using the 'Export' button\n" -"in the 'Plot' window. This will give you the option of saving as a\n" -".pdf or as .png, .jpg or other image formats." +"RStudio から図を保存するには \"Plot\" ウィンドウにある \"Export\" ボタンを使います。\n" +"この機能を使うと、図を .pdf や .png、.jpg など様々な画像形式で保存することができます。 #: r-novice-gapminder/_episodes/11-writing-data.md:35 msgid "" @@ -15545,9 +15544,9 @@ msgid "" "`pdf` creates a new pdf device. You can control the size and resolution\n" "using the arguments to this function." msgstr "" -"In this case you can use a more flexible approach. The function\n" -"`pdf` creates a new pdf device. You can control the size and resolution\n" -"using the arguments to this function." +"このような場合、より柔軟な方法を使います。\n" +"`pdf` 関数は新たに PDF デバイスを作ります。\n" +"この関数に引数を指定することで、サイズや解像度を調整できます。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:47 @@ -15569,12 +15568,13 @@ msgstr "" " geom_line() +\n" " theme(legend.position = \"none\")\n" "\n" -"# You then have to make sure to turn off the pdf device!\n" +"# PDF デバイスを確実に終了しておく必要があります!\n" "\n" "dev.off()\n" "~~~" #: r-novice-gapminder/_episodes/11-writing-data.md:59 +msgid "Open up this document and have a look." msgstr "このドキュメントを開いて内容を確認してみましょう。" #: r-novice-gapminder/_episodes/11-writing-data.md:62 @@ -15598,9 +15598,9 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Rewrite your 'pdf' command to print a second\n" -"> page in the pdf, showing a facet plot (hint: use `facet_grid`)\n" -"> of the same data with one panel per continent.\n" + +"> `pdf` コマンドを書き直して、2ページ目に同じデータを `continent` ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" +"> > ## チャレンジ1の解答\n" "> > ## Solution to challenge 1\n" "> `pdf` コマンドを書き直して、2ページ目に同じデータを `continent` ごとにファセットした図を出力してみましょう (ヒント: `facet_grid` を使います)。\n" "> > ## チャレンジ1の解答\n" @@ -15622,36 +15622,40 @@ msgid "" "The commands `jpeg`, `png` etc. are used similarly to produce\n" "documents in different formats." msgstr "" -"The commands `jpeg`, `png` etc. are used similarly to produce\n" -"documents in different formats." +"同様にして `jepg` や `png` などのコマンドを使うことで、他の形式のドキュメントを作成できます。" # header #: r-novice-gapminder/_episodes/11-writing-data.md:86 msgid "## Writing data" -msgstr "## Writing data" +msgstr "## データの出力" #: r-novice-gapminder/_episodes/11-writing-data.md:88 msgid "At some point, you'll also want to write out data from R." -msgstr "At some point, you'll also want to write out data from R." +msgstr "R からデータを出力したいこともあります。" #: r-novice-gapminder/_episodes/11-writing-data.md:90 msgid "" "We can use the `write.table` function for this, which is\n" "very similar to `read.table` from before." msgstr "" -"We can use the `write.table` function for this, which is\n" -"very similar to `read.table` from before." +"これには、既に使った `read.table` 関数とよく似た `write.table` 関数を使います。" #: r-novice-gapminder/_episodes/11-writing-data.md:93 msgid "" "Let's create a data-cleaning script, for this analysis, we\n" "only want to focus on the gapminder data for Australia:" msgstr "" -"Let's create a data-cleaning script, for this analysis, we\n" -"only want to focus on the gapminder data for Australia:" +"データを綺麗にするスクリプトを書きましょう。\n" +"今回の分析では、gapminder データの中のオーストラリアに該当する部分だけを使います。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:97 +"Let's switch back to the shell to take a look at the data to make sure it looks\n" +"OK:" +msgstr "" +"シェルに戻ってデータが正しく出力されているか確認しましょう。" +"OK:" + msgid "" "~~~\n" "aust_subset <- gapminder[gapminder$country == \"Australia\",]\n" @@ -15676,11 +15680,20 @@ msgid "" "Let's switch back to the shell to take a look at the data to make sure it looks\n" "OK:" msgstr "" -"Let's switch back to the shell to take a look at the data to make sure it looks\n" +"シェルに戻ってデータが正しく出力されているか確認しましょう" "OK:" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:111 +msid "" +"Hmm, that's not quite what we wanted. Where did all these\n" +"quotation marks come from? Also the row numbers are\n" +"meaningless." +msgstr "" +"どうやら望んだ通りに出力されていません。引用符はどこから来たのでしょうか。\n" +"また、行番号には意味がありません。" + + #: r-novice-gapminder/_episodes/11-writing-data.md:165 msgid "" "~~~\n" @@ -15753,13 +15766,12 @@ msgid "" "when writing out to file. It will also write out the row and\n" "column names." msgstr "" -"By default R will wrap character vectors with quotation marks\n" -"when writing out to file. It will also write out the row and\n" -"column names." +"既定では、R は文字列をファイルに出力する時に引用符で囲みます。\n" +"また、行と列の名前も出力します。" #: r-novice-gapminder/_episodes/11-writing-data.md:150 msgid "Let's fix this:" -msgstr "Let's fix this:" +msgstr "以下のように修正しましょう。" # code block #: r-novice-gapminder/_episodes/11-writing-data.md:153 @@ -15783,7 +15795,6 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:162 msgid "Now lets look at the data again using our shell skills:" msgstr "もう一度シェルを使ってデータを確認してみましょう。" ->>>>>>> feb4e7f... Update po/r-novice-gapminder.ja.po # code block #: r-novice-gapminder/_episodes/11-writing-data.md:173 @@ -15816,7 +15827,7 @@ msgstr "" #: r-novice-gapminder/_episodes/11-writing-data.md:187 msgid "That looks better!" -msgstr "That looks better!" +msgstr "よくなりました!" #: r-novice-gapminder/_episodes/11-writing-data.md:190 msgid "" @@ -15839,8 +15850,7 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Write a data-cleaning script file that subsets the gapminder\n" -"> data to include only data points collected since 1990.\n" +"> gapminder データを1990年以降のデータのみに絞り込むスクリプトを書いて下さい。\n" ">\n" "> このスクリプトを使って絞り込んだ結果を `cleaned-data/` ディレクトリ中のファイルに出力しましょう。\n" "> > ## チャレンジ2の解答\n" @@ -21798,17 +21808,17 @@ msgstr "" # header #: r-novice-gapminder/reference.md:204 msgid "## [Writing data]({{ page.root }}/11-writing-data/)" -msgstr "## [Writing data]({{ page.root }}/11-writing-data/)" +msgstr "## [データの出力]({{ page.root }}/11-writing-data/)" # unordered list #: r-novice-gapminder/reference.md:206 msgid " - `write.table` to write out objects in regular format" -msgstr " - `write.table` to write out objects in regular format" - +msgstr " - `write.table` を使ってオブジェクトを一般的な形式に出力しましょう。" +/ # unordered list #: r-novice-gapminder/reference.md:207 msgid " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" -msgstr " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" +msgstr " - `quote=FALSE` を指定して文字列が引用符に囲われないようにしましょう。" # header #: r-novice-gapminder/reference.md:209 From 58cf06359d2c052316b45b69093d9d20be546438 Mon Sep 17 00:00:00 2001 From: rikutakei Date: Sat, 28 Mar 2020 23:53:42 +1300 Subject: [PATCH 25/59] Review for r-novice-gapminder: episode 6 --- po/r-novice-gapminder.ja.po | 93 +++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 90a7126b..8c33330a 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -8402,20 +8402,20 @@ msgid "" "R has many powerful subset operators. Mastering them will allow you to\n" "easily perform complex operations on any kind of dataset." msgstr "" -"Rには、かなり使える部分集合の演算子があります。もし、それをマスターできたら、\n" -"どんなデータセットにも複雑な演算を簡単にすることができます。" +"Rには便利な部分集合の演算子が多く含まれています。これらをマスターできれば、\n" +"どんなデータセットにも複雑な演算を楽に行えます。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:27 msgid "" "There are six different ways we can subset any kind of object, and three\n" "different subsetting operators for the different data structures." msgstr "" -"There are six different ways we can subset any kind of object, and three\n" -"different subsetting operators for the different data structures." +"オブジェクトを部分集合する方法は6つあり、データ構造を\n" +"部分集合する方法は3つあります。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:30 msgid "Let's start with the workhorse of R: a simple numeric vector." -msgstr "Rの働き頭から始めましょう:簡単な数値ベクトル" +msgstr "Rの働き頭、数値ベクトルから始めましょう。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:33 @@ -8462,7 +8462,7 @@ msgstr "" msgid "" "So now that we've created a dummy vector to play with, how do we get at its\n" "contents?" -msgstr "ちょっと触ってみるためのダミーベクトルを作ることができたのですが、どうやってベクトルの中身を使うのでしょう?" +msgstr "練習用のベクトルを作ることができたのですが、どうやってベクトルの中身を使うのでしょう?" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:56 @@ -8529,7 +8529,7 @@ msgid "" "It may look different, but the square brackets operator is a function. For vectors\n" "(and matrices), it means \"get me the nth element\"." msgstr "" -"違うふうに見えるかもしれませんが、各括弧の演算子は、関数なのです。ベクトル(及び行列)の場合は、\n" +"違うふうに見えるかもしれませんが、各括弧の演算子は関数です。ベクトル(及び行列)の場合は、\n" "「n番目の要素をちょうだい」ということを意味しています。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:92 @@ -8591,7 +8591,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:124 msgid "the `:` operator creates a sequence of numbers from the left element to the right." -msgstr "この演算子 `:` は、左から右の要素の一連番号を作ります。" +msgstr "この `:` 演算子は、左から右の要素の一連番号を作ります。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:126 @@ -8657,7 +8657,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:169 msgid "If we ask for an index beyond the length of the vector, R will return a missing value:" -msgstr "もしベクトルの長さ以上の要素番号を頼んだ場合、Rは、欠測値を返します:" +msgstr "もしベクトルの長さ以上の要素番号を頼んだ場合、Rは欠測値を返します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:171 @@ -8726,7 +8726,7 @@ msgid "" msgstr "" ">\n" "> 多くのプログラミング言語(例えば、C、Python)では、ベクトルの最初の\n" -"> 要素の要素番号は0です。Rでは、最初の要素番号は1なのです。" +"> 要素の要素番号は0です。Rでは、最初の要素番号は1です。" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:207 @@ -8819,8 +8819,8 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> 初心者のよくある失敗は、ベクトルのスライスを飛ばしてしまうことです。\n" -"> 数列に負の符号を付けようとするとき、次のようにすることはありがちです:\n" +"> 初心者によく見られるのが、ベクトルのスライスを飛ばそうとする時に起こる間違いです。\n" +"> 数列をベクトルから削除しようとする場合、次のようにして削除しようとします:\n" ">\n" "> \n" "> ~~~\n" @@ -8828,7 +8828,7 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> This gives a somewhat cryptic error:\n" +"> すると、なんだか複雑なエラーが返ってきます:\n" ">\n" "> \n" "> ~~~\n" @@ -8864,8 +8864,8 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> でも、演算の順番を思い出してみて下さい。`:` は、実際には、関数なのです。\n" -"> 最初の引数を-1、次のを3として認識し、次のような数列を生成します。\n" +"> 演算の順番を思い出してみましょう。`:` は、実際には関数なのです。\n" +"> 最初の引数を-1、次の引数を3として認識し、次のような数列を生成します。\n" "> `c(-1, 0, 1, 2, 3)`\n" ">\n" "> 正解は、関数を呼ぶ部分を括弧で囲むことです。\n" @@ -8967,7 +8967,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> 以下のアウトプットを得るために、少なくとも2つの異なるコマンドを考えてください:\n" +"> 以下の出力を得るために、少なくとも2つの異なるコマンドを考えてください:\n" ">\n" "> \n" "> ~~~\n" @@ -9097,9 +9097,9 @@ msgid "" "position of various elements can often change when chaining together\n" "subsetting operations, but the names will always remain the same!" msgstr "" -"オブジェクトの部分集合を作るには、この方法の方が確実なやり方です:要素の場所は、\n" -"部分集合の演算子を繋いで使うことでよく変わるのですが。\n" -"名前は変わらないのです!" +"オブジェクトの部分集合を作るには、この方法の方が確実です:要素の場所は、\n" +"部分集合の演算子を繋いで使うことでよく変わるのですが、\n" +"名前は絶対に変わりません。" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:402 @@ -9141,7 +9141,8 @@ msgid "" "use them to succinctly subset vectors: the following statement gives\n" "the same result as the previous one." msgstr "" -"比較演算子(例えば、 `>`、`<`、 `==`)は、その結果が論理ベクトルになるので、簡潔にベクトルの部分集合を作ることができます。\n" +"比較演算子(例えば、 `>`、`<`、 `==`)は、その結果が論理ベクトルになるので、\n" +"簡潔にベクトルの部分集合を作ることができます。\n" "つまり、以下の宣言は、前と同じ結果を返します。" # code block @@ -9161,9 +9162,9 @@ msgid "" "a logical vector `c(FALSE, FALSE, TRUE, FALSE, TRUE)`, and then\n" "selects the elements of `x` corresponding to the `TRUE` values." msgstr "" -"分割すると、この宣言は、最初に `x>7` を計算し、論理ベクトル\n" +"分割すると、この宣言は最初に `x>7` を計算し、論理ベクトル\n" "`c(FALSE, FALSE, TRUE, FALSE, TRUE)` を作ります。それから、\n" -"`TRUE` の値に対応する `x` 要素を選択します。" +"`TRUE` の値に対応する要素を `x` から選択しています。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:442 msgid "" @@ -9220,7 +9221,7 @@ msgid "" msgstr "" ">\n" "> 複数の論理基準を組み合わせたい場合はよくあります。\n" -"> 例えば、アジア**または** ヨーロッパに位置し、なお**かつ** ある一定の範囲の平均余命\n" +"> 例えば、アジア**または** ヨーロッパに位置し、**なおかつ** ある一定の範囲の平均余命\n" "> の国を見つけたいとします。\n" "> Rにが論理ベクトルを複数組み合わせる演算子があります:\n" ">\n" @@ -9229,7 +9230,7 @@ msgstr "" ">\n" "> `&` 及び `|` の代わりに、 `&&` 及び `||` を見かけることもあるでしょう。\n" "> この二重になっている演算子は、それぞれのベクトルの最初の要素だけを見て、残りを無視するものです。\n" -"> 一般的に、この二重になっている演算子は、データ分析では使わずに、\n" +"> 一般的に、この二重になっている演算子はデータ分析では使わずに、\n" "> プログラミングの際に(つまり、ある宣言を実行するかどうかを決める際に)\n" "> 使うことをおすすめします。\n" ">\n" @@ -9313,7 +9314,7 @@ msgstr "" ">\n" "> ベクトルの中の要素に、同じ名前を持つものがあるかもしれないということを知っておく必要があります。\n" "> (データフレームでは、--- Rは避けようとしますが --- 列に同じ名前を付けることもできます。\n" -"> 一方で、行の名前は、全て違う必要があります)\n" +"> 一方で、行の名前は全て違う必要があります)\n" "> これらの例を考えてみましょう:\n" ">\n" ">\n" @@ -9392,7 +9393,7 @@ msgstr "" ">\n" ">\n" ">~~~\n" -"> x['a'] # only returns first value\n" +"> x['a'] # 最初の値しか返さない\n" ">~~~\n" ">{: .language-r}\n" ">\n" @@ -9470,7 +9471,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # まず、ベクトルにその場で名前を付けることから、また始めます\n" +"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # まず、ベクトルにその場で名前を付けることから始めます\n" "x[-\"a\"]\n" "~~~" @@ -9589,8 +9590,8 @@ msgid "" "of the left argument with the corresponding element of its right\n" "argument. What happens when you compare vectors of different lengths?" msgstr "" -"Rは、`names(x)[3] != \"c\"` が明らかに間違いであるときに、このベクトルの3番目の要素として、なぜ`TRUE` にしたのでしょうか。\n" -"`!=` を使うとき、Rは、左側の引数のそれぞれの要素を、右側のそれぞれの要素と比較しようとします。\n" +"Rは、`names(x)[3] != \"c\"` が明らかに間違いであるときに、このベクトルの3番目の要素をなぜ`TRUE` にしたのでしょうか。\n" +"`!=` を使うとき、Rは左側の引数のそれぞれの要素を右側のそれぞれの要素と比較しようとします。\n" "違う長さのベクトルを比較しようとすると、何が起こるのでしょう?" #: r-novice-gapminder/_episodes/06-data-subsetting.md:697 @@ -9617,7 +9618,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:707 msgid "The way to get R to do what we really want (match *each* element of the left argument with *all* of the elements of the right argument) it to use the `%in%` operator. The `%in%` operator goes through each element of its left argument, in this case the names of `x`, and asks, \"Does this element occur in the second argument?\". Here, since we want to *exclude* values, we also need a `!` operator to change \"in\" to \"not in\":" -msgstr "Rに本当にやってもらいたいこと(左の引数の *それぞれの* 要素を、右の引数の要素の *全て* にマッチさせこと)をしてもらうには、 `%in%` 演算子を使う必要があります。`%in%` 演算子は、左の引数のそれぞれの要素、ここでは `x` の名前にひとつづつ 「この要素は、2番目の引数にあるかな」と尋ねていきます。ここで、値を *除く* ため、「中にある(in)」を「中にない(not in)」に変える `!` 演算子が必要です。" +msgstr "Rに本当にやってもらいたいこと(左の引数の *それぞれの* 要素を、右の引数の要素の *全て* にマッチさせること)をしてもらうには、 `%in%` 演算子を使う必要があります。`%in%` 演算子は、左の引数のそれぞれの要素、ここでは `x` の名前にひとつずつ 「この要素は、2番目の引数にあるかな」と尋ねていきます。ここで、値を *除く* ため、「中にある(in)」を「中にない(not in)」に変える `!` 演算子が必要です。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:710 @@ -9753,7 +9754,7 @@ msgstr "データをフィルターするために使える特別な関数がい # unordered list #: r-novice-gapminder/_episodes/06-data-subsetting.md:778 msgid " * `is.na` will return all positions in a vector, matrix, or data.frame" -msgstr " * `is.na` は、ベクトル、行列、データフレームで、 全ての`NA` (または `NaN` )を含む位置を返します" +msgstr " * `is.na` は、ベクトル、行列、データフレームで、" #: r-novice-gapminder/_episodes/06-data-subsetting.md:779 msgid "" @@ -9763,8 +9764,10 @@ msgid "" " that do not contain `NA`, `NaN` or `Inf`.\n" " * `na.omit` will filter out all missing values from a vector" msgstr "" +" 全ての`NA` (または `NaN` )を含む位置を返します\n" " * これと同じことを `NaN` 及び `Inf` にするのが `is.nan` 及び `is.infinite` です\n" -" * `is.finite` は、ベクトル、行列、データフレームで、 全ての`NA`, `NaN` または `Inf`を含まない位置を返します\n" +" * `is.finite` は、ベクトル、行列、データフレームで、\n" +" 全ての`NA`, `NaN` または `Inf`を含まない位置を返します\n" " * `na.omit` は、ベクトルから欠損値をフィルターし、除きます" # header @@ -9776,7 +9779,9 @@ msgstr "## 順序のない因子の部分集合を作る" msgid "" "Now that we've explored the different ways to subset vectors, how\n" "do we subset the other data structures?" -msgstr "これまで部分集合ベクトルを作る色々な方法をやってみましたが、他のデータ構造の部分集合を作るにはどうすればいいでしょう。" +msgstr "" +"これまで部分集合ベクトルを作る色々な方法をやってみましたが、\n" +"他のデータ構造の部分集合を作るにはどうすればいいでしょう。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:790 msgid "Factor subsetting works the same way as vector subsetting." @@ -9934,7 +9939,7 @@ msgstr "" msgid "" "You can leave the first or second arguments blank to retrieve all the\n" "rows or columns respectively:" -msgstr "それぞれ全ての列または行を取ってくるために、この最初または2番目の引数を空のままにしておくこともできます:" +msgstr "それぞれ全ての列または行を取ってくるためには、最初または2番目の引数を空のままにしておきましょう:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:881 @@ -9974,7 +9979,7 @@ msgstr "" msgid "" "If we only access one row or column, R will automatically convert the result\n" "to a vector:" -msgstr "1つの列または行にアクセスした場合、Rは、結果を自動的にベクトルに変換します:" +msgstr "1つの列または行にアクセスした場合、Rは結果を自動的にベクトルに変換します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:903 @@ -10034,7 +10039,7 @@ msgstr "" msgid "" "Unlike vectors, if we try to access a row or column outside of the matrix,\n" "R will throw an error:" -msgstr "ベクトルと違って、行列の外の行や列にアクセスしようとしたとき、Rはエラーを返します:" +msgstr "ベクトルと違って、行列の外の行や列にアクセスしようとすると、Rはエラーを返します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:936 @@ -10080,7 +10085,7 @@ msgstr "" msgid "" "Because matrices are vectors, we can\n" "also subset using only one argument:" -msgstr "行列は、ベクトルなので、1つの引数だけを使って部分集合を作ることもできます:" +msgstr "行列はベクトルなので、1つの引数だけを使って部分集合を作ることもできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:960 @@ -10141,7 +10146,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:992 msgid "If you wish to populate the matrix by row, use `byrow=TRUE`:" -msgstr "もし、行列を、行の順番で埋めていきたい場合は、 `byrow=TRUE` を使います:" +msgstr "もし、行列を行の順番で埋めていきたい場合は、 `byrow=TRUE` を使います:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:995 @@ -10197,7 +10202,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> 以下のコードがあるとしましょう:\n" +"> 以下のコードがあるとします:\n" ">\n" "> \n" "> ~~~\n" @@ -10257,7 +10262,7 @@ msgid "" "Now we'll introduce some new subsetting operators. There are three functions\n" "used to subset lists. We've already seen these when learning about atomic vectors and matrices: `[`, `[[`, and `$`." msgstr "" -"ここで新しい部分集合を作る演算子を御紹介しましょう。リストの部分集合を作る関数は3つあります。\n" +"ここで新しい部分集合を作る演算子を紹介します。リストの部分集合を作る関数は3つあります。\n" "原子ベクトルと行列について学んだ時に、既に見たものです: `[` 、 `[[` 、`$`" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1055 @@ -10306,7 +10311,7 @@ msgid "" "in each element of the list, not the individual elements within those\n" "data structures." msgstr "" -"`[` を使い原子ベクトルを作ったのと全く同じ方法で、リストの要素から部分集合を作ることができます。\n" +"`[` を使って原子ベクトルを作ったのと全く同じ方法で、リストの要素から部分集合を作ることができます。\n" "しかし、比較処理は反復的ではないため、使えません。比較処理は、リストのそれぞれの要素のデータ構造にある、個々の要素ではなく、\n" "データ構造に条件付けをしようとするからです。" @@ -10481,7 +10486,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:1183 msgid "> Given the following list:" -msgstr "> 以下のリストがあるとしましょう:" +msgstr "> 以下のリストがあるとします:" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1184 msgid "" @@ -10586,7 +10591,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:1237 msgid "> Given a linear model:" -msgstr "> 線形モデルを考えてみましょう:" +msgstr "> 以下のような線形モデルあるとします:" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1238 msgid "" @@ -10644,7 +10649,7 @@ msgid "" "Remember the data frames are lists underneath the hood, so similar rules\n" "apply. However they are also two dimensional objects:" msgstr "" -"データフレームの中身は実はリストなので、同じようなルールがあてはまることを覚えておきましょう。\n" +"データフレームの中身は実はリストなので、リストと同じようなルールがあてはまることを覚えておきましょう。\n" "しかし、データフレームは2次元のオブジェクトでもあります。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1268 From e0dae76d94f7962078a6c292763e0b787a635a6e Mon Sep 17 00:00:00 2001 From: rikutakei Date: Sat, 4 Apr 2020 22:02:50 +1300 Subject: [PATCH 26/59] Review for r-novice-gapminder: episode 7 --- po/r-novice-gapminder.ja.po | 113 +++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 90a7126b..55e3f7a0 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -11100,7 +11100,7 @@ msgid "" "Alternatively, we can also set an action to occur a particular number of times." msgstr "" "コードを書く際、実行の流れを制御する必要がよくあります。\n" -"これは、ある条件、または一連の条件が満たされたときに、実行されるようにすればできます。\n" +"これは、ある条件、または一連の条件が満たされたときに実行されるようにすればできます。\n" "あるいは、決まった回数実行されるよう設定することもできます。" #: r-novice-gapminder/_episodes/07-control-flow.md:25 @@ -11109,7 +11109,7 @@ msgid "" "For conditional statements, the most commonly used approaches are the constructs:" msgstr "" "Rでは、流れを制御する方法がいくつかあります。\n" -"条件付きの宣言で、最もよく使われるのが「構文(constructs)」です:" +"条件付きの宣言で、最もよく使われるのが構文(constructs)です:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:29 @@ -11135,10 +11135,10 @@ msgstr "" "}\n" "\n" "# if ... else\n" -"if (condition is true) {\n" -" perform action\n" -"} else { # that is, if the condition is false,\n" -" perform alternative action\n" +"if (condition is true) { # 条件が満たされた場合\n" +" アクションを行う\n" +"} else { # つまり、条件が満たされなかった場合\n" +" 別のアクションを行う\n" "}\n" "~~~" @@ -11182,7 +11182,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:65 msgid "The print statement does not appear in the console because x is not greater than 10. To print a different message for numbers less than 10, we can add an `else` statement." -msgstr "xは、10より大きくないため、表示された宣言はコンソール上に表示されません。10より小さい場合に違ったメッセージを表示させるためには、 `else` 宣言を追加しなければなりません。" +msgstr "xは10より大きくないため、表示された宣言はコンソール上に表示されません。10より小さい場合に違ったメッセージを表示させるためには、 `else` 宣言を追加しなければなりません。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:68 @@ -11266,7 +11266,7 @@ msgid "" "looking for a logical element, i.e., `TRUE` or `FALSE`. This can cause some\n" "headaches for beginners. For example:" msgstr "" -"**重要:** Rが `if()` 宣言の中の条件を計算する際、論理要素( `TRUE` or `FALSE` )を探します。\n" +"**重要:** Rが `if()` 宣言の中の条件を計算する際、論理要素( `TRUE` か `FALSE` )を探します。\n" "初心者には複雑なので、混乱してしまうかもしれません。例えば:" # code block @@ -11303,7 +11303,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:131 msgid "As we can see, the not equal message was printed because the vector x is `FALSE`" -msgstr "ここで見たように、ベクトルxが `FALSE` であるので、不等号のメッセージが表示されたのです。" +msgstr "ここで見られるように、ベクトル x が `FALSE` であるため、不等号のメッセージが表示されました。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:134 @@ -11444,7 +11444,7 @@ msgid "" "element. Here you need to make sure your condition is of length 1." msgstr "" "もし、1つ以上の要素を持つベクトルを評価する条件の場合、\n" -"関数 `if()` は走るのですが、最初の要素の条件しか評価しません。\n" +"関数 `if()` は実行されるのですが、最初の要素の条件しか評価しません。\n" "ここでは、確実に条件の長さは1であるようにする必要があります。" # blockquote, which can be cascaded @@ -11462,7 +11462,7 @@ msgid "" "> the vector are `TRUE`." msgstr "" ">\n" -"> `any()` 関数は、少なくとも1つ `TRUE` の値がある場合、 `TRUE` を返し、\n" +"> `any()` 関数は、ベクトルの中に少なくとも1つ `TRUE` の値がある場合、 `TRUE` を返し、\n" "> そうでない場合は、 `FALSE` を返します。\n" "> これは、 `%in%` 演算子でも同様に使えます。\n" "> 関数 `all()` は、その名前が示唆しているように、ベクトル内の全ての値が `TRUE` である時のみ、\n" @@ -11488,8 +11488,8 @@ msgstr "" " `for()` ループを使いましょう。\n" " `for()` ループは、先ほどシェルのレッスンで見ましたね。これは、最も柔軟な\n" "ループの演算子ですが、それゆえ、正しく使うのが最も難しいです。\n" -"繰り返す順番が重要(つまり直前の繰り返しの結果をもとに、次々と\n" -"繰り返しの演算行われる形)でない限り、 `for()` ループを使うのを避けましょう。" +"繰り返す順番が重要(つまり直前の繰り返しの結果をもとに、次\n" +"の演算を行う場合)でない限り、 `for()` ループを使うのを避けましょう。" #: r-novice-gapminder/_episodes/07-control-flow.md:228 msgid "The basic structure of a `for()` loop is:" @@ -11512,7 +11512,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:238 msgid "For example:" -msgstr "例:" +msgstr "例えば:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:241 @@ -11562,13 +11562,17 @@ msgstr "" msgid "" "The `1:10` bit creates a vector on the fly; you can iterate\n" "over any other vector as well." -msgstr " `1:10` の部分は、ベクトルをその場で作るもので、他のベクトルの間中、繰り返すこともできます。" +msgstr "" +"`1:10` の部分は、ベクトルをその場で作るものです。\n" +"他のベクトルの中身を繰り返すこともできます。" #: r-novice-gapminder/_episodes/07-control-flow.md:267 msgid "" "We can use a `for()` loop nested within another `for()` loop to iterate over two things at\n" "once." -msgstr " `for()` ループを、もうひとつの `for()` ループと入れ子となる形にすれば、2つのことを同時に繰り返すこともできます。" +msgstr "" +"`for()` ループを、もうひとつの `for()` ループと入れ子となる形にすれば、\n" +"2つ同時に繰り返すこともできます。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:271 @@ -11650,7 +11654,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:311 msgid "Rather than printing the results, we could write the loop output to a new object." -msgstr "結果を表示させずに、ループの結果を新しいオブジェクトとして書くこともできます。" +msgstr "結果を表示させずに、ループの結果を新しいオブジェクトに書き込むこともできます。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:314 @@ -11699,7 +11703,7 @@ msgid "" "it when you are iterating through a lot of values." msgstr "" "このアプローチが役に立つこともありますが、'結果を太らせる' (結果のオブジェクトを\n" -"段々積み上げる)と、演算する上で非効率になります。\n" +"徐々に積み上げる)と、演算する上で非効率になります。\n" "ゆえに、多くの値の間を繰り返すときは避けましょう。" # blockquote, which can be cascaded @@ -11721,15 +11725,15 @@ msgid "" "> store the results in the appropriate location." msgstr "" ">\n" -"> 初心者と経験のあるRユーザーの両方の足を引っ張るループの使い方の一つとして、\n" -"> 結果のオブジェクト(ベクトル、リスト、行列、データフレーム)をループするたびに作ってしまうという\n" -"> ことがあります。\n" +"> 初心者、そして経験のあるRユーザーがよくつまずいてしまう\n" +"> ループの使い方の一つが、結果のオブジェクト\n" +">(ベクトル、リスト、行列、データフレームなど)をループするたびに作ってしまうことです。\n" "> コンピュータはこれを扱うのがとても下手で、すぐに計算が\n" -"> 遅くなります。適当な次元を持つ空の結果オブジェクトを\n" +"> 遅くなってしまいます。適当な次元を持つ空の結果オブジェクトを\n" "> 前もって宣言しておく方が効率的です。\n" -"> もし、上記の行列に蓄積される最後の結果が何になるかを知っていたら、\n" -"> 5行、5列の数列を作成しておいて、それぞれの繰り返しで、適切な場所へ結果を\n" -"> 蓄積しましょう。" +"> もし、上記のように、最後の結果が行列に蓄積されるのを知っていたら、\n" +"> 5行、5列の数列を作成しておいて、それぞれの繰り返しで適切な場所へ結果を\n" +"> 保存しましょう。" #: r-novice-gapminder/_episodes/07-control-flow.md:352 msgid "" @@ -11737,7 +11741,7 @@ msgid "" "For this example, it looks more involved, but is still more efficient." msgstr "" "よりよい方法は、(空の)出力オブジェクトを、値を埋める前に宣言することです。\n" -"この例では、より複雑に見えますが、それでもより効率的です。" +"この例では、より複雑に見えますが、より効率的です。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:356 @@ -11819,7 +11823,7 @@ msgid "" msgstr "" ">\n" ">\n" -"> ときには、ある条件が満たされるまで繰り返す必要がある場合に出くわすこともあるでしょう。\n" +"> 時には、ある条件が満たされるまで繰り返す必要があります。\n" "> これは、 `while()` ループを使えばできます。\n" ">\n" "> \n" @@ -11830,7 +11834,8 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> 例として、このwhileループは一様分布(`runif()` 関数)から0.1よりも小さい数を得るまで、\n" +"> 例として、このwhileループは\n" +"> 一様分布(`runif()` 関数)から0.1よりも小さい数を得るまで、\n" "> 0から1の間で乱数を生成します。\n" ">\n" "> ~~~\n" @@ -11854,7 +11859,7 @@ msgid "" msgstr "" ">\n" "> `while()` ループは、いつも適当であるとは言えません。特に、条件が決して満たされないことによる\n" -"> 無限ループに陥らないように特に注意する必要があります。" +"> 無限ループに陥らないように注意する必要があります。" #: r-novice-gapminder/_episodes/07-control-flow.md:413 msgid "" @@ -11914,9 +11919,9 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> `output_vector` と `output_vector2` のオブジェクトを比較しましょう。\n" +"> `output_vector` と `output_vector2` のオブジェクトを比較してみましょう。\n" "> 同じですか?もし違ったら、なぜそうなったのでしょう?\n" -"> `output_vector2` の最後のコードのかたまりを `output_vector` と同じにするには、どう変えればよいでしょうか?\n" +"> `output_vector2` の最後のコードのかたまりを `output_vector` と同じにするには、どう変えればいいのでしょうか?\n" ">\n" "> > ## チャレンジ2の解答\n" "> > 2つのベクトルが同じかを調べるために、 `all()` 関数を使いましょう:\n" @@ -11937,30 +11942,30 @@ msgstr "" "> > all(output_vector2 %in% output_vector)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > それゆえ、`output_vector` と `output_vector2` の要素は、違う順番で蓄積されただけです。\n" -"> > この理由は、 `as.vector()` は列ごとに行列に要素を入力する形で出力するからです。\n" -"> > `output_matrix` を見てみると、要素を行ごとに欲しいということに気づくでしょう。\n" -"> > 解決方法は、 `output_matrix` を転置することです。転置関数 `t()` を呼ぶか、\n" +"> > ですので、`output_vector` と `output_vector2` の要素は、違う順番で蓄積されただけみたいです。\n" +"> > 理由は、 `as.vector()` は列ごとに行列から要素を出力するからです。\n" +"> > `output_matrix` を見てみると、要素を行ごとに出力して欲しいことに気づくでしょう。\n" +"> > 解決方法は、 `output_matrix` を転置することです。転置関数 `t()` を使うか、\n" "> > 要素を正しい順番で入力するか、いずれかの方法で対応可能です。\n" -"> > 最初の解決方法は、もともとのものを次の形で変更する必要があります:\n" +"> > 最初の解決方法は、元の形である\n" "> > \n" "> > ~~~\n" "> > output_vector2 <- as.vector(output_matrix)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > を、以下へ\n" +"> > を、次のように変えないといけません:\n" "> > \n" "> > ~~~\n" "> > output_vector2 <- as.vector(t(output_matrix))\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > 二番目の解決方法は、次のように変える必要があります:\n" +"> > 二番目の解決方法は、以下を:\n" "> > \n" "> > ~~~\n" "> > output_matrix[i, j] <- temp_output\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > を、以下へ。\n" +"> > 次のように変えます:\n" "> > \n" "> > ~~~\n" "> > output_matrix[j, i] <- temp_output\n" @@ -12031,7 +12036,7 @@ msgstr "" ">\n" "> > ## チャレンジ3の解答\n" "> >\n" -"> > **手順1**:大陸ベクトルから、確実に全ての唯一無二な値を抜き出せるかを確かめましょう。\n" +"> > **手順1**:大陸ベクトルから、確実に全ての固有の値を抜き出せるかを確かめましょう。\n" "> > \n" "> > ~~~\n" "> > gapminder <- read.csv(\"data/gapminder_data.csv\")\n" @@ -12040,10 +12045,10 @@ msgstr "" "> > {: .language-r}\n" "> >\n" "> > **手順2**:これらの大陸のそれぞれにループをし、その `部分集合` データごとに平均余命を出す必要があります。\n" -"> > それは次の形でできます:\n" +"> > それは次のようにすればできます:\n" "> >\n" -"> > 1. '大陸(continent)' の唯一無二の値のそれぞれについてループする\n" -"> > 2. 大陸のそれぞれの値ごとに、この部分集合の平均余命を蓄積する一時的な変数を作る\n" +"> > 1. '大陸(continent)' の固有の値のそれぞれについてループする\n" +"> > 2. 大陸のそれぞれの値ごとに、部分集合の平均余命を蓄積する一時的な変数を作る\n" "> > 3. 計算した平均余命を返し、 出力を表示させる:\n" "> >\n" "> > \n" @@ -12056,11 +12061,11 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > **手順3**:演習は、平均余命が50歳以上かどうかの結果だけを出力したいというものでした。\n" -"> > ゆえに、 `if` 条件を、表示させる前につける必要があります。これは、演算された平均余命が基準値以上か、基準値未満かを判別し、結果によって出力を表示させる必要があります。\n" -"> > 上から (3) を修正する必要があります:\n" +"> > **手順3**:この演習では、平均余命が50歳以上かどうかの結果だけを出力するものでした。\n" +"> > ゆえに、結果を表示させる前に `if` 条件をつけて、演算された平均余命が基準値以上か、基準値未満かを判別し、結果によって正しい出力を表示させる必要があります。\n" +"> > これを踏まえて、上の (3) を修正する必要があります:\n" "> >\n" -"> > 3a. もし計算された平均余命が、ある基準(50歳)未満の場合、大陸と、平均余命は基準未満であるという宣言を、そうでない場合は、大陸と、平均余命は基準値以上であるという宣言を返しなさい:\n" +"> > 3a. もし計算された平均余命が、ある基準(50歳)未満の場合、大陸と平均余命は基準未満であるという宣言を、そうでない場合は、大陸と平均余命は基準値以上であるという宣言を返す:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12113,8 +12118,8 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> チャレンジ3のスクリプトをそれぞれの国とごとにループする形で修正しなさい。\n" -"> 今回は、平均余命は、50歳未満か、50歳以上70歳未満か、70歳以上かを\n" +"> チャレンジ3のスクリプトをそれぞれの国ごとにループする形に直してください。\n" +"> 今回は、平均余命は50歳未満か、50歳以上70歳未満か、70歳以上かを\n" "> 表示しましょう。\n" ">\n" "> > ## チャレンジ4の解答\n" @@ -12206,14 +12211,14 @@ msgid "" msgstr "" ">\n" "> `gapminder` データセットで、それぞれの国ごとにループするスクリプトを書き、\n" -">国が 'B' で始まるかどうかをテストし、平均余命が50歳以下の場合、平均余命を\n" +"> 国が 'B' で始まるかどうかをテストし、平均余命が50歳以下の場合、平均余命を\n" "> 時間ごとの移り変わりで示した線グラフを書きましょう。\n" ">\n" "> > ## チャレンジ5の解答\n" "> >\n" "> > シェルのレッスンで紹介した`grep` コマンドを「B」で始まる国を見つけるために使います。\n" -"> > まず、これをどういうふうにするかを理解しましょう。\n" -"> > シェル節に従って、以下を試してみたいと思うかもしれません:\n" +"> > まず、これをどうやって使うかを理解しましょう。\n" +"> > シェル節に従って、以下を試してみようと思うかもしれません:\n" "> > \n" "> > ~~~\n" "> > grep(\"^B\", unique(gapminder$country))\n" @@ -12221,7 +12226,7 @@ msgstr "" "> > {: .language-r}\n" "> >\n" "> > でも、このコマンドを演算すると、順序なし因子変数 `country` の「B」で始まる要素番号を返します。\n" -"> > 値を得るためには、 `grep` コマンドの、`value=TRUE` オプションを加える必要があります:\n" +"> > 値を得るためには、 `grep` コマンドの`value=TRUE` オプションを加える必要があります:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12229,7 +12234,7 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > これらの国々をcandidateCountriesと呼ぶ変数に蓄積し、その変数のそれぞれでループするようにしましょう。\n" +"> > これらの国々をcandidateCountriesと呼ぶ変数に蓄積し、その変数のそれぞれをループするようにしましょう。\n" "> > そのループの中で、それぞれの国の平均余命を演算子、もし平均余命が50歳未満でったら、平均余命の進展をみるために、`with()` と`subset()`を使い、base-plotを用いてプロットしましょう:\n" "> >\n" "> > \n" From 400afbd5b0ff4c57e651bebc94f0820fbbe6736d Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Tue, 7 Apr 2020 10:39:36 +0900 Subject: [PATCH 27/59] Update po/r-novice-gapminder.ja.po --- po/r-novice-gapminder.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 3b9420bd..6f94b42b 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -15494,7 +15494,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/11-writing-data.md:20 msgid "## Saving plots" -msgstr "## 図を保存する" +## 図の保存 #: r-novice-gapminder/_episodes/11-writing-data.md:22 msgid "" From 4f317f0ef38693f1b76df23ae301cb03ab2166f5 Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Tue, 7 Apr 2020 10:40:14 +0900 Subject: [PATCH 28/59] Update po/r-novice-gapminder.ja.po --- po/r-novice-gapminder.ja.po | 1 - 1 file changed, 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 6f94b42b..3080ca8e 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -21814,7 +21814,6 @@ msgstr "## [データの出力]({{ page.root }}/11-writing-data/)" #: r-novice-gapminder/reference.md:206 msgid " - `write.table` to write out objects in regular format" msgstr " - `write.table` を使ってオブジェクトを一般的な形式に出力しましょう。" -/ # unordered list #: r-novice-gapminder/reference.md:207 msgid " - set `quote=FALSE` so that text isn't wrapped in `\"` marks" From ac2ed56c1464bcbfe6d4976d5ac726f82b8abd40 Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Fri, 10 Apr 2020 17:21:24 +0900 Subject: [PATCH 29/59] Update TranslatorGuidelines.md Co-Authored-By: Joel Nitta --- TranslatorGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TranslatorGuidelines.md b/TranslatorGuidelines.md index 7feb5636..29d31b74 100644 --- a/TranslatorGuidelines.md +++ b/TranslatorGuidelines.md @@ -14,7 +14,7 @@ `.po`ファイルを編集している時に、`\n`で改行しているように見えますが、これは本当の改行ではありあません(`.md`ファイルと同じく、一行開けることによって改行が入ります)。 なので、`\n`は無視して下さい(英語と日本語で`\n`の数・場所を合わせる必要はありません)。 -翻訳をする際、改行を入れると書きやすく・見やすくなるのであれば、改行(`\n`)を入れても構いません。 +翻訳をする際、改行を入れると書きやすく・見やすくなるのであれば、`\n`を入れても構いません。 ### 専門用語 From e70f3ce877d147828a1e8721341f5e51b393ccc7 Mon Sep 17 00:00:00 2001 From: rkkmk Date: Fri, 10 Apr 2020 22:32:38 +0900 Subject: [PATCH 30/59] 1/2 of Section 12 in R for Rep --- po/r-novice-gapminder.ja.po | 143 ++++++++++++++---------------------- 1 file changed, 56 insertions(+), 87 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index e496031b..43299e53 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -8,9 +8,7 @@ msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -<<<<<<< HEAD -======= ->>>>>>> 718efdcf948e4ee569b48dfaf2f2b4a078ffa0a5 +"PO-Revision-Date: 2020-04-10 22:00+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -928,15 +926,9 @@ msgid "" "control and project management." msgstr "" "このレッスンではRStudioを使います。RStudioは、無料であり、Rを組み込んだオープンソースの\n" -<<<<<<< HEAD "総合開発環境(IDE: Integrated Development Environment)です。RStudioは、全てのプラットフォーム(サーバーも含む)で起動できること、\n" "エディタが組み込まれていることや、プロジェクト管理やバージョン管理にも対応しているなど、\n" "良いところがいっぱいがあります。" -======= -"開発環境です。RStudioには、全てのプラットフォーム(サーバーも含む)で起動できるエディタ\n" -"エディタが組み込まれていることや、プロジェクト管理やバージョン管理にも対応しているなど、\n" -"良いところがいっぱいあります。" ->>>>>>> 718efdcf948e4ee569b48dfaf2f2b4a078ffa0a5 #: r-novice-gapminder/_episodes/01-rstudio-intro.md:68 msgid "**Basic layout**" @@ -2195,11 +2187,7 @@ msgstr "" "> 以外では、2数の比較に決して `==` を使わないこと。\n" ">\n" "> コンピュータは、小数点以下の数を限られた精度でしか示せません。\n" -<<<<<<< HEAD "> なので、二つの数がRで同じように表示されても\n" -======= -"> かもしれません。すると、二つの数がRで同じように表示されても\n" ->>>>>>> 718efdcf948e4ee569b48dfaf2f2b4a078ffa0a5 "> 実際は、その背後で異なる形で表されており、したがって\n" "> ごくわずかな誤差(機械の数値許容範囲)があるかもしれません。\n" ">\n" @@ -3003,11 +2991,7 @@ msgid "" "network). R and RStudio have functionality for managing packages:" msgstr "" "パッケージを書くか、誰かが書いたパッケージを使って、Rに関数を加えることができます。\n" -<<<<<<< HEAD "今現在CRAN (the comprehensive R archive network)上にある\n" -======= -"今現在CRAN (the comprehensive R archive network)上にある\n" ->>>>>>> 718efdcf948e4ee569b48dfaf2f2b4a078ffa0a5 "10,000 を越えるパッケージが使用可能です。RとRStudioには、パッケージを管理する機能があります:" # unordered list @@ -3026,17 +3010,10 @@ msgid "" msgstr "" " `installed.packages()`\n" "* パッケージをインストールするには、`install.packages(\"packagename\")`を入力します\n" -<<<<<<< HEAD " ここで、`packagename`は、用いる引用符付きのパッケージ名です\n" "* インストールしたパッケージの更新には、`update.packages()`を入力します\n" "* パッケージの削除には、`remove.packages(\"packagename\")`を入力します\n" "* 使用できるパッケージを用いるには、`library(packagename)`を入力します" -======= -" ここで、`packagename`は、用いる引用符付きのパッケージ名です。\n" -"* インストールしたパッケージの更新には、`update.packages()`を入力します。\n" -"* パッケージの削除には、`remove.packages(\"packagename\")`を入力します。\n" -"* 使用できるパッケージを用いるには、`library(packagename)`を入力します。" ->>>>>>> 718efdcf948e4ee569b48dfaf2f2b4a078ffa0a5 # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/01-rstudio-intro.md:781 @@ -15986,10 +15963,10 @@ msgid "" "and multiplies the population and GDP per capita column. We also defined\n" "additional arguments so we could filter by `year` and `country`:" msgstr "" -"Previously we looked at how you can use functions to simplify your code.\n" -"We defined the `calcGDP` function, which takes the gapminder dataset,\n" -"and multiplies the population and GDP per capita column. We also defined\n" -"additional arguments so we could filter by `year` and `country`:" +"ここまでに、関数がコードをシンプルにするために使えるということをお伝えしました。\n" +"gapminder データセットを使って、人口の列と1人当たりのGDPの列を掛ける\n" +"関数 `calcGDP` を定義し、更に、\n" +"`year` と `country` でフィルターできる引数を追加で、定義しましたよね。" #: r-novice-gapminder/_episodes/12-plyr.md:42 msgid "" @@ -15998,14 +15975,13 @@ msgid "" "simply calculating the GDP by multiplying two columns together. But what if\n" "we wanted to calculated the mean GDP per continent?" msgstr "" -"A common task you'll encounter when working with data, is that you'll want to\n" -"run calculations on different groups within the data. In the above, we were\n" -"simply calculating the GDP by multiplying two columns together. But what if\n" -"we wanted to calculated the mean GDP per continent?" +"データを使うときに、データにあるグループごとに計算を実行してみたいと思うことが、よくあります。\n" +"先ほどの例では、単純に二つの列を掛け合わせることでGDPを計算しました。\n" +"では、大陸ごとに平均GDPを計算したいときは、どうすればよいでしょうか。" #: r-novice-gapminder/_episodes/12-plyr.md:47 msgid "We could run `calcGDP` and then take the mean of each continent:" -msgstr "We could run `calcGDP` and then take the mean of each continent:" +msgstr "`calcGDP` を実行してから、それぞれの大陸の平均をとることもできます:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:50 @@ -16082,22 +16058,22 @@ msgid "" "repetition. Repeating yourself will cost you time, both now and later, and\n" "potentially introduce some nasty bugs." msgstr "" -"But this isn't very *nice*. Yes, by using a function, you have reduced a\n" -"substantial amount of repetition. That **is** nice. But there is still\n" -"repetition. Repeating yourself will cost you time, both now and later, and\n" -"potentially introduce some nasty bugs." +"でも、これはあまり*おススメ*ではありません。そうです。ある関数を使えば、\n" +"いくつもの繰り返し作業を減らすことができます。それ **は**、おススメです。\n" +"それでも、繰り返し作業はあります。繰り返し作業は、その時点だけでなく\n" +"その後も、時間を食います。そして、嫌なバグを起こる原因にもなりえます。" #: r-novice-gapminder/_episodes/12-plyr.md:96 msgid "" "We could write a new function that is flexible like `calcGDP`, but this\n" "also takes a substantial amount of effort and testing to get right." msgstr "" -"We could write a new function that is flexible like `calcGDP`, but this\n" -"also takes a substantial amount of effort and testing to get right." +"`calcGDP` のような、新しい関数を書くこともできます。\n" +"でも、ちゃんとしたものを作るには、かなりの労力と確認が必要になるでしょう。" #: r-novice-gapminder/_episodes/12-plyr.md:99 msgid "The abstract problem we're encountering here is know as \"split-apply-combine\":" -msgstr "The abstract problem we're encountering here is know as \"split-apply-combine\":" +msgstr "ここで直面している抽象的な問題は、 「split-apply-combine(分けてー適用してーまとめる)」ものとしてよく知られています:" #: r-novice-gapminder/_episodes/12-plyr.md:101 msgid "![Split apply combine](../fig/12-plyr-fig1.png)" @@ -16109,14 +16085,13 @@ msgid "" "some calculations on that group, then optionally *combine* the results\n" "together afterwards." msgstr "" -"We want to *split* our data into groups, in this case continents, *apply*\n" -"some calculations on that group, then optionally *combine* the results\n" -"together afterwards." +"データを(この例では大陸別に)グループ *分け* し、そのグループへある計算を\n" +" *適用*し、できればその後に、結果を *まとめ* たいのです。" # header #: r-novice-gapminder/_episodes/12-plyr.md:107 msgid "## The `plyr` package" -msgstr "## The `plyr` package" +msgstr "## `plyr` パッケージ" #: r-novice-gapminder/_episodes/12-plyr.md:109 msgid "" @@ -16126,15 +16101,15 @@ msgid "" "problem. The [plyr](http://had.co.nz/plyr/) package provides a set of\n" "functions that we find more user friendly for solving this problem." msgstr "" -"For those of you who have used R before, you might be familiar with the\n" -"`apply` family of functions. While R's built in functions do work, we're\n" -"going to introduce you to another method for solving the \"split-apply-combine\"\n" -"problem. The [plyr](http://had.co.nz/plyr/) package provides a set of\n" -"functions that we find more user friendly for solving this problem." +"Rを使ったことがある人なら、`apply`系の関数は、既にご存知かもしれません。\n" +"Rに元々ある関数でもよいのですが、この「split-apply-combine」問題を解決する\n" +"他の方法を紹介しましょう。\n" +"[plyr](http://had.co.nz/plyr/) パッケージには、よりお手軽に、\n" +"この問題を解決できる関数たちがあります。" #: r-novice-gapminder/_episodes/12-plyr.md:115 msgid "We installed this package in an earlier challenge. Let's load it now:" -msgstr "We installed this package in an earlier challenge. Let's load it now:" +msgstr "このパッケージを、以前のチャレンジの中で、インストールしているので、ここでロードしてみましょう:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:118 @@ -16152,23 +16127,23 @@ msgid "" "Plyr has functions for operating on `lists`, `data.frames` and `arrays`\n" "(matrices, or n-dimensional vectors). Each function performs:" msgstr "" -"Plyr has functions for operating on `lists`, `data.frames` and `arrays`\n" -"(matrices, or n-dimensional vectors). Each function performs:" +"Plyrには、`lists(リスト)`、`data.frames(データフレーム)` 及び `arrays(列)`(行列またはn-次元のベクトル)\n" +"に実行できる関数があります。それぞれの関数は以下を実行します:" # ordered list #: r-novice-gapminder/_episodes/12-plyr.md:126 msgid "1. A **split**ting operation" -msgstr "1. A **split**ting operation" +msgstr "1. **分ける** 作業" # ordered list #: r-novice-gapminder/_episodes/12-plyr.md:127 msgid "2. **Apply** a function on each split in turn." -msgstr "2. **Apply** a function on each split in turn." +msgstr "2. 分割したそれぞれへの関数の **適用**" # ordered list #: r-novice-gapminder/_episodes/12-plyr.md:128 msgid "3. Re**combine** output data as a single data object." -msgstr "3. Re**combine** output data as a single data object." +msgstr "3. 出力データを再度ひとつのデータオブジェクトとして**まとめる**" #: r-novice-gapminder/_episodes/12-plyr.md:130 msgid "" @@ -16178,11 +16153,9 @@ msgid "" "the second letter to the output data structure, and then the rest of the\n" "function is named \"ply\"." msgstr "" -"The functions are named based on the data structure they expect as input,\n" -"and the data structure you want returned as output: [a]rray, [l]ist, or\n" -"[d]ata.frame. The first letter corresponds to the input data structure,\n" -"the second letter to the output data structure, and then the rest of the\n" -"function is named \"ply\"." +"関数は、入力されるだろうデータ構造と出力予定のデータ構造に基づき名付けられています。\n" +"つまり、[a]rray、[l]ist、または[d]ata.frameのことです。最初の文字が、入力データ構造、\n" +"次の文字が出力データ構造、そして、残りが「ply」と名付けられた関数です。" #: r-novice-gapminder/_episodes/12-plyr.md:136 msgid "" @@ -16191,18 +16164,17 @@ msgid "" "They're named by their input data type and represent null output by a `_` (see\n" "table)" msgstr "" -"This gives us 9 core functions **ply. There are an additional three functions\n" -"which will only perform the split and apply steps, and not any combine step.\n" -"They're named by their input data type and represent null output by a `_` (see\n" -"table)" +"これが **plyの9つの中心的な関数です。加えて、分けて適用することだけで、まとめを実行しない\n" +"関数が3つあります。それらは、入力データ型と出力データがないことを示す\n" +" `_` から名付けられています(表参照)。" #: r-novice-gapminder/_episodes/12-plyr.md:141 msgid "" "Note here that plyr's use of \"array\" is different to R's,\n" "an array in ply can include a vector or matrix." msgstr "" -"Note here that plyr's use of \"array\" is different to R's,\n" -"an array in ply can include a vector or matrix." +"ここで、plyrの「array」の使用法は、Rの使用法を違うことに気をつけましょう。\n" +"plyのarrayは、ベクトルや行列も含めます。" #: r-novice-gapminder/_episodes/12-plyr.md:144 msgid "![Full apply suite](../fig/12-plyr-fig2.png)" @@ -16213,8 +16185,8 @@ msgid "" "Each of the xxply functions (`daply`, `ddply`, `llply`, `laply`, ...) has the\n" "same structure and has 4 key features and structure:" msgstr "" -"Each of the xxply functions (`daply`, `ddply`, `llply`, `laply`, ...) has the\n" -"same structure and has 4 key features and structure:" +"xxply関数(`daply` 、 `ddply` 、 `llply` 、 `laply`、などなど)は、\n" +"同じ構造で、4つの重要な特徴と構造を持っています:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:151 @@ -16230,26 +16202,26 @@ msgstr "" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:156 msgid "* The first letter of the function name gives the input type and the second gives the output type." -msgstr "* The first letter of the function name gives the input type and the second gives the output type." +msgstr "* 関数の最初の文字が、入力型、次の文字が出力型を示します。" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:157 msgid "* .data - gives the data object to be processed" -msgstr "* .data - gives the data object to be processed" +msgstr "* .data -処理されるデータオブジェクトを示します。" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:158 msgid "* .variables - identifies the splitting variables" -msgstr "* .variables - identifies the splitting variables" +msgstr "* .variables-分割する変数を指定します。" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:159 msgid "* .fun - gives the function to be called on each piece" -msgstr "* .fun - gives the function to be called on each piece" +msgstr "* .fun-それぞれに適用する関数を示します。" #: r-novice-gapminder/_episodes/12-plyr.md:161 msgid "Now we can quickly calculate the mean GDP per continent:" -msgstr "Now we can quickly calculate the mean GDP per continent:" +msgstr "それでは、大陸別の平均GDPを計算してみましょう:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:164 @@ -16293,12 +16265,12 @@ msgstr "" #: r-novice-gapminder/_episodes/12-plyr.md:185 msgid "Let's walk through the previous code:" -msgstr "Let's walk through the previous code:" +msgstr "このコードを、ひとつずつ見てみましょう:" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:187 msgid "- The `ddply` function feeds in a `data.frame` (function starts with **d**) and" -msgstr "- The `ddply` function feeds in a `data.frame` (function starts with **d**) and" +msgstr "- `ddply` 関数は、`data.frame` を使い(関数は、**d**から始まりますね)、" #: r-novice-gapminder/_episodes/12-plyr.md:188 msgid "" @@ -16315,18 +16287,15 @@ msgid "" " function: we haven't defined it elsewhere, and it has no name. It only exists\n" " in the scope of our call to `ddply`." msgstr "" -"returns another `data.frame` (2nd letter is a **d**) i\n" -"- the first argument we gave was the data.frame we wanted to operate on: in this\n" -" case the gapminder data. We called `calcGDP` on it first so that it would have\n" -" the additional `gdp` column added to it.\n" -"- The second argument indicated our split criteria: in this case the \"continent\"\n" -" column. Note that we gave the name of the column, not the values of the column like we had done previously with subsetting. Plyr takes care of these\n" -" implementation details for you.\n" -"- The third argument is the function we want to apply to each grouping of the\n" -" data. We had to define our own short function here: each subset of the data\n" -" gets stored in `x`, the first argument of our function. This is an anonymous\n" -" function: we haven't defined it elsewhere, and it has no name. It only exists\n" -" in the scope of our call to `ddply`." +"もうひとつの`data.frame`を出力します(2番目の文字は、**d**ですね)\n" +"- 最初の引数は、使いたいdata.frameでしたね。つまり、ここでは、\n" +"gapminderデータです。そこに、`gdp` の列を加えるために、まず `calcGDP` を使いましょう。\n" +"- 次の引数は、分割基準を、つまり、ここでは「continent(大陸)」列です。\n" +" 以前、分部集合に分けるときに使った値の名前ではなく、ここでは列の名前を使うことに気を付けましょう。Plyrが細かい実行上の詳細を、代わりに処理してくれますので。\n" +"- 3番目の引数は、データのそれぞれのグループに当てはめる関数です。\n" +" ここで、自分で短い関数を定義しておかなければなりません。\n" +" データのそれぞれの部分集合が、その関数の最初の引数の`x` に保存されます。\n" +" これは、名前のない関数です。つまり、他のところで定義していないもので、名前がないものです。それは、 `ddply` が呼び出されている間だけ、存在します。" #: r-novice-gapminder/_episodes/12-plyr.md:202 msgid "" From cb1611f3cb24b0eb76d0e4f9761b68121f022141 Mon Sep 17 00:00:00 2001 From: rkkmk Date: Sat, 11 Apr 2020 20:53:20 +0900 Subject: [PATCH 31/59] translated:2/2 of Section 12 in R for Rep --- po/r-novice-gapminder.ja.po | 1 - 1 file changed, 1 deletion(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 43299e53..81e57ff2 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -8,7 +8,6 @@ msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2020-04-10 22:00+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" From 291c71297f2119d328aeef0087d66145f0e08934 Mon Sep 17 00:00:00 2001 From: rkkmk Date: Sat, 11 Apr 2020 21:01:49 +0900 Subject: [PATCH 32/59] translated:2/2 of Section 12 in R for Rep --- po/r-novice-gapminder.ja.po | 42 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 81e57ff2..a1de6a31 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -16303,12 +16303,12 @@ msgid "" "> Which had the shortest?" msgstr "" ">\n" -"> Calculate the average life expectancy per continent. Which has the longest?\n" -"> Which had the shortest?" +"> 大陸別の平均余命を計算してみましょう。一番長いのはどこでしょうか。\n" +"> 一番短いのはどこでしょうか。" #: r-novice-gapminder/_episodes/12-plyr.md:207 msgid "What if we want a different type of output data structure?:" -msgstr "What if we want a different type of output data structure?:" +msgstr "他のデータ構造型が良い場合は、どうすればよいでしょうか。" # code block #: r-novice-gapminder/_episodes/12-plyr.md:210 @@ -16391,12 +16391,12 @@ msgid "" "We called the same function again, but changed the second letter to an `l`, so\n" "the output was returned as a list." msgstr "" -"We called the same function again, but changed the second letter to an `l`, so\n" -"the output was returned as a list." +"また同じ関数を呼び出しましたが、2番目の文字を `l` に変えたので、\n" +"出力されたのは、リストでした。" #: r-novice-gapminder/_episodes/12-plyr.md:252 msgid "We can specify multiple columns to group by:" -msgstr "We can specify multiple columns to group by:" +msgstr "以下で、グループにまとめる列を指定します:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:255 @@ -16624,9 +16624,8 @@ msgid "" "do so).\n" "To replace a for loop, put the code that was in the body of the `for` loop inside an anonymous function." msgstr "" -"You can use these functions in place of `for` loops (and its usually faster to\n" -"do so).\n" -"To replace a for loop, put the code that was in the body of the `for` loop inside an anonymous function." +"これらの関数は `for` ループの代わりに使えます(その方が、普通は早いです)。\n" +"forループを置き換えるために、 `for` ループの本体の中にあった名無し関数のコードを置きましょう。" # code block #: r-novice-gapminder/_episodes/12-plyr.md:373 @@ -16681,7 +16680,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/12-plyr.md:399 msgid "> ## Tip: printing numbers" -msgstr "> ## Tip: printing numbers" +msgstr "> ## ヒント:数を出力する" #: r-novice-gapminder/_episodes/12-plyr.md:400 msgid "" @@ -16690,8 +16689,8 @@ msgid "" "> values \"pretty\" for printing out in messages." msgstr "" ">\n" -"> The `format` function can be used to make numeric\n" -"> values \"pretty\" for printing out in messages." +"> `format` 関数を使えば、数値をメッセージの中で「いい感じ」に\n" +"> 出力できます。" #: r-novice-gapminder/_episodes/12-plyr.md:407 msgid "" @@ -16701,15 +16700,15 @@ msgid "" "> and 2007?" msgstr "" ">\n" -"> Calculate the average life expectancy per continent and year. Which had the\n" -"> longest and shortest in 2007? Which had the greatest change in between 1952\n" -"> and 2007?" +"> 年次の大陸別平均余命を計算しましょう。2007年に\n" +"> 一番長かったのは、短かったのは、どこでしょうか。\n" +"> 1952年から2007にかけて変化が一番大きかったのはどこでしょうか。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/12-plyr.md:414 #: r-novice-gapminder/_episodes/13-dplyr.md:572 msgid "> ## Advanced Challenge" -msgstr "> ## Advanced Challenge" +msgstr "> ## 上級チャレンジ" #: r-novice-gapminder/_episodes/12-plyr.md:415 msgid "" @@ -16719,14 +16718,13 @@ msgid "" "> using one of the `plyr` functions." msgstr "" ">\n" -"> Calculate the difference in mean life expectancy between\n" -"> the years 1952 and 2007 from the output of challenge 2\n" -"> using one of the `plyr` functions." +"> `plyr` 関数のひとつを使って、チャレンジ2の出力から、\n" +"> 2007年と1952年の平均余命の差を計算しましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/12-plyr.md:421 msgid "> ## Alternate Challenge if class seems lost" -msgstr "> ## Alternate Challenge if class seems lost" +msgstr "> ## チャレンジの別バージョン(クラスがなくなっていた場合)" #: r-novice-gapminder/_episodes/12-plyr.md:422 msgid "" @@ -16786,8 +16784,8 @@ msgid "" ">" msgstr "" ">\n" -"> Without running them, which of the following will calculate the average\n" -"> life expectancy per continent:\n" +"> 実行せずに、以下の中から、大陸別の平均余命を計算するものを選んでみましょう。\n" +"> :\n" ">\n" "> 1.\n" "> \n" From 974a5c7daf76125b686272dd28d53b753d2c626a Mon Sep 17 00:00:00 2001 From: rkkmk Date: Mon, 20 Apr 2020 00:01:43 +0900 Subject: [PATCH 33/59] Translated:Section 13 in R for Rep --- po/r-novice-inflammation.ja.po | 2 -- 1 file changed, 2 deletions(-) diff --git a/po/r-novice-inflammation.ja.po b/po/r-novice-inflammation.ja.po index 4ef42953..2282277f 100644 --- a/po/r-novice-inflammation.ja.po +++ b/po/r-novice-inflammation.ja.po @@ -7,8 +7,6 @@ msgid "" msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" -"POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2018-09-18 00:09+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" From 8845716852b048703d18326a337958bef6e94529 Mon Sep 17 00:00:00 2001 From: rkkmk Date: Sun, 26 Apr 2020 20:59:27 +0900 Subject: [PATCH 34/59] Translated:Section 14 in R for Rep --- po/r-novice-gapminder.ja.po | 426 +++++++++++++++++------------------- 1 file changed, 204 insertions(+), 222 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index a1de6a31..cc432717 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -16,6 +16,7 @@ msgstr "" "Language-Team: Japanese \n" "Language: ja\n" "X-Generator: Poedit 2.2.3\n" +"PO-Revision-Date: \n" # Front Matter #: r-novice-gapminder/CODE_OF_CONDUCT.md:1 @@ -16060,7 +16061,7 @@ msgstr "" "でも、これはあまり*おススメ*ではありません。そうです。ある関数を使えば、\n" "いくつもの繰り返し作業を減らすことができます。それ **は**、おススメです。\n" "それでも、繰り返し作業はあります。繰り返し作業は、その時点だけでなく\n" -"その後も、時間を食います。そして、嫌なバグを起こる原因にもなりえます。" +"その後も、時間を食います。そして、嫌なバグが起こる原因にもなりえます。" #: r-novice-gapminder/_episodes/12-plyr.md:96 msgid "" @@ -16890,10 +16891,10 @@ msgid "" "data by a certain variable(s), or we even calculate summary statistics. We can\n" "do these operations using the normal base R operations:" msgstr "" -"Manipulation of dataframes means many things to many researchers, we often\n" -"select certain observations (rows) or variables (columns), we often group the\n" -"data by a certain variable(s), or we even calculate summary statistics. We can\n" -"do these operations using the normal base R operations:" +"多くの研究者にとって、データフレームの操作は、多くのことを意味します。\n" +"よくあるのは、特定の標本(行)もしくは変数(列)の選択、 特定の変数でのデータのグループ化、\n" +"更には要約する統計値の計算です。\n" +"これらは、普通のRの基本操作で実行できます:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:30 @@ -16967,14 +16968,13 @@ msgid "" "yourself will cost you time, both now and later, and potentially introduce some\n" "nasty bugs." msgstr "" -"But this isn't very *nice* because there is a fair bit of repetition. Repeating\n" -"yourself will cost you time, both now and later, and potentially introduce some\n" -"nasty bugs." +"でも、これはあまり*おススメ*ではありません。繰り返しがかなりあるからです。\n" +"繰り返し作業は、時間を食います。そして、嫌なバグを起こる原因にもなりえます。" # header #: r-novice-gapminder/_episodes/13-dplyr.md:74 msgid "## The `dplyr` package" -msgstr "## The `dplyr` package" +msgstr "## `dplyr` パッケージ" #: r-novice-gapminder/_episodes/13-dplyr.md:76 msgid "" @@ -16984,19 +16984,20 @@ msgid "" "errors, and probably even save you some typing. As an added bonus, you might\n" "even find the `dplyr` grammar easier to read." msgstr "" -"Luckily, the [`dplyr`](https://cran.r-project.org/web/packages/dplyr/dplyr.pdf)\n" -"package provides a number of very useful functions for manipulating dataframes\n" -"in a way that will reduce the above repetition, reduce the probability of making\n" -"errors, and probably even save you some typing. As an added bonus, you might\n" -"even find the `dplyr` grammar easier to read." +"嬉しいことに、[`dplyr`](https://cran.r-project.org/web/packages/dplyr/dplyr.pdf)\n" +"パッケージには、データフレーム操作に、かなり使える関数がいくつもあります。\n" +"それを使うと、先ほどお伝えしたような繰り返しを減らし、エラーを起こす確率を減らし、\n" +"タイピングする必要性さえも恐らく減らせます。\n" +"更には、`dplyr` の書き方は、とても分かりやすいかもしれません。" #: r-novice-gapminder/_episodes/13-dplyr.md:82 msgid "" "Here we're going to cover 6 of the most commonly used functions as well as using\n" "pipes (`%>%`) to combine them." msgstr "" -"Here we're going to cover 6 of the most commonly used functions as well as using\n" -"pipes (`%>%`) to combine them." +"ここでは、特によく使われる6つの関数と、\n" +"それらを組み合わせるためのパイプ(`%>%`)を紹介します。\n" +"." # ordered list #: r-novice-gapminder/_episodes/13-dplyr.md:85 @@ -17025,7 +17026,7 @@ msgstr "5. `mutate()`" #: r-novice-gapminder/_episodes/13-dplyr.md:91 msgid "If you have have not installed this package earlier, please do so:" -msgstr "If you have have not installed this package earlier, please do so:" +msgstr "もし、このパッケージをまだインストールしていないようでしたら、ここでしておきましょう:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:94 @@ -17040,7 +17041,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:99 msgid "Now let's load the package:" -msgstr "Now let's load the package:" +msgstr "パッケージをロードしましょう:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:102 @@ -17056,7 +17057,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:107 msgid "## Using select()" -msgstr "## Using select()" +msgstr "## select() を使う" #: r-novice-gapminder/_episodes/13-dplyr.md:109 msgid "" @@ -17064,9 +17065,9 @@ msgid "" "our dataframe we could use the `select()` function. This will keep only the\n" "variables you select." msgstr "" -"If, for example, we wanted to move forward with only a few of the variables in\n" -"our dataframe we could use the `select()` function. This will keep only the\n" -"variables you select." +"例えば、 データフレームにある、いくつかの変数だけを使って進めたい場合、\n" +"使えるかもしれないのは、`select()` 関数です。\n" +"これを使えば、選択した変数だけをキープすることができます。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:114 @@ -17091,11 +17092,11 @@ msgid "" "is unlike anything we've seen in R before, let's repeat what we've done above\n" "using pipes." msgstr "" -"If we open up `year_country_gdp` we'll see that it only contains the year,\n" -"country and gdpPercap. Above we used 'normal' grammar, but the strengths of\n" -"`dplyr` lie in combining several functions using pipes. Since the pipes grammar\n" -"is unlike anything we've seen in R before, let's repeat what we've done above\n" -"using pipes." +"もし `year_country_gdp` を開いたら、year、country 及び gdpPercap しかないでしょう。\n" +"上では、 '普通の' 書き方を使いましたが、`dplyr` の強みは、複数の関数を\n" +"パイプを使って、組み合わせられることです。\n" +"パイプの書き方は、これまでRで見てきたものとは、\n" +"全く違いますので、上記でしたことをパイプを使って、やってみましょう。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:128 @@ -17118,26 +17119,23 @@ msgid "" "encountered pipes before in the shell. In R, a pipe symbol is `%>%` while in the\n" "shell it is `|` but the concept is the same!" msgstr "" -"To help you understand why we wrote that in that way, let's walk through it step\n" -"by step. First we summon the gapminder dataframe and pass it on, using the pipe\n" -"symbol `%>%`, to the next step, which is the `select()` function. In this case\n" -"we don't specify which data object we use in the `select()` function since in\n" -"gets that from the previous pipe. **Fun Fact**: There is a good chance you have\n" -"encountered pipes before in the shell. In R, a pipe symbol is `%>%` while in the\n" -"shell it is `|` but the concept is the same!" +"こう書いた理由を、お分かりいただくために、ひとつずつ御説明します。\n" +"始めに、gapminder データフレームを呼び出し、パイプの記号`%>%` を使って、\n" +"次の `select()` 関数を使うステップに引き渡します。どのデータオブジェクトを\n" +"`select()` 関数で使うかについては、前のパイプから分かるため、ここでは指定しません。\n" +"**面白い事実**:シェルで、パイプに既に出会っている可能性が高いはずです。\n" +"Rでは、パイプの記号は `%>%` で、シェルでは、 `|` ですが、コンセプトは同じです。" # header #: r-novice-gapminder/_episodes/13-dplyr.md:141 msgid "## Using filter()" -msgstr "## Using filter()" +msgstr "## filter() を使う" #: r-novice-gapminder/_episodes/13-dplyr.md:143 msgid "" "If we now wanted to move forward with the above, but only with European\n" "countries, we can combine `select` and `filter`" -msgstr "" -"If we now wanted to move forward with the above, but only with European\n" -"countries, we can combine `select` and `filter`" +msgstr "欧州のみで、上記を進めたいとしたら、 `select` と `filter` を組み合わせましょう。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:147 @@ -17172,12 +17170,11 @@ msgid "" "> >{: .language-r}" msgstr "" ">\n" -"> Write a single command (which can span multiple lines and includes pipes) that\n" -"> will produce a dataframe that has the African values for `lifeExp`, `country`\n" -"> and `year`, but not for other Continents. How many rows does your dataframe\n" -"> have and why?\n" +"> アフリカの`lifeExp`、 `country` 及び `year` を持ち、他の国を含まないデータフレームを\n" +"> 作るコマンドをひとつ書いてみましょう(複数の行になっても、パイプを使っても大丈夫です)\n" +"> データフレームには、何行ありますか。なぜそうなるのでしょうか。\n" ">\n" -"> > ## Solution to Challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" "> >~~~\n" "> >year_country_lifeExp_Africa <- gapminder %>%\n" @@ -17194,16 +17191,16 @@ msgid "" "case. If we used 'select' first, filter would not be able to find the variable\n" "continent since we would have removed it in the previous step." msgstr "" -"As with last time, first we pass the gapminder dataframe to the `filter()`\n" -"function, then we pass the filtered version of the gapminder dataframe to the\n" -"`select()` function. **Note:** The order of operations is very important in this\n" -"case. If we used 'select' first, filter would not be able to find the variable\n" -"continent since we would have removed it in the previous step." +"その前に行ったように、gapminder データフレームを `filter()` 関数に引き渡し、\n" +"フィルターされた バージョンのgapminder データフレームを、 `select()` 関数に引き渡します。\n" +"**注意:** ここでは、操作手順がとても重要です。\n" +"まず 'select' を使うと、その前のステップで、大陸の変数が削除されているため、\n" +"filter で大陸の変数を見つけることができないことでしょう。" # header #: r-novice-gapminder/_episodes/13-dplyr.md:178 msgid "## Using group_by() and summarize()" -msgstr "## Using group_by() and summarize()" +msgstr "## group_by() と summarize() を使う" #: r-novice-gapminder/_episodes/13-dplyr.md:180 msgid "" @@ -17214,12 +17211,10 @@ msgid "" "can use `group_by()`, which will essentially use every unique criteria that you\n" "could have used in filter." msgstr "" -"Now, we were supposed to be reducing the error prone repetitiveness of what can\n" -"be done with base R, but up to now we haven't done that since we would have to\n" -"repeat the above for each continent. Instead of `filter()`, which will only pass\n" -"observations that meet your criteria (in the above: `continent==\"Europe\"`), we\n" -"can use `group_by()`, which will essentially use every unique criteria that you\n" -"could have used in filter." +"ここでは、Rの基本的な機能を用いたエラーが起こりやすい繰り返し作業を減らすはずでした。\n" +"でも、まだそれが達成できていません。上記では、それぞれの大陸で繰り返さなければならないですね。\n" +"(上記の `continent==\"Europe\"` のように)条件にあった標本のみを引き渡す `filter()` の代わりに、\n" +"filterでも使える、それぞれの一意の条件を用いることが必須となる `group_by()` を使うこともできます。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:208 @@ -17291,11 +17286,10 @@ msgid "" "`data.frame` which contains only the rows that correspond to the a particular\n" "value `continent` (at least in the example above)." msgstr "" -"You will notice that the structure of the dataframe where we used `group_by()`\n" -"(`grouped_df`) is not the same as the original `gapminder` (`data.frame`). A\n" -"`grouped_df` can be thought of as a `list` where each item in the `list`is a\n" -"`data.frame` which contains only the rows that correspond to the a particular\n" -"value `continent` (at least in the example above)." +"`group_by()` (`grouped_df`)で用いたデータフレームのデータ構造は、もともとの `gapminder` (`data.frame`)とは異なることに気づいたことでしょう。\n" +"`grouped_df` は、 `list` のようなものです。その `list` にある各項目は、\n" +"(少なくとも上記の例では)特定の `continent` の値が対応する列のみを含む `data.frame` \n" +"になります。" #: r-novice-gapminder/_episodes/13-dplyr.md:245 msgid "![](../fig/13-dplyr-fig2.png)" @@ -17304,7 +17298,7 @@ msgstr "![](../fig/13-dplyr-fig2.png)" # header #: r-novice-gapminder/_episodes/13-dplyr.md:247 msgid "## Using summarize()" -msgstr "## Using summarize()" +msgstr "## summarize() を使う" #: r-novice-gapminder/_episodes/13-dplyr.md:249 msgid "" @@ -17315,12 +17309,11 @@ msgid "" "original dataframe into multiple pieces, then we can run functions\n" "(e.g. `mean()` or `sd()`) within `summarize()`." msgstr "" -"The above was a bit on the uneventful side but `group_by()` is much more\n" -"exciting in conjunction with `summarize()`. This will allow us to create new\n" -"variable(s) by using functions that repeat for each of the continent-specific\n" -"data frames. That is to say, using the `group_by()` function, we split our\n" -"original dataframe into multiple pieces, then we can run functions\n" -"(e.g. `mean()` or `sd()`) within `summarize()`." +"上記は、少し物足りないかもしれませんが、`group_by()` は、`summarize()` と共に使えば\n" +"本当にすばらしいのです。それぞれの大陸のデータフレームごとに繰り返す関数を使って、\n" +"新たな変数を作ることができます。\n" +"つまり、 `group_by()` 関数を使って、もともとのデータフレームを、いくつかのデータに分け、\n" +"`summarize()` の中で、関数(たとえば `mean()` や `sd()`)を実行することができるのです。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:257 @@ -17369,8 +17362,8 @@ msgid "" "That allowed us to calculate the mean gdpPercap for each continent, but it gets\n" "even better." msgstr "" -"That allowed us to calculate the mean gdpPercap for each continent, but it gets\n" -"even better." +"これにより、それぞれの大陸の平均gdpPercapを計算することができますが、\n" +"更に、すばらしいことがあるのです。" #: r-novice-gapminder/_episodes/13-dplyr.md:282 msgid "" @@ -17444,10 +17437,10 @@ msgid "" msgstr "" ">\n" ">\n" -"> Calculate the average life expectancy per country. Which has the longest average life\n" -"> expectancy and which has the shortest average life expectancy?\n" +"> 国別平均余命を計算しましょう。平均余命が、一番長い国と一番短い国は、\n" +"> それぞれどこでしょうか。\n" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" "> >~~~\n" "> >lifeExp_bycountry <- gapminder %>%\n" @@ -17468,11 +17461,11 @@ msgstr "" "> >2 Sierra Leone 36.8\n" "> >~~~\n" "> >{: .output}\n" -"> Another way to do this is to use the `dplyr` function `arrange()`, which\n" -"> arranges the rows in a data frame according to the order of one or more\n" -"> variables from the data frame. It has similar syntax to other functions from\n" -"> the `dplyr` package. You can use `desc()` inside `arrange()` to sort in\n" -"> descending order.\n" +"> もうひとつの方法は、 `dplyr` の関数 `arrange()` を使うことです。\n" +"> これは、データフレームのひとつ又は複数の変数の順序に従って、\n" +"> データフレームの列を配置するものです。 書き方は、`dplyr` パッケージの\n" +"> 他の関数と似ています。降順で並べたいときは、 `arrange()` の中に、\n" +"> `desc()` を使えばよいのです。\n" "> >\n" "> >~~~\n" "> >lifeExp_bycountry %>%\n" @@ -17512,7 +17505,9 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:352 msgid "The function `group_by()` allows us to group by multiple variables. Let's group by `year` and `continent`." -msgstr "The function `group_by()` allows us to group by multiple variables. Let's group by `year` and `continent`." +msgstr "" +" `group_by()` の関数では、複数の変数でグループ化するこもできます。\n" +" `year` と `continent` でグループ分けしてみましょう。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:356 @@ -17531,7 +17526,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:363 msgid "That is already quite powerful, but it gets even better! You're not limited to defining 1 new variable in `summarize()`." -msgstr "That is already quite powerful, but it gets even better! You're not limited to defining 1 new variable in `summarize()`." +msgstr "これでも、かなり役に立ちますが、更にすごいのです。`summarize()` の中で新しく定義できる変数は、1つに限らないのです。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:366 @@ -17557,15 +17552,15 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:376 msgid "## count() and n()" -msgstr "## count() and n()" +msgstr "## count() 及び n()" #: r-novice-gapminder/_episodes/13-dplyr.md:378 msgid "" "A very common operation is to count the number of observations for each\n" "group. The `dplyr` package comes with two related functions that help with this." msgstr "" -"A very common operation is to count the number of observations for each\n" -"group. The `dplyr` package comes with two related functions that help with this." +"よくありがちな操作は、各グループの標本数の数を数えることです。\n" +"これに役立つ2つの関数が `dplyr` パッケージにあります。" #: r-novice-gapminder/_episodes/13-dplyr.md:381 msgid "" @@ -17574,10 +17569,9 @@ msgid "" "of one or more columns that contain the groups we are interested in, and we can\n" "optionally sort the results in descending order by adding `sort=TRUE`:" msgstr "" -"For instance, if we wanted to check the number of countries included in the\n" -"dataset for the year 2002, we can use the `count()` function. It takes the name\n" -"of one or more columns that contain the groups we are interested in, and we can\n" -"optionally sort the results in descending order by adding `sort=TRUE`:" +"例えば、2002年のデータセットにある国数を確認したい場合、 `count()` 関数が使えます。\n" +"興味のあるグループのひとつかいくつかの行の名前を取り、\n" +" `sort=TRUE` を加えることで、結果を降順に並べることもできます:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:387 @@ -17625,9 +17619,8 @@ msgid "" "is useful. For instance, if we wanted to get the standard error of the life\n" "expectency per continent:" msgstr "" -"If we need to use the number of observations in calculations, the `n()` function\n" -"is useful. For instance, if we wanted to get the standard error of the life\n" -"expectency per continent:" +"演算の際、標本数が必要な場合 `n()` 関数が使えます。\n" +"例えば、大陸別平均余命の標準誤差を得たいとします:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:413 @@ -17671,7 +17664,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:434 msgid "You can also chain together several summary operations; in this case calculating the `minimum`, `maximum`, `mean` and `se` of each continent's per-country life-expectancy:" -msgstr "You can also chain together several summary operations; in this case calculating the `minimum`, `maximum`, `mean` and `se` of each continent's per-country life-expectancy:" +msgstr "いくつかの要約計算を、つなぎ合わせることもできます。つまり、ここでは各大陸の国別平均余命の `minimum` 、 `maximum` 、 `mean` 及び `se` となります:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:437 @@ -17724,11 +17717,11 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:462 msgid "## Using mutate()" -msgstr "## Using mutate()" +msgstr "## mutate() を使う" #: r-novice-gapminder/_episodes/13-dplyr.md:464 msgid "We can also create new variables prior to (or even after) summarizing information using `mutate()`." -msgstr "We can also create new variables prior to (or even after) summarizing information using `mutate()`." +msgstr "情報を要約する前に(もしくは後にでも)、 `mutate()` を使えば、新しい変数を作ることができます。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:467 @@ -17760,7 +17753,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:480 msgid "## Connect mutate with logical filtering: ifelse" -msgstr "## Connect mutate with logical filtering: ifelse" +msgstr "## 論理フィルター ifelse とmutate をつなげる" #: r-novice-gapminder/_episodes/13-dplyr.md:482 msgid "" @@ -17769,10 +17762,12 @@ msgid "" "This easy-to-read statement is a fast and powerful way of discarding certain data (even though the overall dimension\n" "of the data frame will not change) or for updating values depending on this given condition." msgstr "" -"When creating new variables, we can hook this with a logical condition. A simple combination of\n" -"`mutate()` and `ifelse()` facilitates filtering right where it is needed: in the moment of creating something new.\n" -"This easy-to-read statement is a fast and powerful way of discarding certain data (even though the overall dimension\n" -"of the data frame will not change) or for updating values depending on this given condition." +"新しい変数を作る時、これに論理条件に付けることができます。\n" +"似たような組み合わせの `mutate()` と `ifelse()` は、まさに必要な場面、つまり\n" +"新しいものを作る時に、フィルターすることができます。\n" +"この簡単に読める宣言が、(データフレーム全体の次元を変えずに)あるデータを\n" +"捨てるための早くて役に立つ方法であり、\n" +"与えられた条件によって値を更新する方法なのです。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:488 @@ -17824,7 +17819,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:511 msgid "## Combining `dplyr` and `ggplot2`" -msgstr "## Combining `dplyr` and `ggplot2`" +msgstr "## `dplyr` と `ggplot2` を組み合わせる" #: r-novice-gapminder/_episodes/13-dplyr.md:513 msgid "" @@ -17832,9 +17827,9 @@ msgid "" "a layer of facet panels using `ggplot2`. Here is the code we used (with some\n" "extra comments):" msgstr "" -"In the plotting lesson we looked at how to make a multi-panel figure by adding\n" -"a layer of facet panels using `ggplot2`. Here is the code we used (with some\n" -"extra comments):" +"プロットのレッスンでは、 `ggplot2` を使って、小面パネルの層を加えることで、\n" +"複数パネルの図を示す方法を見ました。\n" +"次が、(いくつかコメントを付けた)使ったコードです:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:518 @@ -17873,13 +17868,13 @@ msgid "" "`dplyr` and `ggplot2` functions we can make the same figure without creating any\n" "new variables or modifying the data." msgstr "" -"This code makes the right plot but it also creates some variables (`starts.with`\n" -"and `az.countries`) that we might not have any other uses for. Just as we used\n" -"`%>%` to pipe data along a chain of `dplyr` functions we can use it to pass data\n" -"to `ggplot()`. Because `%>%` replaces the first argument in a function we don't\n" -"need to specify the `data =` argument in the `ggplot()` function. By combining\n" -"`dplyr` and `ggplot2` functions we can make the same figure without creating any\n" -"new variables or modifying the data." +"このコードは、正しいプロットを作りますが、他に使い道のない、変数(`starts.with`\n" +"及び `az.countries`)も作ります。 `dplyr` 関数のチェーンで、 `%>%` を使って、\n" +"データをパイプ流したように、 `ggplot()` へデータを引き渡すこともできます。\n" +"なぜならば `%>%` は、関数の最初の引数を置き換えるため、\n" +" `ggplot()` 関数の中の、 `data =` 因数を指定する必要がありません。\n" +" `dplyr` と `ggplot2` 関数を組み合わせることで、同じ図を、新しい変数を作ったり、\n" +"データを修正することなく作成できます。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:540 @@ -17917,8 +17912,8 @@ msgid "" "Using `dplyr` functions also helps us simplify things, for example we could\n" "combine the first two steps:" msgstr "" -"Using `dplyr` functions also helps us simplify things, for example we could\n" -"combine the first two steps:" +" `dplyr` 関数を使うことで、物事が簡単になります。例えば、\n" +"最初の2つの段階を組み合わせることができます:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:559 @@ -17968,12 +17963,12 @@ msgid "" "> >{: .language-r}" msgstr "" ">\n" -"> Calculate the average life expectancy in 2002 of 2 randomly selected countries\n" -"> for each continent. Then arrange the continent names in reverse order.\n" -"> **Hint:** Use the `dplyr` functions `arrange()` and `sample_n()`, they have\n" -"> similar syntax to other dplyr functions.\n" +"> 各大陸から無作為に選ばれた2つの国の2002年の平均余命を計算し、\n" +"> 大陸名を、逆の順番に並べましょう。\n" +"> **ヒント:** `dplyr` 関数 `arrange()` 及び `sample_n()` を使いましょう。\n" +"> 書き方は、他の dplyr 関数と同じです。\n" ">\n" -"> > ## Solution to Advanced Challenge\n" +"> > ## 上級チャレンジの解答\n" "> >\n" "> >~~~\n" "> >lifeExp_2countries_bycontinents <- gapminder %>%\n" @@ -17989,7 +17984,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:593 #: r-novice-gapminder/_episodes/14-tidyr.md:645 msgid "## Other great resources" -msgstr "## Other great resources" +msgstr "## その他の素晴らしい資料" # unordered list #: r-novice-gapminder/_episodes/13-dplyr.md:595 @@ -18055,26 +18050,24 @@ msgid "" "Researchers often want to manipulate their data from the 'wide' to the 'long'\n" "format, or vice-versa. The 'long' format is where:" msgstr "" -"Researchers often want to manipulate their data from the 'wide' to the 'long'\n" -"format, or vice-versa. The 'long' format is where:" +"研究者には「横長」データを「縦長」データに(又はその逆を)したいと\n" +"思うことがよくあります。 「縦長」形式とは:" # unordered list #: r-novice-gapminder/_episodes/14-tidyr.md:23 msgid " - each column is a variable" -msgstr " - each column is a variable" +msgstr " - 各列が変数" # unordered list #: r-novice-gapminder/_episodes/14-tidyr.md:24 msgid " - each row is an observation" -msgstr " - each row is an observation" +msgstr " - 各行が標本" #: r-novice-gapminder/_episodes/14-tidyr.md:26 msgid "" "In the 'long' format, you usually have 1 column for the observed variable and\n" "the other columns are ID variables." -msgstr "" -"In the 'long' format, you usually have 1 column for the observed variable and\n" -"the other columns are ID variables." +msgstr "「縦長」形式では、ふつう観測値は1列で、残りはIDの変数の列になります。" #: r-novice-gapminder/_episodes/14-tidyr.md:30 msgid "" @@ -18086,13 +18079,13 @@ msgid "" "been designed assuming you have 'long' format data. This tutorial will help you\n" "efficiently transform your data regardless of original format." msgstr "" -"For the 'wide' format each row is often a site/subject/patient and you have\n" -"multiple observation variables containing the same type of data. These can be\n" -"either repeated observations over time, or observation of multiple variables (or\n" -"a mix of both). You may find data input may be simpler or some other\n" -"applications may prefer the 'wide' format. However, many of `R`'s functions have\n" -"been designed assuming you have 'long' format data. This tutorial will help you\n" -"efficiently transform your data regardless of original format." +"「横長」形式は、それぞれの行には、場所/主題/患者があり、同じようなデータ型の\n" +"複数の観測変数があります。 時間を変えて繰り返し観測した値や、\n" +"複数の観測変数(又は、その両方)が、これに該当します。\n" +"データ入力がより単純と感じたり、「幅長」形式の方が良いという\n" +"アプリケーションもあるでしょうが、「R」の関数の多くは、\n" +"「縦長」形式データを前提として作られています。ここでは、\n" +"元々の形式に関係なくデータを効率的に変換する方法を学びましょう。" #: r-novice-gapminder/_episodes/14-tidyr.md:38 msgid "![](../fig/14-tidyr-fig1.png)" @@ -18106,24 +18099,23 @@ msgid "" "to the formatting of databases. The ID variables in our dataframes are similar to\n" "the fields in a database and observed variables are like the database values." msgstr "" -"These data formats mainly affect readability. For humans, the wide format is\n" -"often more intuitive since we can often see more of the data on the screen due\n" -"to its shape. However, the long format is more machine readable and is closer\n" -"to the formatting of databases. The ID variables in our dataframes are similar to\n" -"the fields in a database and observed variables are like the database values." +"これらのデータ形式は、主に読みやすさに影響します。画面の形状上、より多くのデータが見られる\n" +"横長形式を、人間は直感的に選好しやすいところですが、縦長形式の方が機械が読みやすく、\n" +"データベースの形式に近いのです。データフレームにある ID 変数は、データベースにあるフィールドの\n" +"ようなものであり、観測された変数はデータべースの値のようなものです。" # header #: r-novice-gapminder/_episodes/14-tidyr.md:46 msgid "## Getting started" -msgstr "## Getting started" +msgstr "## 手始めに" #: r-novice-gapminder/_episodes/14-tidyr.md:48 msgid "" "First install the packages if you haven't already done so (you probably\n" "installed dplyr in the previous lesson):" msgstr "" -"First install the packages if you haven't already done so (you probably\n" -"installed dplyr in the previous lesson):" +"まず、パッケージをインストールしましょう、もしまだやっていなければですが\n" +"(おそらく、前の dplyr のレッスン、インストールしているかと思います):" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:52 @@ -18140,7 +18132,7 @@ msgstr "" #: r-novice-gapminder/_episodes/14-tidyr.md:58 msgid "Load the packages" -msgstr "Load the packages" +msgstr "パーッケージをロードしましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:61 @@ -18157,7 +18149,7 @@ msgstr "" #: r-novice-gapminder/_episodes/14-tidyr.md:67 msgid "First, lets look at the structure of our original gapminder dataframe:" -msgstr "First, lets look at the structure of our original gapminder dataframe:" +msgstr "始めに、そもそもの gapminder データフレームのデータ構造を見てみましょう:" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:77 @@ -18195,14 +18187,14 @@ msgid "" "> > (`pop`,`lifeExp`,`gdpPercap`)." msgstr "" ">\n" -"> Is gapminder a purely long, purely wide, or some intermediate format?\n" +"> gapminder は、横長のみ、縦長のみ、又はその中間の形式でしょうか。\n" ">\n" ">\n" -"> > ## Solution to Challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" -"> > The original gapminder data.frame is in an intermediate format. It is not\n" -"> > purely long since it had multiple observation variables\n" -"> > (`pop`,`lifeExp`,`gdpPercap`)." +"> > 元々の gapminder data.frame は、中間の形式です。\n" +"> > 複数の観測変数(`pop`,`lifeExp`,`gdpPercap`)があるため、\n" +"> > 縦長のみのデータとは言えません。" #: r-novice-gapminder/_episodes/14-tidyr.md:102 msgid "" @@ -18215,14 +18207,14 @@ msgid "" "few operations that would need us to stretch out this dataframe any longer\n" "(i.e. 4 ID variables and 1 Observation variable)." msgstr "" -"Sometimes, as with the gapminder dataset, we have multiple types of observed\n" -"data. It is somewhere in between the purely 'long' and 'wide' data formats. We\n" -"have 3 \"ID variables\" (`continent`, `country`, `year`) and 3 \"Observation\n" -"variables\" (`pop`,`lifeExp`,`gdpPercap`). I usually prefer my data in this\n" -"intermediate format in most cases despite not having ALL observations in 1\n" -"column given that all 3 observation variables have different units. There are\n" -"few operations that would need us to stretch out this dataframe any longer\n" -"(i.e. 4 ID variables and 1 Observation variable)." +"ときどき gapminder データセットのように、観測データが複数の型の場合があります。\n" +"これは「縦長」と「横長」のデータ形式の中間のようなものです。\n" +"3つの「ID variables」(`continent`, `country`, `year`)と、3つの「観測変数」\n" +"(`pop`,`lifeExp`,`gdpPercap`)がありますね。3つの観測変数が、全ての違う\n" +"単位であり、全ての変数が1列になってはいませんが、個人的には、自分のデータを、\n" +"この中間形式にしたいと思うことが多いです。このデータフレームをより縦長に広げたい\n" +"(つまり、4つの ID 変数と1観測変数にしたい)というときに使える操作は、\n" +"ほとんどありません。" #: r-novice-gapminder/_episodes/14-tidyr.md:111 msgid "" @@ -18235,19 +18227,18 @@ msgid "" "we change the structure of the dataframe. **Note:** Some plotting functions in\n" "R actually work better in the wide format data." msgstr "" -"While using many of the functions in R, which are often vector based, you\n" -"usually do not want to do mathematical operations on values with different\n" -"units. For example, using the purely long format, a single mean for all of the\n" -"values of population, life expectancy, and GDP would not be meaningful since it\n" -"would return the mean of values with 3 incompatible units. The solution is that\n" -"we first manipulate the data either by grouping (see the lesson on `dplyr`), or\n" -"we change the structure of the dataframe. **Note:** Some plotting functions in\n" -"R actually work better in the wide format data." +"一方で、R の関数の多くは、ベクトルに基づいているものがほとんどであり、ふつうは\n" +"単位が異なる値に、数理的演算をすることは避けたいと思うでしょう。\n" +"例えば、縦長の形式のみを使って、人口、平均余命及びGDPの値の全てを使って、\n" +"ひとつ平均値を出しても、意味がないでしょう。3つの比較できない単位の値の平均と\n" +"なるのですから。解決方法は、データをまずグループ化(`dplyr` のレッスンを参照)するか、\n" +"データフレームの形式を変えることでしょう。 **注:** Rのプロット関数の中には、\n" +"横長形式のデータの方がよいものもあります。" # header #: r-novice-gapminder/_episodes/14-tidyr.md:120 msgid "## From wide to long format with gather()" -msgstr "## From wide to long format with gather()" +msgstr "## gather() を使って、横長から縦長形式へ" #: r-novice-gapminder/_episodes/14-tidyr.md:122 msgid "" @@ -18255,18 +18246,18 @@ msgid "" "'real' data (i.e. our own research data) will never be so well organized. Here\n" "let's start with the wide format version of the gapminder dataset." msgstr "" -"Until now, we've been using the nicely formatted original gapminder dataset, but\n" -"'real' data (i.e. our own research data) will never be so well organized. Here\n" -"let's start with the wide format version of the gapminder dataset." +"ここまでは、元々の gapminder データセットの形式を整えてきましたが、\n" +"'本物の' データ(つまり、研究データ)が、ちゃんと整理されていることは\n" +"ほとんどないでしょう。ここで、gapminderデータセットの横長形式から、始めてみましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/14-tidyr.md:126 msgid "> Download the wide version of the gapminder data from [here](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)" -msgstr "> Download the wide version of the gapminder data from [here](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)" +msgstr "> 横長バージョンの gapminder データを [ここ](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)からダウンロードしましょう。" #: r-novice-gapminder/_episodes/14-tidyr.md:127 msgid "and save it in your data folder." -msgstr "and save it in your data folder." +msgstr "そしてフォルダーに保存します。" #: r-novice-gapminder/_episodes/14-tidyr.md:129 msgid "" @@ -18274,9 +18265,8 @@ msgid "" "country columns to be factors, so we use the stringsAsFactors argument for\n" "`read.csv()` to disable that." msgstr "" -"We'll load the data file and look at it. Note: we don't want our continent and\n" -"country columns to be factors, so we use the stringsAsFactors argument for\n" -"`read.csv()` to disable that." +"データファイルをロードして見てみましょう。 注:大陸と国の列は、因子型にはしたくありません。\n" +"そこで、そうならないように、stringsAsFactors 引数を `read.csv()` 使いましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:134 @@ -18388,9 +18378,9 @@ msgid "" "convert from the wide to the long format. The `tidyr` function `gather()` will\n" "'gather' your observation variables into a single variable." msgstr "" -"The first step towards getting our nice intermediate data format is to first\n" -"convert from the wide to the long format. The `tidyr` function `gather()` will\n" -"'gather' your observation variables into a single variable." +"我々の目指す中間形式のデータに向かう最初のステップは、\n" +"横長から縦長形式への変換です。 `tidyr` 関数の `gather()` を使えば、\n" +"観測変数をひとつの変数に '集める(gather)' することができます。" #: r-novice-gapminder/_episodes/14-tidyr.md:191 msgid "![](../fig/14-tidyr-fig3.png)" @@ -18438,9 +18428,9 @@ msgid "" "previous lesson with dplyr. In fact, these are compatible and you can use a mix\n" "of tidyr and dplyr functions by piping them together" msgstr "" -"Here we have used piping syntax which is similar to what we were doing in the\n" -"previous lesson with dplyr. In fact, these are compatible and you can use a mix\n" -"of tidyr and dplyr functions by piping them together" +"ここでは、以前 dplyr のレッスンの中で行ったようなパイプの書き方を使いました。\n" +"実は、tidyr と dplyr 関数は互換性があり、パイプで繋ぐことで、一緒に使うことが\n" +"できるのです。" #: r-novice-gapminder/_episodes/14-tidyr.md:217 msgid "" @@ -18453,14 +18443,12 @@ msgid "" "syntax of using the `-` symbol to identify which variables are not to be\n" "gathered (i.e. ID variables)" msgstr "" -"Inside `gather()` we first name the new column for the new ID variable\n" -"(`obstype_year`), the name for the new amalgamated observation variable\n" -"(`obs_value`), then the names of the old observation variable. We could have\n" -"typed out all the observation variables, but as in the `select()` function (see\n" -"`dplyr` lesson), we can use the `starts_with()` argument to select all variables\n" -"that starts with the desired character string. Gather also allows the alternative\n" -"syntax of using the `-` symbol to identify which variables are not to be\n" -"gathered (i.e. ID variables)" +"始めに、新しいID変数(`obstype_year`)のための新しい列、新しくまとめた\n" +"観測変数(`obs_value`)、及び古い観測変数を `gather()` の中で名付けましょう。 \n" +"全ての観測変数をタイプすることもできますが、 `select()` 関数(`dplyr` レッスン参照)\n" +"でしたように、引数 `starts_with()` で目的の文字列で始まる全ての変数を選びましょう。\n" +"Gather には、集めない変数(つまりID変数)を特定する、`-` シンボルを使う\n" +"別の書き方もあります。" #: r-novice-gapminder/_episodes/14-tidyr.md:226 msgid "![](../fig/14-tidyr-fig4.png)" @@ -18504,9 +18492,9 @@ msgid "" "ID variable and 40 Observation variables with irregular variables names. The\n" "flexibility is a huge time saver!" msgstr "" -"That may seem trivial with this particular dataframe, but sometimes you have 1\n" -"ID variable and 40 Observation variables with irregular variables names. The\n" -"flexibility is a huge time saver!" +"これは、このデータフレームでは、取るに足らないことかもしれませんが、\n" +"1つの ID 変数と40の変則的な変数名を持つ観測変数がある場合も時にはあります。\n" +"柔軟性があることで、かなり時間が節約できるのです!" #: r-novice-gapminder/_episodes/14-tidyr.md:251 msgid "" @@ -18514,9 +18502,9 @@ msgid "" "type (`pop`,`lifeExp`, or `gdpPercap`) and the `year`. We can use the\n" "`separate()` function to split the character strings into multiple variables" msgstr "" -"Now `obstype_year` actually contains 2 pieces of information, the observation\n" -"type (`pop`,`lifeExp`, or `gdpPercap`) and the `year`. We can use the\n" -"`separate()` function to split the character strings into multiple variables" +"ここで `obstype_year` には、実は2種類の情報が含まれています。\n" +"観測値の形(`pop`、`lifeExp`、又は`gdpPercap`)及び `year` です。 \n" +"文字列を複数の変数に分割するには、 `separate()` 関数が使えます。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:256 @@ -18571,10 +18559,10 @@ msgid "" "> >{: .output}" msgstr "" ">\n" -"> Using `gap_long`, calculate the mean life expectancy, population, and gdpPercap for each continent.\n" -">**Hint:** use the `group_by()` and `summarize()` functions we learned in the `dplyr` lesson\n" +"> `gap_long` を使って、各大陸の平均余命、人口及びgdpPercapを計算しましょう。\n" +">**ヒント:** `dplyr` で習った `group_by()` と `summarize()` 変数を使いましょう。\n" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" "> >~~~\n" "> >gap_long %>% group_by(continent,obs_type) %>%\n" @@ -18610,7 +18598,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/14-tidyr.md:303 msgid "## From long to intermediate format with spread()" -msgstr "## From long to intermediate format with spread()" +msgstr "## spread() で縦長から中間形式へ" #: r-novice-gapminder/_episodes/14-tidyr.md:305 msgid "" @@ -18619,10 +18607,9 @@ msgid "" "can then spread our `gap_long()` to the original intermediate format or the\n" "widest format. Let's start with the intermediate format." msgstr "" -"It is always good to check work. So, let's use the opposite of `gather()` to\n" -"spread our observation variables back out with the aptly named `spread()`. We\n" -"can then spread our `gap_long()` to the original intermediate format or the\n" -"widest format. Let's start with the intermediate format." +"仕事を確認することは、とても良いことです。 `gather()` の反対の名は体を表す `spread()` を使って、\n" +"観測変数を元通りに広げてみましょう。そこから `gap_long()` を、元々の中間形式、又は、\n" +"一番横長な形式に広げることもできます。まずは、中間形式から始めましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:311 @@ -18676,9 +18663,8 @@ msgid "" "the original `gapminder`, but the order of the variables is different. Let's fix\n" "that before checking if they are `all.equal()`." msgstr "" -"Now we've got an intermediate dataframe `gap_normal` with the same dimensions as\n" -"the original `gapminder`, but the order of the variables is different. Let's fix\n" -"that before checking if they are `all.equal()`." +"元々の `gapminder` と同じ次元を持つ、中間形式のデータフレーム `gap_normal` ができましたが、\n" +"変数の順番が違います。 このふたつが、 `all.equal()` かを調べる前に、これを直しましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:371 @@ -18750,9 +18736,7 @@ msgstr "" msgid "" "We're almost there, the original was sorted by `country`, `continent`, then\n" "`year`." -msgstr "" -"We're almost there, the original was sorted by `country`, `continent`, then\n" -"`year`." +msgstr "もうすぐです。元々のは、 `country` 、 `continent` 、そして `year` でソートされていました。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:432 @@ -18772,8 +18756,8 @@ msgid "" "That's great! We've gone from the longest format back to the intermediate and we\n" "didn't introduce any errors in our code." msgstr "" -"That's great! We've gone from the longest format back to the intermediate and we\n" -"didn't introduce any errors in our code." +"すばらしい!一番縦に長い形式から、中間形式に戻し、コードにエラーが\n" +"でることもありませんでした。" #: r-novice-gapminder/_episodes/14-tidyr.md:448 msgid "" @@ -18784,12 +18768,11 @@ msgid "" "combinations) and we also need to unify our ID variables to simplify the process\n" "of defining `gap_wide`" msgstr "" -"Now lets convert the long all the way back to the wide. In the wide format, we\n" -"will keep country and continent as ID variables and spread the observations\n" -"across the 3 metrics (`pop`,`lifeExp`,`gdpPercap`) and time (`year`). First we\n" -"need to create appropriate labels for all our new variables (time*metric\n" -"combinations) and we also need to unify our ID variables to simplify the process\n" -"of defining `gap_wide`" +"さぁ、縦長のものを、全て横長に戻しましょう。横長の形式で、\n" +"国と大陸を、ID変数として置いておいて、3行列(`pop`、`lifeExp`、`gdpPercap`)\n" +"及び時間(`year`)に観測値を分けていきましょう。まず、全ての変数(time*metric の組み合わせ)\n" +"に適当なラベルを付ける必要があります。また、`gap_wide` を定義する処理を簡単にするために、\n" +"ID変数たちを統合する必要もあります。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:456 @@ -18863,9 +18846,8 @@ msgid "" "`continent`,`country`,and we have defined variable names. We're now ready to\n" "pipe in `spread()`" msgstr "" -"Using `unite()` we now have a single ID variable which is a combination of\n" -"`continent`,`country`,and we have defined variable names. We're now ready to\n" -"pipe in `spread()`" +"`unite()` を使い、`continent`と`country`を組み合わせ、ID 変数をひとつ作り、\n" +"変数名を定義しました。 `spread()` でパイプを使う準備が整いました。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:498 @@ -18987,10 +18969,10 @@ msgid "" "> >{: .language-r}" msgstr "" ">\n" -"> Take this 1 step further and create a `gap_ludicrously_wide` format data by spreading over countries, year and the 3 metrics?\n" -">**Hint** this new dataframe should only have 5 rows.\n" +"> この一つ先に進み、 `gap_ludicrously_wide` を作り、国、年及び3つの行列に展開したデータを作りましょう。\n" +">**ヒント** この新しいデータフレームには、5行しかありません。\n" ">\n" -"> > ## Solution to Challenge 3\n" +"> > ## チャレンジ3の解答\n" "> >\n" "> >~~~\n" "> >gap_ludicrously_wide <- gap_long %>%\n" @@ -19004,8 +18986,8 @@ msgid "" "Now we have a great 'wide' format dataframe, but the `ID_var` could be more\n" "usable, let's separate it into 2 variables with `separate()`" msgstr "" -"Now we have a great 'wide' format dataframe, but the `ID_var` could be more\n" -"usable, let's separate it into 2 variables with `separate()`" +"今、とても '横長な' 形式のデータフレームがありますが、 `ID_var` は、より使えるようにできるはずです。\n" +"`separate()` を使って、2変数に分けてみましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:572 @@ -19130,7 +19112,7 @@ msgstr "" #: r-novice-gapminder/_episodes/14-tidyr.md:642 msgid "There and back again!" -msgstr "There and back again!" +msgstr "そこにまた戻りました!" # unordered list #: r-novice-gapminder/_episodes/14-tidyr.md:647 @@ -20181,7 +20163,7 @@ msgid "" "project becomes more modular and easier to change. This is especially the case\n" "for which a particular input always gives a particular output." msgstr "" -"もし、計算が、一連の関数で行われていた場合、プロジェクトは、よりモジュール化され、変更するのが簡単になります。\n" +"もし一連の関数で演算が行われていた場合、プロジェクトは、よりモジュール化され、変更するのが簡単になります。\n" "これは、特定のインプットが必ず特定のアウトプットを返す場合に特にあてはまります。" # header From de25b0dc040cd19fe867f85764a50f436c8a3174 Mon Sep 17 00:00:00 2001 From: Joel Nitta Date: Wed, 29 Apr 2020 16:39:39 +0900 Subject: [PATCH 35/59] Move all docs except README to docs/ --- ChangeLog.md => docs/ChangeLog.md | 0 CultureNotes.md => docs/CultureNotes.md | 0 TranslatorGuidelines.md => docs/TranslatorGuidelines.md | 0 Translators.md => docs/Translators.md | 0 admin.md => docs/admin.md | 0 git.md => docs/git.md | 0 importing.md => docs/importing.md | 0 quickstart.md => docs/quickstart.md | 0 quickstart_ja.md => docs/quickstart_ja.md | 0 rules.md => docs/rules.md | 0 updating.md => docs/updating.md | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename ChangeLog.md => docs/ChangeLog.md (100%) rename CultureNotes.md => docs/CultureNotes.md (100%) rename TranslatorGuidelines.md => docs/TranslatorGuidelines.md (100%) rename Translators.md => docs/Translators.md (100%) rename admin.md => docs/admin.md (100%) rename git.md => docs/git.md (100%) rename importing.md => docs/importing.md (100%) rename quickstart.md => docs/quickstart.md (100%) rename quickstart_ja.md => docs/quickstart_ja.md (100%) rename rules.md => docs/rules.md (100%) rename updating.md => docs/updating.md (100%) diff --git a/ChangeLog.md b/docs/ChangeLog.md similarity index 100% rename from ChangeLog.md rename to docs/ChangeLog.md diff --git a/CultureNotes.md b/docs/CultureNotes.md similarity index 100% rename from CultureNotes.md rename to docs/CultureNotes.md diff --git a/TranslatorGuidelines.md b/docs/TranslatorGuidelines.md similarity index 100% rename from TranslatorGuidelines.md rename to docs/TranslatorGuidelines.md diff --git a/Translators.md b/docs/Translators.md similarity index 100% rename from Translators.md rename to docs/Translators.md diff --git a/admin.md b/docs/admin.md similarity index 100% rename from admin.md rename to docs/admin.md diff --git a/git.md b/docs/git.md similarity index 100% rename from git.md rename to docs/git.md diff --git a/importing.md b/docs/importing.md similarity index 100% rename from importing.md rename to docs/importing.md diff --git a/quickstart.md b/docs/quickstart.md similarity index 100% rename from quickstart.md rename to docs/quickstart.md diff --git a/quickstart_ja.md b/docs/quickstart_ja.md similarity index 100% rename from quickstart_ja.md rename to docs/quickstart_ja.md diff --git a/rules.md b/docs/rules.md similarity index 100% rename from rules.md rename to docs/rules.md diff --git a/updating.md b/docs/updating.md similarity index 100% rename from updating.md rename to docs/updating.md From 0787b4c0cc0b110606dd34f2c96286f06e486497 Mon Sep 17 00:00:00 2001 From: Joel Nitta Date: Wed, 29 Apr 2020 16:40:19 +0900 Subject: [PATCH 36/59] Update README with new location of linked docs --- README.md | 24 ++++++++++++------------ README_en.md | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c2041e45..9528ee9d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## [English README](README_en.md) -小さな貢献をしたい場合は、[クイックスタートガイド](quickstart.md)を読んでみてください。 +小さな貢献をしたい場合は、[クイックスタートガイド](docs/quickstart.md)を読んでみてください。 -資料を翻訳する前に、[翻訳者のガイドライン](TranslatorGuidelines.md)と、[行動規則](rules.md)を、読んでください +資料を翻訳する前に、[翻訳者のガイドライン](docs/TranslatorGuidelines.md)と、[行動規則](docs/rules.md)を、読んでください また、[Slackチャンネル](https://r-wakalang.herokuapp.com/), Tokyo R ワークスペースの #swcarpentry に参加することをおすすめします。ここは、翻訳を進める上で発生する疑問に関して質問するのに最適の場所です。 @@ -23,7 +23,7 @@ ここでは、あなたが、GitとGitHubについて知っているという仮定をしています。 -もし、gitをインストールするのに手助けが必要ならば、[gitのインストールガイド](git.md)を読んでみてください +もし、gitをインストールするのに手助けが必要ならば、[gitのインストールガイド](docs/git.md)を読んでみてください ## About PO files @@ -33,13 +33,13 @@ POファイルは、複数のエントリで構成されるテキスト形式の ## 初めてレッスンをインポートするとき -レッスンはサブモジュールとしてインポートされます。この作業はレッスンにつき1度だけ行われ、ほとんどの翻訳者はこれを行う必要はありません。もし、あなたが新しいレッスンをインポートしたいときには、[インポートのガイド](importing.md)を参照してください。 +レッスンはサブモジュールとしてインポートされます。この作業はレッスンにつき1度だけ行われ、ほとんどの翻訳者はこれを行う必要はありません。もし、あなたが新しいレッスンをインポートしたいときには、[インポートのガイド](docs/importing.md)を参照してください。 ## 既存のレッスンの翻訳へ貢献する **これは、翻訳者からの手助けが最も必要なタスクです!** -これは、[インポートのガイド](importing.md)で説明されているように、`swcarpentry-ja/i18n`がサブモジュールとして既に追加されていることを前提としています。あなたは、そのレッスンの翻訳に貢献したいとします。 +これは、[インポートのガイド](docs/importing.md)で説明されているように、`swcarpentry-ja/i18n`がサブモジュールとして既に追加されていることを前提としています。あなたは、そのレッスンの翻訳に貢献したいとします。 1. 個人のGitHubアカウントで、このレポジトリの"フォーク"を作成します。 (`https://github.com/swcarpentry-ja/i18n`の右上の"フォーク(fork)"をクリックします。 corner of the `https://github.com/swcarpentry-ja/i18n` webpage) @@ -66,7 +66,7 @@ cd po ls git-novice.ja.po ``` -4. POファイルを編集します。[ガイドラインに従って](rules.md), 頻繁に変更をコミットし、十分だとおもったらpull request を投稿してください。 +4. POファイルを編集します。[ガイドラインに従って](docs/rules.md), 頻繁に変更をコミットし、十分だとおもったらpull request を投稿してください。 5. 正確を期すために、あなたのPRについて、レビューが行われます。レビューがパスするまで、編集を続けます。そのようなときは、まずはじめに、組織のレポジトリに対する変更を pull してください。 @@ -80,7 +80,7 @@ PRがレビューをパスするまでステップ4と5を繰り返します いくつかのメモ: -POファイルを編集しても、翻訳されたWebサイトができあがるわけではありません。[メンテナーと管理者ガイド](admin.md)で述べられているように、これはメンテナーに任されています。 +POファイルを編集しても、翻訳されたWebサイトができあがるわけではありません。[メンテナーと管理者ガイド](docs/admin.md)で述べられているように、これはメンテナーに任されています。 POファイルを編集したあと、翻訳された Markdown ファイルを見たいときには、 `bash po4gitbook/compile.sh` を実行します。これは、あなたの変更を含めた翻訳されたバージョンを生成します。これは、`locale//`, 例, `locale/ja/git-novice`で見つけることができます。 @@ -89,20 +89,20 @@ POファイルを編集したあと、翻訳された Markdown ファイルを レッスンの(完全な)翻訳が存在しても、メインの英語のレッスンが新しくリリースされることがあります。 更新されたバージョンの英語のレッスンは、現在の翻訳されたものにマージされる必要があります。 -[レッスン更新時のガイド](updating.md)を見てください。 +[レッスン更新時のガイド](docs/updating.md)を見てください。 ## 翻訳のためのリソース -レッスンを編集するときには[翻訳者のためのガイドライン](TranslatorGuidelines.md)に従ってください。 +レッスンを編集するときには[翻訳者のためのガイドライン](docs/TranslatorGuidelines.md)に従ってください。 レッスン間で用語が一貫して使われていることを確認するために [技術用語のリスト](https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms) があります。必要に応じてこれを参照したり更新したりしてください。 -一貫性を担保するために、日本語に翻訳されない概念などの標準化された取り扱いについては、 [カルチャーノート](CultureNotes.md) を参照してください。 +一貫性を担保するために、日本語に翻訳されない概念などの標準化された取り扱いについては、 [カルチャーノート](docs/CultureNotes.md) を参照してください。 -進捗と、ゴールを記録するために[変更履歴](ChangeLog.md)を持っています。 +進捗と、ゴールを記録するために[変更履歴](docs/ChangeLog.md)を持っています。 ## メンテナーと管理者のガイド -[メンテナーと管理者のガイド](admin.md) を見てください +[メンテナーと管理者のガイド](docs/admin.md) を見てください ご協力いただきありがとうございます。たとえ小さな貢献であっても、大歓迎です。 diff --git a/README_en.md b/README_en.md index fb2445c5..d360d37e 100644 --- a/README_en.md +++ b/README_en.md @@ -2,9 +2,9 @@ ## [日本語](README.md) -Please take a look at the [quickstart guide](quickstart.md) if you wish to make small contribution(s). +Please take a look at the [quickstart guide](docs/quickstart.md) if you wish to make small contribution(s). -Before translating any material, please make sure you comply with the [Guidelines for Translators](TranslatorGuidelines.md) and read the [Rules of Conduct](rules.md). +Before translating any material, please make sure you comply with the [Guidelines for Translators](docs/TranslatorGuidelines.md) and read the [Rules of Conduct](docs/rules.md). We encourage translators to [join our slack channel](https://r-wakalang.herokuapp.com/), #swcarpentry in the Tokyo.R workspace. This is a great place to ask any questions you may have about the workflow. @@ -36,13 +36,13 @@ There are a number of free PO editors: [PoEdit](http://www.poedit.net), ## Importing a lesson for the first time -Lessons are imported as submodules. This only needs to happen once per lesson, so most translators will not need to do this. If you want to import a new lesson, please see the [guide on importing](importing.md). +Lessons are imported as submodules. This only needs to happen once per lesson, so most translators will not need to do this. If you want to import a new lesson, please see the [guide on importing](docs/importing.md). ## Contributing to a translation of an existing lesson **This is the task that we need the most help with from translators!** -This assumes that the lesson has already been added to the `swcarpentry-ja/i18n` as a submodule as described in the [guide on importing](importing.md), and you would like to contribute translations for that lesson. +This assumes that the lesson has already been added to the `swcarpentry-ja/i18n` as a submodule as described in the [guide on importing](docs/importing.md), and you would like to contribute translations for that lesson. 1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right corner of the `https://github.com/swcarpentry-ja/i18n` webpage) @@ -70,7 +70,7 @@ cd po ls git-novice.ja.po ``` -4. Edit the PO files. [As per the guidelines](rules.md), please commit your changes frequently and submit a pull request when you are satisfied with your work. +4. Edit the PO files. [As per the guidelines](docs/rules.md), please commit your changes frequently and submit a pull request when you are satisfied with your work. 5. Your PR will be reviewed for accuracy. You may need to make edits so it can pass review. When doing so, always be sure to pull changes from the organisation repository first: @@ -84,7 +84,7 @@ Repeat steps 4 and 5 until the PR passes review. A few notes: -Editing the PO file will not generate the translated website. That is left to the maintainers, as described in the [guide for maintainers and administrators](admin.md). +Editing the PO file will not generate the translated website. That is left to the maintainers, as described in the [guide for maintainers and administrators](docs/admin.md). If you want to see a translated MD file after editing the PO file, run `bash po4gitbook/compile.sh`. This generates a translated version of the lesson with your changes, which you can find at `locale//`, e.g., `locale/ja/git-novice`. @@ -94,20 +94,20 @@ If there is an existing (complete) translation of the lesson but there has a new release of the main English lessons, the updated version of the English lessons needs to be merged with the current translated one. -Please see the [guide on updating lessons](updating.md). +Please see the [guide on updating lessons](docs/updating.md). ## Resources for translations -Please follow [guidelines for translators](TranslatorGuidelines.md) when editing the lessons. +Please follow [guidelines for translators](docs/TranslatorGuidelines.md) when editing the lessons. There is a [list of technical terms](https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms) to refer to for ensuring that terms are consistently used between lessons. Please update and refer to this as needed. -Please see the [culture notes](CultureNotes.md) for a standardized treatment of concepts that don't translate literally into Japanese to ensure consistency. +Please see the [culture notes](docs/CultureNotes.md) for a standardized treatment of concepts that don't translate literally into Japanese to ensure consistency. -We have a [change log](ChangeLog.md) to track progress and goals. +We have a [change log](docs/ChangeLog.md) to track progress and goals. ## Guide for maintainers and administrators -Please see the [guide for maintainers and administrators](admin.md) +Please see the [guide for maintainers and administrators](docs/admin.md) Thank you for all your help. Even seemingly minor contributions will be appreciated! From acb08764970bce0e2567d683114909d48b752bf7 Mon Sep 17 00:00:00 2001 From: S Yokota <40444119+megane0-0@users.noreply.github.com> Date: Wed, 13 May 2020 10:13:47 +0900 Subject: [PATCH 37/59] Add files via upload --- po/shell-novice.ja.mo | Bin 396265 -> 396995 bytes po/shell-novice.ja.po | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/po/shell-novice.ja.mo b/po/shell-novice.ja.mo index 8d9c1b26f509cddb7e14fa0c8fdff9ee04aa90f8..860ad344f8d48d08844b0e2d6d3dbd5398f9d6da 100644 GIT binary patch delta 9443 zcmaLb37m~(-@x%d_k9gbk0L2Tj;)Acj9rqDy=W}iLqilsmZ<2=IY-KtWf(hy#+n(~ z27@U{NwP(SJn76vMU_Wu6YeY|b&^L{=)zV~(A*S_9oF3d0e&eGDG=9cp(7ZPc9 zpChyJcnwFo7Zyo~aU_LsR&7Vth)8@LM+OkSj&%t4sq08*d<}cxzi~J38`X2<0lZe< zk*Zj?p(7))XCp@@lJ0}Xj#MMuwuvJT;j{NUe!0erElnM{iHLO%IFhd6W{xbvfe$+J z1P%HX6L{aZg(F`Rzpteuw-TSx%8^Ngvs=>vY}Lk*f06DKZXz6R>&Pyg+s=`x*r~lE zck=!;wk3SEgWr*pMBLxek!&pSs3Xr)@Uc#g#FL;yydzt187{~8E{+t_j949|t0NWQ zJ}i&zQAc11w#U`o9O;Hvx;xT{_icJO(gKq(7T@vn(1wTaF$SCVbff`3jatD9dA)Y5P2~b zZzG(Jx8mCvjmNMQo<*(TDpthbumt-0Fa;Qgn(sj@i=9yOJ%ift08*Y`7Vw}wTZKB5 zn^Ajs92;X8wFl+CORu=NvOhH2QG@Nv{3F4^A^AJ#x^Ku2tjPhtan9koMeup$18ow4o! zM>^mntfehF%7YI5@2EYfI?%Ij#D`F~Sto3UYq34%BguFTb!4VI)}k)9_+_QF^msj z+z78nBe53Y&8X?mqps>Z620Bi1a(^`pl-JyPIWk6u!hST8qNN1Vc16F=us4FVS*#e zcu^;WBs}^G`xg_Zc@2B_HE+@Vh&3s&!c6a+=!h){FGuabmzaR1W;s$9UqBt|Cu)x)6O{ZB&VB27=xU13=I)Gzi=c>#b15NYNkg= z@*FuqLEnDmNPXP@jU)Rh;QA$cLOA=fBeU?mZyh;Be2=S45#`kW&XL-9=$f~Se*O;~ zp`ow-=*Y{YkNVY-k{meGe`7bX{vJnUdtb2jFwZ~OP^iSm2;#&6XS~i zODfz|+m*d!TpH)fLBf6Nx-tRpY2eB;#II`P$_Mn|*2b=kVPsA};K~ye(5a;>LCk1H zL8Oms?aDgBo7=kbke1WlwIi~uqbmi(H|gZs>$&n{uD#x4<6XbZW!oK!cjZ?q>fh6q z;w0?X%aw8zkl5RmmuUI)zOLL!#WxRd?Y62s*p=#}dlh|J;Zv@VRZa|X$ny#tnWRG~*G}dpr;I zw);Jj;P#oWJpmh`?%&5z51uKg`L?6pc85_Lb^-OoD>=)x2TdK+_kB>yACFaVb|mcI z&O-?zj-a;mJZb^Ip;l0Cw%3!os4ee+ntnJ|ML+6yLK_Mpb3VfRxl}&U^Qxk_M;B*dDIH8p&p@SlRaCb=6e>|Rg#RFJ{5H&x1yGR z5cMej0=1#H&sCY+nmlO1ts*{+nsF9tPt#Bf$VAQf5$fFMq4qFpo@+m?DxfyFF>3nm zSPzGzj?hZf51VaR9}i$fU0lEL&=l`Z@e1mVw-6qSdTUKW?eR9$ioZbpR+RZ(k7^-{ zS_Yziat+0z_&n-J1W|9%6!hV?Nc<`EYfCTkpcY!-Whjjru8BINEhBc0*cUqz|1|c( zOzeWUE%fGoFvb%OVmmyEdU;h?W4}Sw!(8b6)SVMYkWHD2>-B*{jXmvX1Oc1 zu@&l^jX^DV9qJE-^QimvzEszKIz5Uy0xzQ$bR2c0&ZDlKOQ@f6&I)fzN}z@-qIRe@ z&M3s?Q>8?DEIrus@&2VKbCz}5}4^@bGe6wpmu_oYnG9E(h zd8@6ibS69l^{73!&6RhF|9!hFX9>TX=}Kce%6{CD#fTC=akp3T#yzfV zBW(7%GKBY8+4iXSOO?00)m{H>S2psZKk5kFvd=q$^HB?I{EjPM(c<55GzDEe;7T{* z`@PSU5Z;OgzdGoR%oT1do!WYbTX zBi#LjD|1jj=Ike9GA<>Ua?+I_u-+;5I|bGFgiDI|Z9n5^#`jKp4f+0zxB9Q2Wg8RU z>T_38$v5^KmlOH!__r&QbpMY$&%P$XHPjxI3cE6m__8_PT&+R9eLCj4@*DAwvz@}%t?K7~cV!9jec3!k@jCWHr;w5L zI1u$@ELPaq?HPl5@+IKgR5TtneG}K%{l5@(c5^9X|AO&2YC(y25YPLI_ypkw zrD-^8AO$}p{?c8H2xgTt!k-Z2YI!3QdEc?3k#9-w|Ddw5e_+U}Vx&GVnp8FNG>*L2 z*zfx@)s5)a?icqNJBI}|jJ!g|y*246wvM4<-jBpec(fK%f#20OvV->}>o79-Ar>Qk zVw|y`>C@^O{e9t=C+iz&&5M%_jJ-6itHBVLHD;e8iV+ZX}ibO>qZ){*aOHh)-#0hLCV)8)J{g zO6`~%!tbFTFoQc7nMZgxh6%?%!lEPG;87!22%qodt&tO*jlHCvdW<0^elxz0vGK<4 znxAke;WxW@BUrYpk(+gHSMe}}9%OVg_GfqL9!63~m=>{VPh)@ioIw4H$b?=-e#Y%s z4LA2Tl7nYZhyJZT#{Mk-qOZ3|`}U&)ymy{3GKTjHQSX*p1~3wL@uKQLBa^T>-p-46 zQBTCvPa6B@wgw4CVrXFHK}IeS|JYMTN|3Jk5F>LjeyFiOt@5At7GsBJyavu6X6y$^ z@^EhoR$(X7&mUnV8uJs4-xhdvq>*~yx)u7nn{~z>;bj>B_mms)6LKR*MudK zjJ;%f1z1$Ps1S@CB&Y{d0v2GWkk`OQlUQs;7)rcO{H|$6ex#yp(^+Jcmp;?TIN~qP z@)|a9wy{4_znWv@dE(C`8~e%E%|F-h-6b*y^;0Q%p0W4+=lCP>-BXMt5#MP6+Xate zD{QgQ*rWFqTu!*|A|p}k?-QtBLZ_E{BlaWe(OrJIu|M%zVjIdWoXTQEfBO|=;9=`Z zBlpmQ8gZlkHF5O#94`mq1=0%rH-Zm`xCI=7U9jFJ)Tc}5`Zwn(p zcpYl`OIwZoF`2&2+lKA78;Rrn=cq??@f}7!!0osj13QiVTyM6^$Vj~fdhnpv?m;Yy zN3x9lbJ?f6jjSNUU313w;0)9sG;2_Mo`d?sRsPG&_{R#YKLZ`c4TYBvypiBnD?Pl9kn6t{E>&j z7)wM5b;!1&e!;vQ@g(XHUclS%C)5%9*Kuzos-P~qHmFn9FA^SyIs&hu50_&Nd;#JfW^X8Aed}Z(f!m+63jzG;9#K$ld zb?sb5M#wMaPI^Pw3U!h7!V35jYDmMWdkDXeeG7?9K4YXM z;heL4uwb>%jdaEJs1^T?-AT9Loag0#d!KZz&wJ;`*e{K|sQbTw2mKgK2zxzqa>ziq zD>lLnn2kB8+w=8YWB-zI7|#Mx#8aRfdS9VLVCG(L{aZ;rAw`HC+le$aD6M-NRL5z}hGm_bc^aj|i+F|qYy>eThcHf~bC;rt8tIrFM? z889Ys^pK&xo{7&Sjv3%<`nvnK$)u z_80f(WTk`y>EYm(aEO0%!=bcrXm>c6t^WtshJ%yB!KwCPYB)G299S3*PLmj)&zHX@ z5DqL42Uh$)sluW8;n2o#a8o$6E*wgwfZX)u1uLfiQB3&G&?}Mpf^%}Rm*#F<;Jw_^ zZARe(nN{n$qlfq}BrVF_u_GKv4hPAa5l*7!U^uYe)<4}geVJ|j6m23+558_|ULFqa z3c(M()*$k|>8)^#4uU4AQTm3Tfthe2{O%pg{?~F^QSi7Q20% z`u&HE?(d@%U;mia`jCDhg`6Am*X_z*xJSE|y}-6_bvQ679Eg;j`SspH?yW8U%kXC8 zWToZom_}Kbch3z6Ue|_ba~SqH7d9-&-9=d&!U4uVd45KDQz|nx-K{qH!N2sFk=5>Q zx$(c9xX`?CaLtVlrRSwGcsgwH4|ne9t2RGrlPTk;mfYD)@uq(^I{Gg|9n7?4(T)v& zshA$WoR&Lvu?}WZ;NcNt292s_`^}=r@Wl@rGj`O7>fzu<+l)DRQ>ja*B5xr>zM;Us zEz{OAEqB_yoIOjLMAxb1`&;n^>o5o4-nR_|JP z;GO=ztZ-c-f7%LxjJ!1q!bvZ)3iDES=53kBy0HuUkExH&*~`qnsw2#T^~NEzL`NgU zI-L{_Eei)%>k4Jz@5v4aR_QuruW4c?G2{=2c;a3bpG6|3rkmOxES*+a)`T96rHmc6t~#FB=odGwruS7~H~~F-gqr z(!UI8U`<}~3|6_f8Y5dgup#edTEvO=mlK28A~RJn1{wLAR^-m$MD#}9*6*DU47g73 z44OlN{H>fGOii|(GZu`V)J(&Atx(St@@HJoSz!nMtu`GYZ-s^QK|9RktdO+Ah(l2bBYd6autMNwjDaxMg z|ExDK{YIKKwj6JG=Gg7Vy#4u#sY9ElbBE+EVWIqQUm1qkcAz)iSirP!aX6UF=E&?E zD%>!Rb}x-&pru}sdL2?WQ@HH=IE~IYEOL--CW6k-b&Yj6ktfQ;PG|TS49nYDE Qw-xSHEpv0WY1r|903VwwH~;_u delta 7496 zcmZA5d4Nt;AHeb7%spo?mXNKo490Gl83r@9$ugEEW0@EvsTql}gpln)-jpParHt(@ zVJMN93L#~UWQoS|GDK2Hyte55{_c7HdjI;|-+9hC_ndRjIrrRW=i+jg7nEB!w|pQw zM5IM+PiA9Y9Z$N4ieyH4GM{*7eNR@3NUs=A`Voi5dJ;pN-oTU2I3LsS5^mx5#D<9!ILNPwWeM`Zt=tBW}XxxVSRH?)@t0slZ802 zr6+x9kWKU?o!>KBdGb5y`&xVQ2Ie+Oj=1(2PoBZM-92f-?+mdeR7oquw9~ zC*lz-hFyDkQXKnX861w~@U39{0hT5H5)0#xSPD<$V|XJN7wPRuRpLNpE~<0U7OP=q z@P|2Al6Vt7f_pI>f5y^y0rdv=urh`{>q!Z$iA690wOl)V0(+pA8-d#Jw~+b*vWyGu z*&5WL{0g;)c^HpZPWz|68=i(*VF2~f%tyW9@?iS*pvN&l`c+KAARM4hDJD@JJ9@qlcVMn}%Z870RcjHMoig*WB!6xaR zRK(u+B#y;yxCOO=#WNU@NG{rOp)JhBp12%m;6r=`-|p{87Ct~7nb|LS@;d&ElhyKhyd%+vVKR?qcD+I z$9uAbAMQ>;GQKyB^^1+)b`5)Hrkixzu`U%}Lft1yz3bNXOQ;=Kjp=wA8(^zhZiGi+ zZQ`}qJ%kYqa8ZYZ=s9lvKa09iOh=s)JFzcb#%%16<$C-J>N6}g*A3}Y*ot@<_Qwra z6Ca=F$y{uWF?a%X4usElt0C|l7oXDOGgugBX0v>7;ZmMGE!^}WLy9#&Vh&*P3Qtn; z>`G4z#^vxx7{P?qp8UYG9`h*;r+oX*JlRJ)WE1sb{Fj~-z_y#+7X9>Aw&qaQU$3t{ z@hDJw2g?N?`_7Zc8S?nO?xm6Xz1#Z_<0@L-_@F0YRCE@LlmF5oPp*-E=cp&gY0$67 zJZXm8kMror_uzzk6x~jG@*?@Zz;{V6f69}iA*{cT&oDG3Og`($d2YNRpV>^07F_h? z2o-&C#gjOk@rNhhQo%P@=?U?)Yo5%)cdvW$6X_8*ctq558|!1%Ew_qx-liiowDTQL z{zd+Se|z#M8&2v&Rul72280{op0ci}k@H%xgpqT^qe~enfIZ6@`GUw)YPtN=>KZvi`iD_Q0{Pre21dr?)i@)ANFUV1$Ub^-97i%TA2c`8mkP?ZHZlcAx1l2P-)n0mhj?sz zBTs5Q9gROC{gaLSN_uFD@n6qZIvfA>ey58G$Xu3PR#zhrxKYiXMv9ZMdM_j8si1Lh zBNJ(PY9AwIx$%+bjlZm}WEiPMzRvxPMCc7)GD1r!RT5clh+io6e!`7o7L{6e^GJ2WS_T)Zl%O9QX^2cE{;&!O#gu$r!CZRUyJ=6|;j#|$F)DgRYTECg&mkUT0E;K_N z>J5@nGYmm(&B7s zLMtvZ*BOgiFb#EN2BTIGKrJ{QwI^#)dw3A_Xmts-!6EZp{)*U;I1Y7$2BN;~CSV-S z#LC=XzU87BUPP^^>U`rLM4F?%wUSYLJOTB_t5DC1dr*7yUu05C?FGg^a>Zal;wMo@ zq9f`YdJZFSLNI*^2DE3NaiQ)F{%|%J-$WhK!tXiD1+9k3q{m_}3}83RLw)x3-Z%bR zu_JaMUX1$kx`fZ;>kEza!3zsn|5~tBwkt3nb%-uwE4+s+UunL`_$Qv$$TF6hs6EcY z#<&o5&KyQPcw9$4s5Dz_{3F~{oKCzKH9eJgydL!yEn)q);9?C4_3<~-$31JTW>V-9TlW+ zGIENzcCL|lEbyg~lcYcSm630;!e&O4^nC0=Tym?Cjl=_S0CB`Nf2$A3TU_YuUbx-J zC-@!e2#na_w&3J%T!l;U3N3zdr;!m7;|5rFf1}X|U>}F*j%pu;4b1>rwdp`y5;9}zYM~(a!-#^BB zr=nRu@si^APfoBkW8FO0ke(;q?C*PuWlVYwE~8xDX6tjC9>e|C{MgX=HRL&~-O)kq@ol*`O+^6kVa#D#x1{_%Y# zrW4B_Mvg-U>i*IED(hccHi(N!xagXjTowK_GL{U}aX8u=Zf6{Wxx`CQpKbTQjI1Gk zF z{^xenhi+D%#6_fk^N-uv`m%_gBOZXOaX0GDI6TDq%X1Fu&bJqLaHG?x`ImauU;htL zM?T2}tp91X%UCKAsbsCc{x6}<+VWx6|MD4$6{)CT0V{8kUZbFuk8mBXCB1tgE9=k} zw*J9nQxPj6#Al0I8A`tVV%FbBx;|q4k>q?ZX4xBh4GM$~7vA9ct(m9SEe3U*)s zua~s`&Ni%+_5Z=xg8GP#mL{FwQ_5KXJ0Y86QV-_9ef*yEZjUn}7*XB|e<4VZ3RWiY z`}zng*C`*UU)B15FhoRJiQ|W*I1rCjxBmG)v6l5uyKQS*{~11A$I3JcR;^1d(8d^yrVPl;2UmAZmvND-C zrLpz5<{z6_{|l*jy!Bru&G0T2zJWz)=%fTInK-kVl?c-Bx3IE|^5t970Nk2rWfoL#V`Tst-%qms))?BJXG6Rab%ROjXk{MpB0NtVo9v!(nWwG% zNu1cp&5_s?>%XLS;RMo4bhiH1`!4FLN$XVCZlwhA{tPQ~ z@pOOde_9P6;3nfws12+#(E4w`ii6xEsD~-!uaapc9ET6K0l&ftL#*tiK;}^E9}uF4 zSvgHS8`tB|SFA)*pz?4lZxAPqa1|cF2gEx@vMl+1+pBKbwja%MBVL9{jO^txZq7uH zv;GEEd%Ts+lsh|~^{*KhO|br3>z9d4Dt=f^y1wVXK;4+G;jfrC$u)52WF}hyMrw+c zd!)C0%gP;YlsKJ9Mt$+`SQ$+j{g=UZt*d;pWM$S!U%n1uA`L{jb%s%dP*VviKu6^gHk;es90R`mgIs zE8R|a0CkW5VU^p+KFYDOg1F{t>mTcXK-wpN;!3=Qdv*OUUgIXyOCMX=#t*N3;+A3j zS~ecyGpHNPMbxb~X&oa#`~zzKQlDA>WAZ3w5f9y9C6?d4&)w{Aw9(2w(of+QT)D~m zr|k4xE5r0HFp&#AI9$Vmc1kK?{^>36Uk@sOR?|9qc@FA)EQ%dq>mJX*Ys0bNcLzGDkTv&(HLub_T- zEJUqnKUT#H7>NaUyS+auXb+4beKP6?%m&mCngggk58vbVfwEYaxCZLqcBy+<|61Ye zB$UNfSOd3XW&9NfVfbF_|0^~MHUFnr1&^ZUyN!Bme{7%izb87OZfqZ*eot&geKZHL zJpO?Z7`~r%tv#%>-`NJ!i2Gnq+=QL6`1fw_?uR;b`%!z+<$!yAPs9k~xu^}?h}x07 zprHp{dTp#kdJ1Yoh6aKcGf;;-2X)BuP){(Ig5F2{ka*+=CJk0X9kE!{k?4pz=?0^A zXlgKCj5-3JV+4MOb?_o;`9R4-?nbpSfrJ*Q6}^V_aTZ44cGQjK9O@1J30m$)w`0bj zmTQU4u{&x9=AxEcgbarZVSj`I(u#}HBn(8IWRp;bXgO+2zYTglX!#@Vk+jDq z{Qf@X;$iHD(~r8zbq3!fE_%!zy;k6C;%lf4oBR_mJ6-?txX@>{8ughTMxCAiU^>=2 zZvC&^EZj%Z7pcNm{W z5;r1We;ek11?Qul{|ASKNkE4iZSmBS9-JRyfQ*a#cZ{ydjJ3c diff --git a/po/shell-novice.ja.po b/po/shell-novice.ja.po index b0bf2e93..108bfdc3 100644 --- a/po/shell-novice.ja.po +++ b/po/shell-novice.ja.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2018-10-27 17:18+0900\n" +"PO-Revision-Date: 2020-05-13 09:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: \n" +"Last-Translator: Satoshi Yokota \n" "Language-Team: Japanese \n" "Language: ja\n" -"X-Generator: Poedit 2.2\n" +"X-Generator: Poedit 2.3\n" # Front Matter #: shell-novice/CONDUCT.md:1 @@ -826,27 +826,27 @@ msgstr "### Background" #: shell-novice/_episodes/01-intro.md:22 msgid "At a high level, computers do four things:" -msgstr "At a high level, computers do four things:" +msgstr "コンピューターは以下の4つのことを高度におこなっています。" # unordered list #: shell-novice/_episodes/01-intro.md:24 msgid "- run programs" -msgstr "- run programs" +msgstr "- プログラムを実行する" # unordered list #: shell-novice/_episodes/01-intro.md:25 msgid "- store data" -msgstr "- store data" +msgstr "- データを保存する" # unordered list #: shell-novice/_episodes/01-intro.md:26 msgid "- communicate with each other, and" -msgstr "- communicate with each other, and" +msgstr "- 他のコンピューターとやりとりをする" # unordered list #: shell-novice/_episodes/01-intro.md:27 msgid "- interact with us" -msgstr "- interact with us" +msgstr "- 私たちとやりとりをする" #: shell-novice/_episodes/01-intro.md:29 msgid "" @@ -855,10 +855,10 @@ msgid "" "While such hardware interfaces are becoming more commonplace, most interaction is still\n" "done using screens, mice, touchpads and keyboards." msgstr "" -"They can do the last of these in many different ways,\n" -"including through a keyboard and mouse, or touch screen interfaces, or speech recognition using systems.\n" -"While such hardware interfaces are becoming more commonplace, most interaction is still\n" -"done using screens, mice, touchpads and keyboards." +"私たちとのやりとりは様々な方法で行います。\n" +"例えば、キーボードやマウスを使ったり、タッチスクリーンを使ったり、音声認識を使ったりです。\n" +"このようなハードウェアインターフェイスは一般的になりつつありますが、ほとんどのやりとりはまだ\n" +"画面とマウスやタッチパッドとキーボードを用いて行われます。" #: shell-novice/_episodes/01-intro.md:34 msgid "" @@ -867,10 +867,10 @@ msgid "" "\"click\" translates easily into \"do the thing I want\". But this magic relies on \n" "wanting a simple set of things, and having programs that can do exactly those things." msgstr "" -"We are all familiar with **graphical user interfaces** (GUI - windows, icons and pointers). \n" -"They are easy to learn and fantastic for simple tasks where a vocabulary consisting of\n" -"\"click\" translates easily into \"do the thing I want\". But this magic relies on \n" -"wanting a simple set of things, and having programs that can do exactly those things." +"私たちは皆「グラフィカルユーザーインテーフェイス (GUI)」とよばれる、ウインドウやアイコンやポインターで操作することに慣れています。\n" +"それらは簡単になれることができ、単純なタスクをこなすのには適しています。\n" +"「クリック」は「やりたいことをやってください」を意味します。 \n" +"しかし、この魔法のような単純さは、やりたいことが単純で、それを行うプログラムが存在していなければなりません。" #: shell-novice/_episodes/01-intro.md:39 msgid "" From a0375509c5df120b74a057de5862d0a05a639200 Mon Sep 17 00:00:00 2001 From: Joel Nitta Date: Thu, 14 May 2020 14:16:55 +0900 Subject: [PATCH 38/59] Update .gitignore Ignore .mo files (binary files generated by PO editors) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1d288326..ddd2060e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ locale/ +*.mo From cecf7a0db7e7dbb6c1e832619e434111fc277054 Mon Sep 17 00:00:00 2001 From: S Yokota <40444119+megane0-0@users.noreply.github.com> Date: Wed, 8 Jul 2020 13:36:20 +0900 Subject: [PATCH 39/59] Add files via upload partial translation 20200707 --- shell-novice.ja.po | 12988 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 12988 insertions(+) create mode 100644 shell-novice.ja.po diff --git a/shell-novice.ja.po b/shell-novice.ja.po new file mode 100644 index 00000000..da45a990 --- /dev/null +++ b/shell-novice.ja.po @@ -0,0 +1,12988 @@ +# Japanese translation of the Software Carpentry Unix Shell Lesson +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# This file is distributed under the same license as the PACKAGE package. +# Software-Carpentry Japanese-Team , 2019, 2020. +# +msgid "" +msgstr "" +"Project-Id-Version: i18n\n" +"Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" +"POT-Creation-Date: 2018-09-15 22:59:57+0900\n" +"PO-Revision-Date: 2020-07-08 13:28+0900\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Last-Translator: Satoshi Yokota \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"X-Generator: Poedit 2.3.1\n" + +# Front Matter +#: shell-novice/CONDUCT.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: \"Contributor Code of Conduct\"\n" +"permalink: /conduct/\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: \"Contributor Code of Conduct\"\n" +"permalink: /conduct/\n" +"---" + +#: shell-novice/CONDUCT.md:6 +msgid "" +"As contributors and maintainers of this project,\n" +"we pledge to respect all people who contribute through reporting issues,\n" +"posting feature requests,\n" +"updating documentation,\n" +"submitting pull requests or patches,\n" +"and other activities." +msgstr "" +"As contributors and maintainers of this project,\n" +"we pledge to respect all people who contribute through reporting issues,\n" +"posting feature requests,\n" +"updating documentation,\n" +"submitting pull requests or patches,\n" +"and other activities." + +#: shell-novice/CONDUCT.md:13 +msgid "" +"We are committed to making participation in this project a harassment-free experience for everyone,\n" +"regardless of level of experience,\n" +"gender,\n" +"gender identity and expression,\n" +"sexual orientation,\n" +"disability,\n" +"personal appearance,\n" +"body size,\n" +"race,\n" +"ethnicity,\n" +"age,\n" +"or religion." +msgstr "" +"We are committed to making participation in this project a harassment-free experience for everyone,\n" +"regardless of level of experience,\n" +"gender,\n" +"gender identity and expression,\n" +"sexual orientation,\n" +"disability,\n" +"personal appearance,\n" +"body size,\n" +"race,\n" +"ethnicity,\n" +"age,\n" +"or religion." + +#: shell-novice/CONDUCT.md:26 +msgid "" +"Examples of unacceptable behavior by participants include the use of sexual language or imagery,\n" +"derogatory comments or personal attacks,\n" +"trolling,\n" +"public or private harassment,\n" +"insults,\n" +"or other unprofessional conduct." +msgstr "" +"Examples of unacceptable behavior by participants include the use of sexual language or imagery,\n" +"derogatory comments or personal attacks,\n" +"trolling,\n" +"public or private harassment,\n" +"insults,\n" +"or other unprofessional conduct." + +#: shell-novice/CONDUCT.md:33 +msgid "" +"Project maintainers have the right and responsibility to remove, edit, or reject\n" +"comments, commits, code, wiki edits, issues, and other contributions\n" +"that are not aligned to our [Code of Conduct][coc].\n" +"Project maintainers who do not follow the Code of Conduct may be removed from the project team." +msgstr "" +"Project maintainers have the right and responsibility to remove, edit, or reject\n" +"comments, commits, code, wiki edits, issues, and other contributions\n" +"that are not aligned to our [Code of Conduct][coc].\n" +"Project maintainers who do not follow the Code of Conduct may be removed from the project team." + +#: shell-novice/CONDUCT.md:38 +msgid "" +"Instances of abusive, harassing, or otherwise unacceptable behavior\n" +"may be reported by following our [reporting guidelines][coc-reporting]." +msgstr "" +"Instances of abusive, harassing, or otherwise unacceptable behavior\n" +"may be reported by following our [reporting guidelines][coc-reporting]." + +# unordered list +#: shell-novice/CONDUCT.md:42 +msgid "- [Software and Data Carpentry Code of Conduct][coc]" +msgstr "- [Software and Data Carpentry Code of Conduct][coc]" + +# unordered list +#: shell-novice/CONDUCT.md:43 +msgid "- [Code of Conduct Reporting Guide][coc-reporting]" +msgstr "- [Code of Conduct Reporting Guide][coc-reporting]" + +#: shell-novice/CONDUCT.md:45 +msgid "{% include links.md %}" +msgstr "{% include links.md %}" + +# header +#: shell-novice/CONTRIBUTING.md:1 +msgid "# Contributing" +msgstr "# Contributing" + +#: shell-novice/CONTRIBUTING.md:3 +msgid "" +"[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,\n" +"and we welcome contributions of all kinds:\n" +"new lessons,\n" +"fixes to existing material,\n" +"bug reports,\n" +"and reviews of proposed changes are all welcome." +msgstr "" +"[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,\n" +"and we welcome contributions of all kinds:\n" +"new lessons,\n" +"fixes to existing material,\n" +"bug reports,\n" +"and reviews of proposed changes are all welcome." + +# header +#: shell-novice/CONTRIBUTING.md:10 +msgid "## Contributor Agreement" +msgstr "## Contributor Agreement" + +#: shell-novice/CONTRIBUTING.md:12 +msgid "" +"By contributing,\n" +"you agree that we may redistribute your work under [our license](LICENSE.md).\n" +"In exchange,\n" +"we will address your issues and/or assess your change proposal as promptly as we can,\n" +"and help you become a member of our community.\n" +"Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" +"agrees to abide by our [code of conduct](CONDUCT.md)." +msgstr "" +"By contributing,\n" +"you agree that we may redistribute your work under [our license](LICENSE.md).\n" +"In exchange,\n" +"we will address your issues and/or assess your change proposal as promptly as we can,\n" +"and help you become a member of our community.\n" +"Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" +"agrees to abide by our [code of conduct](CONDUCT.md)." + +# header +#: shell-novice/CONTRIBUTING.md:20 +msgid "## How to Contribute" +msgstr "## How to Contribute" + +#: shell-novice/CONTRIBUTING.md:22 +msgid "" +"The easiest way to get started is to file an issue\n" +"to tell us about a spelling mistake,\n" +"some awkward wording,\n" +"or a factual error.\n" +"This is a good way to introduce yourself\n" +"and to meet some of our community members." +msgstr "" +"The easiest way to get started is to file an issue\n" +"to tell us about a spelling mistake,\n" +"some awkward wording,\n" +"or a factual error.\n" +"This is a good way to introduce yourself\n" +"and to meet some of our community members." + +# ordered list +#: shell-novice/CONTRIBUTING.md:29 +msgid "1. If you do not have a [GitHub][github] account," +msgstr "1. If you do not have a [GitHub][github] account," + +#: shell-novice/CONTRIBUTING.md:30 +msgid "" +" you can [send us comments by email][contact].\n" +" However,\n" +" we will be able to respond more quickly if you use one of the other methods described below." +msgstr "" +" you can [send us comments by email][contact].\n" +" However,\n" +" we will be able to respond more quickly if you use one of the other methods described below." + +# ordered list +#: shell-novice/CONTRIBUTING.md:34 +msgid "2. If you have a [GitHub][github] account," +msgstr "2. If you have a [GitHub][github] account," + +#: shell-novice/CONTRIBUTING.md:35 +msgid "" +" or are willing to [create one][github-join],\n" +" but do not know how to use Git,\n" +" you can report problems or suggest improvements by [creating an issue][issues].\n" +" This allows us to assign the item to someone\n" +" and to respond to it in a threaded discussion." +msgstr "" +" or are willing to [create one][github-join],\n" +" but do not know how to use Git,\n" +" you can report problems or suggest improvements by [creating an issue][issues].\n" +" This allows us to assign the item to someone\n" +" and to respond to it in a threaded discussion." + +# ordered list +#: shell-novice/CONTRIBUTING.md:41 +msgid "3. If you are comfortable with Git," +msgstr "3. If you are comfortable with Git," + +#: shell-novice/CONTRIBUTING.md:42 +msgid "" +" and would like to add or change material,\n" +" you can submit a pull request (PR).\n" +" Instructions for doing this are [included below](#using-github)." +msgstr "" +" and would like to add or change material,\n" +" you can submit a pull request (PR).\n" +" Instructions for doing this are [included below](#using-github)." + +# header +#: shell-novice/CONTRIBUTING.md:46 +msgid "## Where to Contribute" +msgstr "## Where to Contribute" + +# ordered list +#: shell-novice/CONTRIBUTING.md:48 +msgid "1. If you wish to change this lesson," +msgstr "1. If you wish to change this lesson," + +#: shell-novice/CONTRIBUTING.md:49 +msgid "" +" please work in ,\n" +" which can be viewed at ." +msgstr "" +" please work in ,\n" +" which can be viewed at ." + +# ordered list +#: shell-novice/CONTRIBUTING.md:52 +msgid "2. If you wish to change the example lesson," +msgstr "2. If you wish to change the example lesson," + +#: shell-novice/CONTRIBUTING.md:53 +msgid "" +" please work in ,\n" +" which documents the format of our lessons\n" +" and can be viewed at ." +msgstr "" +" please work in ,\n" +" which documents the format of our lessons\n" +" and can be viewed at ." + +# ordered list +#: shell-novice/CONTRIBUTING.md:57 +msgid "3. If you wish to change the template used for workshop websites," +msgstr "3. If you wish to change the template used for workshop websites," + +#: shell-novice/CONTRIBUTING.md:58 +msgid "" +" please work in .\n" +" The home page of that repository explains how to set up workshop websites,\n" +" while the extra pages in \n" +" provide more background on our design choices." +msgstr "" +" please work in .\n" +" The home page of that repository explains how to set up workshop websites,\n" +" while the extra pages in \n" +" provide more background on our design choices." + +# ordered list +#: shell-novice/CONTRIBUTING.md:63 +msgid "4. If you wish to change CSS style files, tools," +msgstr "4. If you wish to change CSS style files, tools," + +#: shell-novice/CONTRIBUTING.md:64 +msgid "" +" or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,\n" +" please work in ." +msgstr "" +" or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,\n" +" please work in ." + +# header +#: shell-novice/CONTRIBUTING.md:67 +msgid "## What to Contribute" +msgstr "## What to Contribute" + +#: shell-novice/CONTRIBUTING.md:69 +msgid "" +"There are many ways to contribute,\n" +"from writing new exercises and improving existing ones\n" +"to updating or filling in the documentation\n" +"and submitting [bug reports][issues]\n" +"about things that don't work, aren't clear, or are missing.\n" +"If you are looking for ideas,\n" +"please see [the list of issues for this repository][issues],\n" +"or the issues for [Data Carpentry][dc-issues]\n" +"and [Software Carpentry][swc-issues] projects." +msgstr "" +"There are many ways to contribute,\n" +"from writing new exercises and improving existing ones\n" +"to updating or filling in the documentation\n" +"and submitting [bug reports][issues]\n" +"about things that don't work, aren't clear, or are missing.\n" +"If you are looking for ideas,\n" +"please see [the list of issues for this repository][issues],\n" +"or the issues for [Data Carpentry][dc-issues]\n" +"and [Software Carpentry][swc-issues] projects." + +#: shell-novice/CONTRIBUTING.md:79 +msgid "" +"Comments on issues and reviews of pull requests are just as welcome:\n" +"we are smarter together than we are on our own.\n" +"Reviews from novices and newcomers are particularly valuable:\n" +"it's easy for people who have been using these lessons for a while\n" +"to forget how impenetrable some of this material can be,\n" +"so fresh eyes are always welcome." +msgstr "" +"Comments on issues and reviews of pull requests are just as welcome:\n" +"we are smarter together than we are on our own.\n" +"Reviews from novices and newcomers are particularly valuable:\n" +"it's easy for people who have been using these lessons for a while\n" +"to forget how impenetrable some of this material can be,\n" +"so fresh eyes are always welcome." + +# header +#: shell-novice/CONTRIBUTING.md:86 +msgid "## What *Not* to Contribute" +msgstr "## What *Not* to Contribute" + +#: shell-novice/CONTRIBUTING.md:88 +msgid "" +"Our lessons already contain more material than we can cover in a typical workshop,\n" +"so we are usually *not* looking for more concepts or tools to add to them.\n" +"As a rule,\n" +"if you want to introduce a new idea,\n" +"you must (a) estimate how long it will take to teach\n" +"and (b) explain what you would take out to make room for it.\n" +"The first encourages contributors to be honest about requirements;\n" +"the second, to think hard about priorities." +msgstr "" +"Our lessons already contain more material than we can cover in a typical workshop,\n" +"so we are usually *not* looking for more concepts or tools to add to them.\n" +"As a rule,\n" +"if you want to introduce a new idea,\n" +"you must (a) estimate how long it will take to teach\n" +"and (b) explain what you would take out to make room for it.\n" +"The first encourages contributors to be honest about requirements;\n" +"the second, to think hard about priorities." + +#: shell-novice/CONTRIBUTING.md:97 +msgid "" +"We are also not looking for exercises or other material that only run on one platform.\n" +"Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;\n" +"in order to be usable,\n" +"our lessons must run equally well on all three." +msgstr "" +"We are also not looking for exercises or other material that only run on one platform.\n" +"Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;\n" +"in order to be usable,\n" +"our lessons must run equally well on all three." + +# header +#: shell-novice/CONTRIBUTING.md:102 +msgid "## Using GitHub" +msgstr "## Using GitHub" + +#: shell-novice/CONTRIBUTING.md:104 +msgid "" +"If you choose to contribute via GitHub,\n" +"you may want to look at\n" +"[How to Contribute to an Open Source Project on GitHub][how-contribute].\n" +"In brief:" +msgstr "" +"If you choose to contribute via GitHub,\n" +"you may want to look at\n" +"[How to Contribute to an Open Source Project on GitHub][how-contribute].\n" +"In brief:" + +# ordered list +#: shell-novice/CONTRIBUTING.md:109 +msgid "1. The published copy of the lesson is in the `gh-pages` branch of the repository" +msgstr "1. The published copy of the lesson is in the `gh-pages` branch of the repository" + +#: shell-novice/CONTRIBUTING.md:110 +msgid "" +" (so that GitHub will regenerate it automatically).\n" +" Please create all branches from that,\n" +" and merge the [master repository][repo]'s `gh-pages` branch into your `gh-pages` branch\n" +" before starting work.\n" +" Please do *not* work directly in your `gh-pages` branch,\n" +" since that will make it difficult for you to work on other contributions." +msgstr "" +" (so that GitHub will regenerate it automatically).\n" +" Please create all branches from that,\n" +" and merge the [master repository][repo]'s `gh-pages` branch into your `gh-pages` branch\n" +" before starting work.\n" +" Please do *not* work directly in your `gh-pages` branch,\n" +" since that will make it difficult for you to work on other contributions." + +# ordered list +#: shell-novice/CONTRIBUTING.md:117 +msgid "2. We use [GitHub flow][github-flow] to manage changes:" +msgstr "2. We use [GitHub flow][github-flow] to manage changes:" + +#: shell-novice/CONTRIBUTING.md:118 +msgid "" +" 1. Create a new branch in your desktop copy of this repository for each significant change.\n" +" 2. Commit the change in that branch.\n" +" 3. Push that branch to your fork of this repository on GitHub.\n" +" 4. Submit a pull request from that branch to the [master repository][repo].\n" +" 5. If you receive feedback,\n" +" make changes on your desktop and push to your branch on GitHub:\n" +" the pull request will update automatically." +msgstr "" +" 1. Create a new branch in your desktop copy of this repository for each significant change.\n" +" 2. Commit the change in that branch.\n" +" 3. Push that branch to your fork of this repository on GitHub.\n" +" 4. Submit a pull request from that branch to the [master repository][repo].\n" +" 5. If you receive feedback,\n" +" make changes on your desktop and push to your branch on GitHub:\n" +" the pull request will update automatically." + +#: shell-novice/CONTRIBUTING.md:126 +msgid "" +"Each lesson has two maintainers who review issues and pull requests\n" +"or encourage others to do so.\n" +"The maintainers are community volunteers,\n" +"and have final say over what gets merged into the lesson." +msgstr "" +"Each lesson has two maintainers who review issues and pull requests\n" +"or encourage others to do so.\n" +"The maintainers are community volunteers,\n" +"and have final say over what gets merged into the lesson." + +# header +#: shell-novice/CONTRIBUTING.md:131 +msgid "## Other Resources" +msgstr "## Other Resources" + +#: shell-novice/CONTRIBUTING.md:133 +msgid "" +"General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" +"happens on the [discussion mailing list][discuss-list],\n" +"which everyone is welcome to join.\n" +"You can also [reach us by email][contact]." +msgstr "" +"General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" +"happens on the [discussion mailing list][discuss-list],\n" +"which everyone is welcome to join.\n" +"You can also [reach us by email][contact]." + +#: shell-novice/CONTRIBUTING.md:138 +msgid "" +"[contact]: mailto:admin@software-carpentry.org\n" +"[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry\n" +"[dc-lessons]: http://datacarpentry.org/lessons/\n" +"[dc-site]: http://datacarpentry.org/\n" +"[discuss-list]: http://lists.software-carpentry.org/listinfo/discuss\n" +"[github]: http://github.com\n" +"[github-flow]: https://guides.github.com/introduction/flow/\n" +"[github-join]: https://github.com/join\n" +"[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\n" +"[issues]: https://github.com/swcarpentry/shell-novice/issues/\n" +"[repo]: https://github.com/swcarpentry/shell-novice/\n" +"[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry\n" +"[swc-lessons]: http://software-carpentry.org/lessons/\n" +"[swc-site]: http://software-carpentry.org/" +msgstr "" +"[contact]: mailto:admin@software-carpentry.org\n" +"[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry\n" +"[dc-lessons]: http://datacarpentry.org/lessons/\n" +"[dc-site]: http://datacarpentry.org/\n" +"[discuss-list]: http://lists.software-carpentry.org/listinfo/discuss\n" +"[github]: http://github.com\n" +"[github-flow]: https://guides.github.com/introduction/flow/\n" +"[github-join]: https://github.com/join\n" +"[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\n" +"[issues]: https://github.com/swcarpentry/shell-novice/issues/\n" +"[repo]: https://github.com/swcarpentry/shell-novice/\n" +"[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry\n" +"[swc-lessons]: http://software-carpentry.org/lessons/\n" +"[swc-site]: http://software-carpentry.org/" + +# Front Matter +#: shell-novice/LICENSE.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: \"Licenses\"\n" +"root: .\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: \"Licenses\"\n" +"root: .\n" +"---" + +# header +#: shell-novice/LICENSE.md:6 +msgid "## Instructional Material" +msgstr "## Instructional Material" + +#: shell-novice/LICENSE.md:8 +msgid "" +"All Software Carpentry and Data Carpentry instructional material is\n" +"made available under the [Creative Commons Attribution\n" +"license][cc-by-human]. The following is a human-readable summary of\n" +"(and not a substitute for) the [full legal text of the CC BY 4.0\n" +"license][cc-by-legal]." +msgstr "" +"All Software Carpentry and Data Carpentry instructional material is\n" +"made available under the [Creative Commons Attribution\n" +"license][cc-by-human]. The following is a human-readable summary of\n" +"(and not a substitute for) the [full legal text of the CC BY 4.0\n" +"license][cc-by-legal]." + +#: shell-novice/LICENSE.md:14 +msgid "You are free:" +msgstr "You are free:" + +# unordered list +#: shell-novice/LICENSE.md:16 +msgid "* to **Share**---copy and redistribute the material in any medium or format" +msgstr "* to **Share**---copy and redistribute the material in any medium or format" + +# unordered list +#: shell-novice/LICENSE.md:17 +msgid "* to **Adapt**---remix, transform, and build upon the material" +msgstr "* to **Adapt**---remix, transform, and build upon the material" + +#: shell-novice/LICENSE.md:19 +msgid "for any purpose, even commercially." +msgstr "for any purpose, even commercially." + +#: shell-novice/LICENSE.md:21 +msgid "" +"The licensor cannot revoke these freedoms as long as you follow the\n" +"license terms." +msgstr "" +"The licensor cannot revoke these freedoms as long as you follow the\n" +"license terms." + +#: shell-novice/LICENSE.md:24 +msgid "Under the following terms:" +msgstr "Under the following terms:" + +# unordered list +#: shell-novice/LICENSE.md:26 +msgid "* **Attribution**---You must give appropriate credit (mentioning that" +msgstr "* **Attribution**---You must give appropriate credit (mentioning that" + +#: shell-novice/LICENSE.md:27 +msgid "" +" your work is derived from work that is Copyright © Software\n" +" Carpentry and, where practical, linking to\n" +" http://software-carpentry.org/), provide a [link to the\n" +" license][cc-by-human], and indicate if changes were made. You may do\n" +" so in any reasonable manner, but not in any way that suggests the\n" +" licensor endorses you or your use." +msgstr "" +" your work is derived from work that is Copyright © Software\n" +" Carpentry and, where practical, linking to\n" +" http://software-carpentry.org/), provide a [link to the\n" +" license][cc-by-human], and indicate if changes were made. You may do\n" +" so in any reasonable manner, but not in any way that suggests the\n" +" licensor endorses you or your use." + +#: shell-novice/LICENSE.md:34 +msgid "" +"**No additional restrictions**---You may not apply legal terms or\n" +"technological measures that legally restrict others from doing\n" +"anything the license permits. With the understanding that:" +msgstr "" +"**No additional restrictions**---You may not apply legal terms or\n" +"technological measures that legally restrict others from doing\n" +"anything the license permits. With the understanding that:" + +#: shell-novice/LICENSE.md:38 +msgid "Notices:" +msgstr "Notices:" + +# unordered list +#: shell-novice/LICENSE.md:40 +msgid "* You do not have to comply with the license for elements of the" +msgstr "* You do not have to comply with the license for elements of the" + +#: shell-novice/LICENSE.md:41 +msgid "" +" material in the public domain or where your use is permitted by an\n" +" applicable exception or limitation.\n" +"* No warranties are given. The license may not give you all of the\n" +" permissions necessary for your intended use. For example, other\n" +" rights such as publicity, privacy, or moral rights may limit how you\n" +" use the material." +msgstr "" +" material in the public domain or where your use is permitted by an\n" +" applicable exception or limitation.\n" +"* No warranties are given. The license may not give you all of the\n" +" permissions necessary for your intended use. For example, other\n" +" rights such as publicity, privacy, or moral rights may limit how you\n" +" use the material." + +# header +#: shell-novice/LICENSE.md:48 +msgid "## Software" +msgstr "## Software" + +#: shell-novice/LICENSE.md:50 +msgid "" +"Except where otherwise noted, the example programs and other software\n" +"provided by Software Carpentry and Data Carpentry are made available under the\n" +"[OSI][osi]-approved\n" +"[MIT license][mit-license]." +msgstr "" +"Except where otherwise noted, the example programs and other software\n" +"provided by Software Carpentry and Data Carpentry are made available under the\n" +"[OSI][osi]-approved\n" +"[MIT license][mit-license]." + +#: shell-novice/LICENSE.md:55 +msgid "" +"Permission is hereby granted, free of charge, to any person obtaining\n" +"a copy of this software and associated documentation files (the\n" +"\"Software\"), to deal in the Software without restriction, including\n" +"without limitation the rights to use, copy, modify, merge, publish,\n" +"distribute, sublicense, and/or sell copies of the Software, and to\n" +"permit persons to whom the Software is furnished to do so, subject to\n" +"the following conditions:" +msgstr "" +"Permission is hereby granted, free of charge, to any person obtaining\n" +"a copy of this software and associated documentation files (the\n" +"\"Software\"), to deal in the Software without restriction, including\n" +"without limitation the rights to use, copy, modify, merge, publish,\n" +"distribute, sublicense, and/or sell copies of the Software, and to\n" +"permit persons to whom the Software is furnished to do so, subject to\n" +"the following conditions:" + +#: shell-novice/LICENSE.md:63 +msgid "" +"The above copyright notice and this permission notice shall be\n" +"included in all copies or substantial portions of the Software." +msgstr "" +"The above copyright notice and this permission notice shall be\n" +"included in all copies or substantial portions of the Software." + +#: shell-novice/LICENSE.md:66 +msgid "" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" +"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" +"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n" +"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n" +"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" +"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." +msgstr "" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" +"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" +"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n" +"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n" +"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" +"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + +# header +#: shell-novice/LICENSE.md:74 +msgid "## Trademark" +msgstr "## Trademark" + +#: shell-novice/LICENSE.md:76 +msgid "" +"\"Software Carpentry\" and \"Data Carpentry\" and their respective logos\n" +"are registered trademarks of [Community Initiatives][CI]." +msgstr "" +"\"Software Carpentry\" and \"Data Carpentry\" and their respective logos\n" +"are registered trademarks of [Community Initiatives][CI]." + +#: shell-novice/LICENSE.md:79 +msgid "" +"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" +"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" +"[mit-license]: http://opensource.org/licenses/mit-license.html\n" +"[ci]: http://communityin.org/\n" +"[osi]: http://opensource.org" +msgstr "" +"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" +"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" +"[mit-license]: http://opensource.org/licenses/mit-license.html\n" +"[ci]: http://communityin.org/\n" +"[osi]: http://opensource.org" + +#: shell-novice/README.md:1 +msgid "" +"shell-novice\n" +"============" +msgstr "" +"shell-novice\n" +"============" + +#: shell-novice/README.md:4 +msgid "" +"An introduction to the Unix shell for people who have never used the command line before.\n" +"Please see for a rendered version of this material,\n" +"[the lesson template documentation][lesson-example]\n" +"for instructions on formatting, building, and submitting material,\n" +"or run `make` in this directory for a list of helpful commands." +msgstr "" +"An introduction to the Unix shell for people who have never used the command line before.\n" +"Please see for a rendered version of this material,\n" +"[the lesson template documentation][lesson-example]\n" +"for instructions on formatting, building, and submitting material,\n" +"or run `make` in this directory for a list of helpful commands." + +#: shell-novice/README.md:10 +msgid "Maintainers:" +msgstr "Maintainers:" + +# unordered list +#: shell-novice/README.md:12 +msgid "* [Gabriel Devenyi][devenyi_gabriel]" +msgstr "* [Gabriel Devenyi][devenyi_gabriel]" + +# unordered list +#: shell-novice/README.md:13 +msgid "* [Ashwin Srinath][srinath_ashwin]" +msgstr "* [Ashwin Srinath][srinath_ashwin]" + +# unordered list +#: shell-novice/README.md:14 +msgid "* [Colin Morris][colin_morris]" +msgstr "* [Colin Morris][colin_morris]" + +# unordered list +#: shell-novice/README.md:15 +msgid "* [Will Pitchers][will_pitchers]" +msgstr "* [Will Pitchers][will_pitchers]" + +#: shell-novice/README.md:17 +msgid "" +"[devenyi_gabriel]: http://software-carpentry.org/team/#devenyi_gabriel\n" +"[srinath_ashwin]: http://software-carpentry.org/team/#srinath_ashwin\n" +"[colin_morris]: https://github.com/colinmorris\n" +"[will_pitchers]: https://software-carpentry.org/team/#pitchers_w\n" +"[lesson-example]: https://swcarpentry.github.io/lesson-example/" +msgstr "" +"[devenyi_gabriel]: http://software-carpentry.org/team/#devenyi_gabriel\n" +"[srinath_ashwin]: http://software-carpentry.org/team/#srinath_ashwin\n" +"[colin_morris]: https://github.com/colinmorris\n" +"[will_pitchers]: https://software-carpentry.org/team/#pitchers_w\n" +"[lesson-example]: https://swcarpentry.github.io/lesson-example/" + +# Front Matter +#: shell-novice/_episodes/01-intro.md:1 +msgid "" +"---\n" +"title: \"Introducing the Shell\"\n" +"teaching: 5\n" +"exercises: 0\n" +"questions:\n" +"- \"What is a command shell and why would I use one?\"\n" +"objectives:\n" +"- \"Explain how the shell relates to the keyboard, the screen, the operating system, and users' programs.\"\n" +"- \"Explain when and why command-line interfaces should be used instead of graphical interfaces.\"\n" +"keypoints:\n" +"- \"Explain the steps in the shell's read-run-print cycle.\"\n" +"- \"Most commands take flags (options) which begin with a `-`.\"\n" +"- \"Identify the actual command, flags, and filenames in a command-line call.\"\n" +"- \"Explain the steps in the shell's read-run-print cycle.\"\n" +"- \"Demonstrate the use of tab completion and explain its advantages.\"\n" +"keypoints:\n" +"- \"A shell is a program whose primary purpose is to read commands and run other programs.\"\n" +"- \"The shell's main advantages are its high action-to-keystroke ratio, its support for automating repetitive tasks, and its capacity to access networked machines.\"\n" +"- \"The shell's main disadvantages are its primarily textual nature and how cryptic its commands and operation can be.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Introducing the Shell\"\n" +"teaching: 5\n" +"exercises: 0\n" +"questions:\n" +"- \"What is a command shell and why would I use one?\"\n" +"objectives:\n" +"- \"Explain how the shell relates to the keyboard, the screen, the operating system, and users' programs.\"\n" +"- \"Explain when and why command-line interfaces should be used instead of graphical interfaces.\"\n" +"keypoints:\n" +"- \"Explain the steps in the shell's read-run-print cycle.\"\n" +"- \"Most commands take flags (options) which begin with a `-`.\"\n" +"- \"Identify the actual command, flags, and filenames in a command-line call.\"\n" +"- \"Explain the steps in the shell's read-run-print cycle.\"\n" +"- \"Demonstrate the use of tab completion and explain its advantages.\"\n" +"keypoints:\n" +"- \"A shell is a program whose primary purpose is to read commands and run other programs.\"\n" +"- \"The shell's main advantages are its high action-to-keystroke ratio, its support for automating repetitive tasks, and its capacity to access networked machines.\"\n" +"- \"The shell's main disadvantages are its primarily textual nature and how cryptic its commands and operation can be.\"\n" +"---" + +# header +#: shell-novice/_episodes/01-intro.md:21 +msgid "### Background" +msgstr "### 背景" + +#: shell-novice/_episodes/01-intro.md:22 +msgid "At a high level, computers do four things:" +msgstr "大まかにいうと、コンピューターは以下の4つのことをおこなっています:" + +# unordered list +#: shell-novice/_episodes/01-intro.md:24 +msgid "- run programs" +msgstr "- プログラムを実行する" + +# unordered list +#: shell-novice/_episodes/01-intro.md:25 +msgid "- store data" +msgstr "- データを保存する" + +# unordered list +#: shell-novice/_episodes/01-intro.md:26 +msgid "- communicate with each other, and" +msgstr "- 他のコンピューターとやりとりをする" + +# unordered list +#: shell-novice/_episodes/01-intro.md:27 +msgid "- interact with us" +msgstr "- 私たちとやりとりをする" + +#: shell-novice/_episodes/01-intro.md:29 +msgid "" +"They can do the last of these in many different ways,\n" +"including through a keyboard and mouse, or touch screen interfaces, or speech recognition using systems.\n" +"While such hardware interfaces are becoming more commonplace, most interaction is still\n" +"done using screens, mice, touchpads and keyboards." +msgstr "" +"私たちとのやりとりは様々な方法で行います。\n" +"例えば、キーボードやマウスを使ったり、タッチスクリーンを使ったり、音声認識を使ったりです。\n" +"このようなハードウェアインターフェイスは一般的になりつつありますが、ほとんどのやりとりはまだ\n" +"画面とマウスやタッチパッドとキーボードを用いて行われます。" + +#: shell-novice/_episodes/01-intro.md:34 +msgid "" +"We are all familiar with **graphical user interfaces** (GUI - windows, icons and pointers). \n" +"They are easy to learn and fantastic for simple tasks where a vocabulary consisting of\n" +"\"click\" translates easily into \"do the thing I want\". But this magic relies on \n" +"wanting a simple set of things, and having programs that can do exactly those things." +msgstr "" +"私たちは皆「グラフィカルユーザーインターフェイス (GUI)」とよばれる、ウインドウやアイコンやポインターで操作することに慣れています。\n" +"それらは簡単になれることができ、単純なタスクをこなすのには適しています。\n" +"「クリック」は「やりたいことをやってください」を意味します。 \n" +"しかし、この魔法のような単純さは、やりたいことが単純で、それを行うプログラムが存在していなければなりません。" + +#: shell-novice/_episodes/01-intro.md:39 +msgid "" +"If you wish to do complex, purpose-specific things it helps to have a richer means\n" +"of expressing your instructions to the computer. It doesn't need to be complicated or\n" +"difficult, just a vocabulary of commands and a simple grammar for using them." +msgstr "" +"より複雑なことや目的がはっきりしたことをコンピュータにさせたい時には、\n" +"単純なクリックのみよりも意味のある指示の表現方法があると便利です。\n" +"その表現方法は複雑で難解である必要はなく\n" +"簡単な語句とシンプルな文法で表記できれば良いのです。" + +#: shell-novice/_episodes/01-intro.md:43 +msgid "" +"This is what the shell provides - a simple language and a **command-line interface** \n" +"to use it through. " +msgstr "これがまさにシェルが提供するもので、シンプルな言語と「コマンドラインインターフェイス」でコンピュータに指示を出します。 " + +#: shell-novice/_episodes/01-intro.md:46 +msgid "" +"The heart of a command-line interface is a **read-evaluate-print loop**, or REPL, called\n" +"so because when you type a command and press the Enter (or Return) key, the shell:\n" +"1. Reads it\n" +"2. Executes (or \"evaluates\" it)\n" +"3. Prints the output" +msgstr "" +"コマンドラインインターフェースの核は、REPL (read-evaluate-print-loop)と呼ばれています。\n" +"これは、シェルにコマンドを入力し、Enter(または Return)キーを押した時に起こる動作:\n" +"1. コマンドを読み込む(Read)\n" +"2. コマンドを実行する (または \"評価する\" - Evaluate)\n" +"3. 結果を出力する (Print)" + +#: shell-novice/_episodes/01-intro.md:52 +msgid "and then prints the prompt and waits for you to enter another command." +msgstr "そして、プロンプトで次のコマンドの入力を待ち、1〜3の動作を繰り返す(Loop)ことから、頭文字を取ってREPLと呼ばれています。" + +# header +#: shell-novice/_episodes/01-intro.md:54 +msgid "### The Shell" +msgstr "### シェル" + +#: shell-novice/_episodes/01-intro.md:56 +msgid "" +"A shell is a program like any other.\n" +"What's special about it is that its job is to run other programs\n" +"rather than to do calculations itself.\n" +"The most popular Unix shell is Bash,\n" +"the Bourne Again SHell\n" +"(so-called because it's derived from a shell written by Stephen Bourne).\n" +"Bash is the default shell on most modern implementations of Unix\n" +"and in most packages that provide Unix-like tools for Windows." +msgstr "" +"シェルは他のプログラムと同じようなものです。\n" +"シェルの何が特別なのかというと、シェルは計算をするものでなく、\n" +"他のプログラムを実行するものというところにあります。\n" +"最も人気のある Unix シェルは、Bash、Bourne Again SHell です\n" +" (これは Stephen Bourne によって書かれたシェルから派生したものであるためそう呼ばれています)。\n" +"Bash はほとんどの最新の Unix の搭載されたもののデフォルトシェルであり、\n" +"Windows 用の Unix のようなツールを提供するほとんどのパッケージで使われています。" + +# header +#: shell-novice/_episodes/01-intro.md:65 +msgid "### What does it look like?" +msgstr "### シェルコマンドはどのようなものですか?" + +#: shell-novice/_episodes/01-intro.md:67 +msgid "A typical shell command and output looks something like this:" +msgstr "典型的なシェルコマンドとその出力はこのようなものです:" + +# code block +#: shell-novice/_episodes/01-intro.md:69 +msgid "" +"~~~\n" +"bash-3.2$ \n" +"bash-3.2$ ls -F / \n" +"Applications/ System/\n" +"Library/ Users/\n" +"Network/ Volumes/\n" +"bash-3.2$ \n" +"~~~" +msgstr "" +"~~~\n" +"bash-3.2$ \n" +"bash-3.2$ ls -F / \n" +"Applications/ System/\n" +"Library/ Users/\n" +"Network/ Volumes/\n" +"bash-3.2$ \n" +"~~~" + +#: shell-novice/_episodes/01-intro.md:77 +#: shell-novice/_episodes/02-filedir.md:50 +#: shell-novice/_episodes/02-filedir.md:129 +#: shell-novice/_episodes/02-filedir.md:152 +#: shell-novice/_episodes/02-filedir.md:201 +#: shell-novice/_episodes/02-filedir.md:409 +#: shell-novice/_episodes/02-filedir.md:437 +#: shell-novice/_episodes/02-filedir.md:464 +#: shell-novice/_episodes/02-filedir.md:477 +#: shell-novice/_episodes/02-filedir.md:487 +#: shell-novice/_episodes/02-filedir.md:501 +#: shell-novice/_episodes/02-filedir.md:521 +#: shell-novice/_episodes/02-filedir.md:533 +#: shell-novice/_episodes/02-filedir.md:546 +#: shell-novice/_episodes/02-filedir.md:599 +#: shell-novice/_episodes/02-filedir.md:606 +#: shell-novice/_episodes/02-filedir.md:623 +#: shell-novice/_episodes/02-filedir.md:650 +#: shell-novice/_episodes/02-filedir.md:660 +#: shell-novice/_episodes/02-filedir.md:799 +#: shell-novice/_episodes/02-filedir.md:808 +#: shell-novice/_episodes/02-filedir.md:816 +#: shell-novice/_episodes/03-create.md:30 +#: shell-novice/_episodes/03-create.md:40 +#: shell-novice/_episodes/03-create.md:53 +#: shell-novice/_episodes/03-create.md:64 +#: shell-novice/_episodes/03-create.md:112 +#: shell-novice/_episodes/03-create.md:121 +#: shell-novice/_episodes/03-create.md:183 +#: shell-novice/_episodes/03-create.md:236 +#: shell-novice/_episodes/03-create.md:246 +#: shell-novice/_episodes/03-create.md:265 +#: shell-novice/_episodes/03-create.md:276 +#: shell-novice/_episodes/03-create.md:286 +#: shell-novice/_episodes/03-create.md:294 +#: shell-novice/_episodes/03-create.md:309 +#: shell-novice/_episodes/03-create.md:353 +#: shell-novice/_episodes/03-create.md:365 +#: shell-novice/_episodes/03-create.md:379 +#: shell-novice/_episodes/03-create.md:392 +#: shell-novice/_episodes/03-create.md:419 +#: shell-novice/_episodes/03-create.md:427 +#: shell-novice/_episodes/03-create.md:436 +#: shell-novice/_episodes/03-create.md:484 +#: shell-novice/_episodes/03-create.md:499 +#: shell-novice/_episodes/04-pipefilter.md:37 +#: shell-novice/_episodes/04-pipefilter.md:55 +#: shell-novice/_episodes/04-pipefilter.md:177 +#: shell-novice/_episodes/04-pipefilter.md:201 +#: shell-novice/_episodes/04-pipefilter.md:215 +#: shell-novice/_episodes/04-pipefilter.md:275 +#: shell-novice/_episodes/04-pipefilter.md:351 +#: shell-novice/_episodes/04-pipefilter.md:374 +#: shell-novice/_episodes/04-pipefilter.md:413 +#: shell-novice/_episodes/04-pipefilter.md:437 +#: shell-novice/_episodes/04-pipefilter.md:455 +#: shell-novice/_episodes/04-pipefilter.md:746 +#: shell-novice/_episodes/04-pipefilter.md:766 +#: shell-novice/_episodes/04-pipefilter.md:788 +#: shell-novice/_episodes/04-pipefilter.md:808 +#: shell-novice/_episodes/05-loop.md:39 shell-novice/_episodes/05-loop.md:46 +#: shell-novice/_episodes/05-loop.md:70 shell-novice/_episodes/05-loop.md:223 +#: shell-novice/_episodes/05-loop.md:233 shell-novice/_episodes/05-loop.md:295 +#: shell-novice/_episodes/05-loop.md:306 shell-novice/_episodes/05-loop.md:327 +#: shell-novice/_episodes/05-loop.md:392 shell-novice/_episodes/05-loop.md:402 +#: shell-novice/_episodes/05-loop.md:409 shell-novice/_episodes/05-loop.md:439 +#: shell-novice/_episodes/05-loop.md:462 shell-novice/_episodes/05-loop.md:489 +#: shell-novice/_episodes/05-loop.md:497 shell-novice/_episodes/05-loop.md:511 +#: shell-novice/_episodes/06-script.md:36 +#: shell-novice/_episodes/06-script.md:64 +#: shell-novice/_episodes/06-script.md:99 +#: shell-novice/_episodes/06-script.md:115 +#: shell-novice/_episodes/06-script.md:131 +#: shell-novice/_episodes/06-script.md:157 +#: shell-novice/_episodes/06-script.md:169 +#: shell-novice/_episodes/06-script.md:186 +#: shell-novice/_episodes/06-script.md:204 +#: shell-novice/_episodes/06-script.md:226 +#: shell-novice/_episodes/06-script.md:248 +#: shell-novice/_episodes/06-script.md:260 +#: shell-novice/_episodes/06-script.md:351 +#: shell-novice/_episodes/06-script.md:411 +#: shell-novice/_episodes/06-script.md:419 +#: shell-novice/_episodes/06-script.md:426 +#: shell-novice/_episodes/06-script.md:443 shell-novice/_episodes/07-find.md:39 +#: shell-novice/_episodes/07-find.md:69 shell-novice/_episodes/07-find.md:87 +#: shell-novice/_episodes/07-find.md:107 shell-novice/_episodes/07-find.md:123 +#: shell-novice/_episodes/07-find.md:141 shell-novice/_episodes/07-find.md:159 +#: shell-novice/_episodes/07-find.md:172 shell-novice/_episodes/07-find.md:187 +#: shell-novice/_episodes/07-find.md:207 shell-novice/_episodes/07-find.md:405 +#: shell-novice/_episodes/07-find.md:442 shell-novice/_episodes/07-find.md:460 +#: shell-novice/_episodes/07-find.md:479 shell-novice/_episodes/07-find.md:495 +#: shell-novice/_episodes/07-find.md:508 shell-novice/_episodes/07-find.md:539 +#: shell-novice/_episodes/07-find.md:559 shell-novice/_episodes/07-find.md:574 +msgid "{: .language-bash}" +msgstr "{: .language-bash}" + +#: shell-novice/_episodes/01-intro.md:79 +msgid "" +"The first line shows only a **prompt**, indicating that the shell is waiting\n" +"for input. Your shell may use different text for the prompt. Most importantly: \n" +"when typing commands, either from these lessons or from other sources,\n" +"*do not type the prompt*, only the commands that follow it." +msgstr "" +"最初の行には **プロンプト** だけが表示され、シェルが入力を待っていることを表します。\n" +"お使いのシェルはプロンプトに異なるテキストを使用しているかもしれません。最も重要なことは\n" +"これからのレッスンや他のソースからコマンドを入力する時には\n" +"*プロンプト*は入力せず、それに続くコマンドのみを入力してください。" + +#: shell-novice/_episodes/01-intro.md:84 +msgid "" +"The part that you type (in this example `ls -F /`)\n" +"typically has the following structure: a **command**,\n" +"some **flags** (also called **options** or **switches**) and an **argument**.\n" +"Flags start with a dash (`-`), and change the behaviour of a command.\n" +"Arguments tell the command what to operate on (e.g. files and directories).\n" +"Sometimes flags and arguments are referred to as parameters.\n" +"A command can be called with more than one flag and more than one argument: but a\n" +"command doesn't always require an argument or a flag." +msgstr "" +"入力する部分(この例では `ls -F /`)は通常、次のような構造になっています: \n" +"**コマンド**、いくつかの**フラグ**(**オプション**または**スイッチ**とも呼ばれます)、**引数**。\n" +"フラグはダッシュ(`-`)で始まり、コマンドの動作を変更します。引数は、コマンドが何を操作するかを指定します (ファイルやディレクトリなど)。フラグや引数はパラメータと呼ばれることもあります。\n" +"コマンドは複数のフラグと複数の引数を使って呼び出すこともできますし、\n" +"必ずしも引数やフラグを必要としません。" + +#: shell-novice/_episodes/01-intro.md:93 +msgid "" +"In the example above, our **command** is `ls`, with a **flag** `-F` and an\n" +"**argument** `/`. Each part is separated by spaces: if you omit the space \n" +"between `ls` and `-F` the shell will look for a command called `ls-F`, which \n" +"doesn't exist. Also, capitalization matters: `LS` is different to `ls`. " +msgstr "" +"上の例では、**コマンド** は `ls` であり、**フラグ** `-F` と**引数** `/` があります。\n" +"これらのパラメータはスペースで分けられます。\n" +"もし`ls` と `-F` の間のスペースを省略すれば、シェルは `ls-F` というコマンドを探しますが、そのようなコマンドはありません。\n" +"また、大文字小文字も問題になります。`LS` は `ls` とは異なります。 " + +#: shell-novice/_episodes/01-intro.md:98 +msgid "" +"Next we see the output that our command produced. In this case it is a listing \n" +"of files and folders in a location called `/` - we'll cover what all these mean \n" +"later today. Those with a Mac might recognize the output in this example." +msgstr "" +"次に、コマンドを実行し出てきた出力を見てみましょう。\n" +"この場合、`/`と呼ばれる場所にあるファイルとフォルダのリストが表示されます。\n" +"これらが何を意味するかは今日の後ほど学びます。\n" +"Macをお持ちの方は、この例の出力がわかるかもしれません。" + +#: shell-novice/_episodes/01-intro.md:102 +msgid "" +"Finally, the shell again prints the prompt and waits for you to type the next \n" +"command." +msgstr "最後に、シェルは再びプロンプトを表示し、あなたが次のコマンドを入力するのを待ちます。" + +#: shell-novice/_episodes/01-intro.md:105 +msgid "" +"In the examples for this lesson, we'll show the prompt as `$ `. You can make your \n" +"prompt look the same by entering the command `PS1='$ '`. But you can also leave \n" +"your prompt as it is - often the prompt includes useful information about who and where \n" +"you are." +msgstr "これからレッスンの例では、プロンプトを `$ ` として表示します。コマンド `PS1=‘$ ‘` を入力することで、プロンプトを同じように表示することができます。しかし、プロンプトをそのままにしておくこともできます - プロンプトには、あなたが誰でどこにいるのかという有用な情報が含まれていることがよくあります。" + +#: shell-novice/_episodes/01-intro.md:110 +msgid "" +"Open a shell window and try entering `ls -F /` for yourself (don't forget that spaces\n" +"and capitalization are important!). You can change the prompt too, if you like." +msgstr "" +"シェルのウィンドウを開いて、”ls -F”と入力してみましょう。\n" +"(半角スペースを忘れないでください。大文字か小文字かも大事です。)\n" +"もしプロンプトを変更したければ、変更しても構いません。" + +# header +#: shell-novice/_episodes/01-intro.md:113 +msgid "### How does the shell know what `ls` and its flags mean?" +msgstr "### シェルはどのようにして”ls”やフラッグを判断するか" + +#: shell-novice/_episodes/01-intro.md:115 +msgid "" +"Every command is a program stored somewhere on the computer, and the shell keeps a\n" +"list of places to search for commands (the list is in a **variable** called `$PATH`, \n" +"but those are concepts we'll meet later and not too important at the moment). Recall\n" +"that commands, flags and arguments are separated by spaces." +msgstr "" +"すべてのコマンドはコンピュータのどこかに保存されているプログラムであり、\n" +"シェルはそのコマンドを検索する場所のリストを保持しています。 \n" +"(リストは `$PATH` という**変数**にありますが、これは後ほど説明する概念であり、今のところあまり重要ではありません)。\n" +"コマンド、フラグ、引数はスペースで区切られていることを覚えておいてください。" + +#: shell-novice/_episodes/01-intro.md:120 +msgid "" +"So let's look at the REPL (read-evaluate-print loop) in more detail. Notice that the\n" +"\"evaluate\" step is made of two parts:" +msgstr "" +"続いてREPL(read-evaluate-print loop)についてもう少し詳しく見ていきましょう。\n" +"evaluateのステップは大きく分けて二つの部分からなります。" + +# ordered list +#: shell-novice/_episodes/01-intro.md:123 +msgid "1. Read what was typed (`ls -F /` in our example) " +msgstr "1. 何が入力されたかを読み込みます。私たちの例では `ls -F /` となります。 " + +#: shell-novice/_episodes/01-intro.md:124 +msgid "" +" The shell uses the spaces to split the line into the command, flags, and arguments\n" +"2. Evaluate: \n" +" a. Find a program called `ls` \n" +" b. Execute it, passing it the flags and arguments (`-F` and `/`) to \n" +" interpret as the program sees fit \n" +"3. Print the output produced by the program" +msgstr "" +" シェルは半角スペースによって、1行の入力はコマンド、フラグ、引数に分けます。 \n" +"2. 評価します: \n" +" a. ls と呼ばれるプログラムがあるか探します \n" +" b. それを実行しプログラムが適切に実行されるようにフラグや引数をそれに引き渡します。\n" +"3. プログラムによって生成された結果を表示します。 " + +#: shell-novice/_episodes/01-intro.md:131 +msgid "and then print the prompt and wait for you to enter another command." +msgstr "and then print the prompt and wait for you to enter another command." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:133 +msgid "> ## Command not found " +msgstr "> ## Command not found " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:134 +msgid "> If the shell can't find a program whose name is the command you typed, it " +msgstr "> If the shell can't find a program whose name is the command you typed, it " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:135 +msgid "> will print an erorr message like:" +msgstr "> will print an erorr message like:" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:136 +#: shell-novice/_episodes/01-intro.md:142 shell-novice/_episodes/05-loop.md:349 +#: shell-novice/_episodes/05-loop.md:351 shell-novice/_episodes/07-find.md:283 +#: shell-novice/_episodes/07-find.md:286 shell-novice/_episodes/07-find.md:661 +msgid "> " +msgstr "> " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:137 +#: shell-novice/_episodes/01-intro.md:140 +#: shell-novice/_episodes/03-create.md:570 +#: shell-novice/_episodes/03-create.md:572 +#: shell-novice/_episodes/03-create.md:574 +#: shell-novice/_episodes/03-create.md:576 +#: shell-novice/_episodes/03-create.md:578 +#: shell-novice/_episodes/03-create.md:583 +#: shell-novice/_episodes/03-create.md:633 +#: shell-novice/_episodes/03-create.md:635 +#: shell-novice/_episodes/03-create.md:637 +#: shell-novice/_episodes/03-create.md:639 +#: shell-novice/_episodes/03-create.md:675 +#: shell-novice/_episodes/03-create.md:677 +#: shell-novice/_episodes/05-loop.md:352 shell-novice/_episodes/05-loop.md:357 +#: shell-novice/_episodes/07-find.md:287 shell-novice/_episodes/07-find.md:293 +msgid "> ~~~" +msgstr "> ~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:138 +msgid "> $ ls-F" +msgstr "> $ ls-F" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:139 +msgid "> -bash: ls-F: command not found" +msgstr "> -bash: ls-F: command not found" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:141 +#: shell-novice/_episodes/03-create.md:573 +#: shell-novice/_episodes/03-create.md:584 +#: shell-novice/_episodes/03-create.md:636 +#: shell-novice/_episodes/03-create.md:678 +#: shell-novice/_episodes/05-loop.md:358 +msgid "> {: .language-bash}" +msgstr "> {: .language-bash}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:143 +msgid "> Usually this means that you have mis-typed the command - in this case we omitted" +msgstr "> 通常これは、あなたがコマンドをタイプミスしたことを意味します。このケースでは" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/01-intro.md:144 +msgid "> the space between `ls` and `-F`. " +msgstr "> `ls` と `-F` の間に空白を忘れています。 " + +# SC/DC Template label +#: shell-novice/_episodes/01-intro.md:145 +#: shell-novice/_episodes/02-filedir.md:70 +#: shell-novice/_episodes/02-filedir.md:107 +#: shell-novice/_episodes/02-filedir.md:190 +#: shell-novice/_episodes/02-filedir.md:337 +#: shell-novice/_episodes/02-filedir.md:576 +#: shell-novice/_episodes/02-filedir.md:589 +#: shell-novice/_episodes/02-filedir.md:678 +#: shell-novice/_episodes/02-filedir.md:781 +#: shell-novice/_episodes/03-create.md:77 +#: shell-novice/_episodes/03-create.md:105 +#: shell-novice/_episodes/03-create.md:145 +#: shell-novice/_episodes/03-create.md:175 +#: shell-novice/_episodes/03-create.md:257 +#: shell-novice/_episodes/03-create.md:344 +#: shell-novice/_episodes/03-create.md:532 +#: shell-novice/_episodes/04-pipefilter.md:99 +#: shell-novice/_episodes/04-pipefilter.md:297 +#: shell-novice/_episodes/04-pipefilter.md:402 +#: shell-novice/_episodes/04-pipefilter.md:558 +#: shell-novice/_episodes/05-loop.md:85 shell-novice/_episodes/05-loop.md:195 +#: shell-novice/_episodes/05-loop.md:209 shell-novice/_episodes/05-loop.md:381 +#: shell-novice/_episodes/05-loop.md:517 shell-novice/_episodes/05-loop.md:563 +#: shell-novice/_episodes/05-loop.md:579 shell-novice/_episodes/06-script.md:89 +#: shell-novice/_episodes/06-script.md:147 +#: shell-novice/_episodes/06-script.md:337 shell-novice/_episodes/07-find.md:62 +#: shell-novice/_episodes/07-find.md:280 shell-novice/_episodes/07-find.md:524 +#: shell-novice/_episodes/07-find.md:631 shell-novice/setup.md:63 +msgid "{: .callout}" +msgstr "{: .callout}" + +# header +#: shell-novice/_episodes/01-intro.md:147 +msgid "### Is it difficult?" +msgstr "### Is it difficult?" + +#: shell-novice/_episodes/01-intro.md:149 +msgid "" +"It isn't difficult, but it is a different model of interacting than a GUI, and that \n" +"will take some effort - and some time - to learn. A GUI \n" +"presents you with choices and you select one. With a CLI the choices are combinations \n" +"of commands and parameters, more like words in a language than buttons on a screen. They\n" +"are not presented to you so\n" +"you must learn a few, like learning some vocabulary in a new language. But a small \n" +"number of commands gets you a long way, and we'll cover those essential few today." +msgstr "" +"It isn't difficult, but it is a different model of interacting than a GUI, and that \n" +"will take some effort - and some time - to learn. A GUI \n" +"presents you with choices and you select one. With a CLI the choices are combinations \n" +"of commands and parameters, more like words in a language than buttons on a screen. They\n" +"are not presented to you so\n" +"you must learn a few, like learning some vocabulary in a new language. But a small \n" +"number of commands gets you a long way, and we'll cover those essential few today." + +# header +#: shell-novice/_episodes/01-intro.md:157 +msgid "### Flexibility and automation " +msgstr "### Flexibility and automation " + +#: shell-novice/_episodes/01-intro.md:159 +msgid "" +"The grammar of a shell allows you to combine existing tools into powerful\n" +"pipelines and handle large volumes of data automatically. Sequences of\n" +"commands can be written into a *script*, improving the reproducibility of \n" +"workflows and allowing you to repeat them easily." +msgstr "" +"The grammar of a shell allows you to combine existing tools into powerful\n" +"pipelines and handle large volumes of data automatically. Sequences of\n" +"commands can be written into a *script*, improving the reproducibility of \n" +"workflows and allowing you to repeat them easily." + +#: shell-novice/_episodes/01-intro.md:164 +msgid "" +"In addition, the command line is often the easiest way to interact with remote machines and supercomputers.\n" +"Familiarity with the shell is near essential to run a variety of specialized tools and resources\n" +"including high-performance computing systems.\n" +"As clusters and cloud computing systems become more popular for scientific data crunching,\n" +"being able to interact with the shell is becoming a necessary skill.\n" +"We can build on the command-line skills covered here\n" +"to tackle a wide range of scientific questions and computational challenges." +msgstr "" +"In addition, the command line is often the easiest way to interact with remote machines and supercomputers.\n" +"Familiarity with the shell is near essential to run a variety of specialized tools and resources\n" +"including high-performance computing systems.\n" +"As clusters and cloud computing systems become more popular for scientific data crunching,\n" +"being able to interact with the shell is becoming a necessary skill.\n" +"We can build on the command-line skills covered here\n" +"to tackle a wide range of scientific questions and computational challenges." + +# header +#: shell-novice/_episodes/01-intro.md:172 +msgid "## Nelle's Pipeline: Starting Point" +msgstr "## Nelle's Pipeline: Starting Point" + +#: shell-novice/_episodes/01-intro.md:174 +msgid "" +"Nelle Nemo, a marine biologist,\n" +"has just returned from a six-month survey of the\n" +"[North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre),\n" +"where she has been sampling gelatinous marine life in the\n" +"[Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch).\n" +"She has 1520 samples in all and now needs to:" +msgstr "" +"Nelle Nemo, a marine biologist,\n" +"has just returned from a six-month survey of the\n" +"[North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre),\n" +"where she has been sampling gelatinous marine life in the\n" +"[Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch).\n" +"She has 1520 samples in all and now needs to:" + +# ordered list +#: shell-novice/_episodes/01-intro.md:181 +msgid "1. Run each sample through an assay machine" +msgstr "1. Run each sample through an assay machine" + +#: shell-novice/_episodes/01-intro.md:182 +msgid "" +" that will measure the relative abundance of 300 different proteins.\n" +" The machine's output for a single sample is\n" +" a file with one line for each protein.\n" +"2. Calculate statistics for each of the proteins separately\n" +" using a program her supervisor wrote called `goostats`.\n" +"3. Write up results.\n" +" Her supervisor would really like her to do this by the end of the month\n" +" so that her paper can appear in an upcoming special issue of *Aquatic Goo Letters*." +msgstr "" +" that will measure the relative abundance of 300 different proteins.\n" +" The machine's output for a single sample is\n" +" a file with one line for each protein.\n" +"2. Calculate statistics for each of the proteins separately\n" +" using a program her supervisor wrote called `goostats`.\n" +"3. Write up results.\n" +" Her supervisor would really like her to do this by the end of the month\n" +" so that her paper can appear in an upcoming special issue of *Aquatic Goo Letters*." + +#: shell-novice/_episodes/01-intro.md:191 +msgid "" +"It takes about half an hour for the assay machine to process each sample.\n" +"The good news is that\n" +"it only takes two minutes to set each one up.\n" +"Since her lab has eight assay machines that she can use in parallel,\n" +"this step will \"only\" take about two weeks." +msgstr "" +"It takes about half an hour for the assay machine to process each sample.\n" +"The good news is that\n" +"it only takes two minutes to set each one up.\n" +"Since her lab has eight assay machines that she can use in parallel,\n" +"this step will \"only\" take about two weeks." + +#: shell-novice/_episodes/01-intro.md:197 +msgid "" +"The bad news is that if she has to run `goostats` by hand,\n" +"she'll have to enter filenames and click \"OK\" 1520 times.\n" +"At 30 seconds per sample,\n" +"the whole process will take more than 12 hours\n" +"(and that's assuming the best-case scenario where she is ready to enter the next file name\n" +"as soon as the previous sample analysis has finished).\n" +"This zero-breaks always-ready scenario is only achieveable by a machine so it would\n" +"likely take much longer than 12 hours, not to mention that\n" +"the chances of her typing all of those commands correctly are practically zero.\n" +"Missing that paper deadline is looking increasingly likely." +msgstr "" +"The bad news is that if she has to run `goostats` by hand,\n" +"she'll have to enter filenames and click \"OK\" 1520 times.\n" +"At 30 seconds per sample,\n" +"the whole process will take more than 12 hours\n" +"(and that's assuming the best-case scenario where she is ready to enter the next file name\n" +"as soon as the previous sample analysis has finished).\n" +"This zero-breaks always-ready scenario is only achieveable by a machine so it would\n" +"likely take much longer than 12 hours, not to mention that\n" +"the chances of her typing all of those commands correctly are practically zero.\n" +"Missing that paper deadline is looking increasingly likely." + +#: shell-novice/_episodes/01-intro.md:208 +msgid "" +"The next few lessons will explore what she should do instead.\n" +"More specifically,\n" +"they explain how she can use a command shell\n" +"to automate the repetitive steps in her processing pipeline\n" +"so that her computer can work 24 hours a day while she writes her paper.\n" +"As a bonus,\n" +"once she has put a processing pipeline together,\n" +"she will be able to use it again whenever she collects more data." +msgstr "" +"The next few lessons will explore what she should do instead.\n" +"More specifically,\n" +"they explain how she can use a command shell\n" +"to automate the repetitive steps in her processing pipeline\n" +"so that her computer can work 24 hours a day while she writes her paper.\n" +"As a bonus,\n" +"once she has put a processing pipeline together,\n" +"she will be able to use it again whenever she collects more data." + +# Front Matter +#: shell-novice/_episodes/02-filedir.md:1 +msgid "" +"---\n" +"title: \"Navigating Files and Directories\"\n" +"teaching: 30\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I move around on my computer?\"\n" +"- \"How can I see what files and directories I have?\"\n" +"- \"How can I specify the location of a file or directory on my computer?\"\n" +"objectives:\n" +"- \"Explain the similarities and differences between a file and a directory.\"\n" +"- \"Translate an absolute path into a relative path and vice versa.\"\n" +"- \"Construct absolute and relative paths that identify specific files and directories.\"\n" +"- \"Demonstrate the use of tab completion, and explain its advantages.\"\n" +"keypoints:\n" +"- \"The file system is responsible for managing information on the disk.\"\n" +"- \"Information is stored in files, which are stored in directories (folders).\"\n" +"- \"Directories can also store other directories, which forms a directory tree.\"\n" +"- \"`cd path` changes the current working directory.\"\n" +"- \"`ls path` prints a listing of a specific file or directory; `ls` on its own lists the current working directory.\"\n" +"- \"`pwd` prints the user's current working directory.\"\n" +"- \"`whoami` shows the user's current identity.\"\n" +"- \"`/` on its own is the root directory of the whole file system.\"\n" +"- \"A relative path specifies a location starting from the current location.\"\n" +"- \"An absolute path specifies a location from the root of the file system.\"\n" +"- \"Directory names in a path are separated with `/` on Unix, but `\\\\\\\\` on Windows.\"\n" +"- \"`..` means 'the directory above the current one'; `.` on its own means 'the current directory'.\"\n" +"- \"Most files' names are `something.extension`. The extension isn't required, and doesn't guarantee anything, but is normally used to indicate the type of data in the file.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Navigating Files and Directories\"\n" +"teaching: 30\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I move around on my computer?\"\n" +"- \"How can I see what files and directories I have?\"\n" +"- \"How can I specify the location of a file or directory on my computer?\"\n" +"objectives:\n" +"- \"Explain the similarities and differences between a file and a directory.\"\n" +"- \"Translate an absolute path into a relative path and vice versa.\"\n" +"- \"Construct absolute and relative paths that identify specific files and directories.\"\n" +"- \"Demonstrate the use of tab completion, and explain its advantages.\"\n" +"keypoints:\n" +"- \"The file system is responsible for managing information on the disk.\"\n" +"- \"Information is stored in files, which are stored in directories (folders).\"\n" +"- \"Directories can also store other directories, which forms a directory tree.\"\n" +"- \"`cd path` changes the current working directory.\"\n" +"- \"`ls path` prints a listing of a specific file or directory; `ls` on its own lists the current working directory.\"\n" +"- \"`pwd` prints the user's current working directory.\"\n" +"- \"`whoami` shows the user's current identity.\"\n" +"- \"`/` on its own is the root directory of the whole file system.\"\n" +"- \"A relative path specifies a location starting from the current location.\"\n" +"- \"An absolute path specifies a location from the root of the file system.\"\n" +"- \"Directory names in a path are separated with `/` on Unix, but `\\\\\\\\` on Windows.\"\n" +"- \"`..` means 'the directory above the current one'; `.` on its own means 'the current directory'.\"\n" +"- \"Most files' names are `something.extension`. The extension isn't required, and doesn't guarantee anything, but is normally used to indicate the type of data in the file.\"\n" +"---" + +#: shell-novice/_episodes/02-filedir.md:30 +msgid "" +"The part of the operating system responsible for managing files and directories \n" +"is called the **file system**.\n" +"It organizes our data into files,\n" +"which hold information,\n" +"and directories (also called \"folders\"),\n" +"which hold files or other directories." +msgstr "" +"The part of the operating system responsible for managing files and directories \n" +"is called the **file system**.\n" +"It organizes our data into files,\n" +"which hold information,\n" +"and directories (also called \"folders\"),\n" +"which hold files or other directories." + +#: shell-novice/_episodes/02-filedir.md:37 +msgid "" +"Several commands are frequently used to create, inspect, rename, and delete files and directories.\n" +"To start exploring them, we'll go to our open shell window:" +msgstr "" +"Several commands are frequently used to create, inspect, rename, and delete files and directories.\n" +"To start exploring them, we'll go to our open shell window:" + +#: shell-novice/_episodes/02-filedir.md:40 +msgid "" +"First let's find out where we are by running a command called `pwd`\n" +"(which stands for \"print working directory\"). Directories are like *places* - at any time\n" +"while we are using the shell we are in exactly one place, called\n" +"our **current working directory**. Commands mostly read and write files in the \n" +"current working directory, i.e. \"here\", so knowing where you are before running\n" +"a command is important. `pwd` shows you where you are:" +msgstr "" +"First let's find out where we are by running a command called `pwd`\n" +"(which stands for \"print working directory\"). Directories are like *places* - at any time\n" +"while we are using the shell we are in exactly one place, called\n" +"our **current working directory**. Commands mostly read and write files in the \n" +"current working directory, i.e. \"here\", so knowing where you are before running\n" +"a command is important. `pwd` shows you where you are:" + +# code block +#: shell-novice/_episodes/02-filedir.md:47 +#: shell-novice/_episodes/02-filedir.md:474 +#: shell-novice/_episodes/02-filedir.md:530 +#: shell-novice/_episodes/02-filedir.md:603 +#: shell-novice/_episodes/02-filedir.md:647 +#: shell-novice/_episodes/03-create.md:27 +#: shell-novice/_episodes/03-create.md:262 +#: shell-novice/_episodes/03-create.md:350 +msgid "" +"~~~\n" +"$ pwd\n" +"~~~" +msgstr "" +"~~~\n" +"$ pwd\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:52 +#: shell-novice/_episodes/02-filedir.md:608 +msgid "" +"~~~\n" +"/Users/nelle\n" +"~~~" +msgstr "" +"~~~\n" +"/Users/nelle\n" +"~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:55 +#: shell-novice/_episodes/02-filedir.md:135 +#: shell-novice/_episodes/02-filedir.md:158 +#: shell-novice/_episodes/02-filedir.md:321 +#: shell-novice/_episodes/02-filedir.md:414 +#: shell-novice/_episodes/02-filedir.md:443 +#: shell-novice/_episodes/02-filedir.md:482 +#: shell-novice/_episodes/02-filedir.md:493 +#: shell-novice/_episodes/02-filedir.md:538 +#: shell-novice/_episodes/02-filedir.md:552 +#: shell-novice/_episodes/02-filedir.md:611 +#: shell-novice/_episodes/02-filedir.md:655 +#: shell-novice/_episodes/03-create.md:35 +#: shell-novice/_episodes/03-create.md:45 +#: shell-novice/_episodes/03-create.md:69 +#: shell-novice/_episodes/03-create.md:188 +#: shell-novice/_episodes/03-create.md:270 +#: shell-novice/_episodes/03-create.md:281 +#: shell-novice/_episodes/03-create.md:358 +#: shell-novice/_episodes/03-create.md:370 +#: shell-novice/_episodes/03-create.md:397 +#: shell-novice/_episodes/03-create.md:441 +#: shell-novice/_episodes/03-create.md:489 +#: shell-novice/_episodes/04-pipefilter.md:43 +#: shell-novice/_episodes/04-pipefilter.md:66 +#: shell-novice/_episodes/04-pipefilter.md:188 +#: shell-novice/_episodes/04-pipefilter.md:220 +#: shell-novice/_episodes/04-pipefilter.md:286 +#: shell-novice/_episodes/04-pipefilter.md:362 +#: shell-novice/_episodes/04-pipefilter.md:379 +#: shell-novice/_episodes/04-pipefilter.md:418 +#: shell-novice/_episodes/04-pipefilter.md:448 +#: shell-novice/_episodes/04-pipefilter.md:460 +#: shell-novice/_episodes/04-pipefilter.md:759 +#: shell-novice/_episodes/04-pipefilter.md:775 +#: shell-novice/_episodes/04-pipefilter.md:797 +#: shell-novice/_episodes/04-pipefilter.md:813 +#: shell-novice/_episodes/05-loop.md:80 shell-novice/_episodes/05-loop.md:313 +#: shell-novice/_episodes/05-loop.md:449 shell-novice/_episodes/05-loop.md:472 +#: shell-novice/_episodes/05-loop.md:528 shell-novice/_episodes/06-script.md:73 +#: shell-novice/_episodes/06-script.md:106 +#: shell-novice/_episodes/06-script.md:124 +#: shell-novice/_episodes/06-script.md:140 +#: shell-novice/_episodes/06-script.md:162 +#: shell-novice/_episodes/06-script.md:178 +#: shell-novice/_episodes/06-script.md:195 +#: shell-novice/_episodes/06-script.md:211 +#: shell-novice/_episodes/06-script.md:255 +#: shell-novice/_episodes/06-script.md:272 shell-novice/_episodes/07-find.md:54 +#: shell-novice/_episodes/07-find.md:76 shell-novice/_episodes/07-find.md:93 +#: shell-novice/_episodes/07-find.md:112 shell-novice/_episodes/07-find.md:128 +#: shell-novice/_episodes/07-find.md:148 shell-novice/_episodes/07-find.md:165 +#: shell-novice/_episodes/07-find.md:179 shell-novice/_episodes/07-find.md:200 +#: shell-novice/_episodes/07-find.md:230 shell-novice/_episodes/07-find.md:422 +#: shell-novice/_episodes/07-find.md:451 shell-novice/_episodes/07-find.md:472 +#: shell-novice/_episodes/07-find.md:484 shell-novice/_episodes/07-find.md:516 +#: shell-novice/_episodes/07-find.md:548 shell-novice/_episodes/07-find.md:579 +msgid "{: .output}" +msgstr "{: .output}" + +#: shell-novice/_episodes/02-filedir.md:57 +msgid "" +"Here,\n" +"the computer's response is `/Users/nelle`,\n" +"which is Nelle's **home directory**:" +msgstr "" +"Here,\n" +"the computer's response is `/Users/nelle`,\n" +"which is Nelle's **home directory**:" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:61 +msgid "> ## Home Directory Variation" +msgstr "> ## Home Directory Variation" + +#: shell-novice/_episodes/02-filedir.md:62 +msgid "" +">\n" +"> The home directory path will look different on different operating systems.\n" +"> On Linux it may look like `/home/nelle`,\n" +"> and on Windows it will be similar to `C:\\Documents and Settings\\nelle` or\n" +"> `C:\\Users\\nelle`. \n" +"> (Note that it may look slightly different for different versions of Windows.)\n" +"> In future examples, we've used Mac output as the default - Linux and Windows\n" +"> output may differ slightly, but should be generally similar. " +msgstr "" +">\n" +"> The home directory path will look different on different operating systems.\n" +"> On Linux it may look like `/home/nelle`,\n" +"> and on Windows it will be similar to `C:\\Documents and Settings\\nelle` or\n" +"> `C:\\Users\\nelle`. \n" +"> (Note that it may look slightly different for different versions of Windows.)\n" +"> In future examples, we've used Mac output as the default - Linux and Windows\n" +"> output may differ slightly, but should be generally similar. " + +#: shell-novice/_episodes/02-filedir.md:72 +msgid "" +"To understand what a \"home directory\" is,\n" +"let's have a look at how the file system as a whole is organized. For the\n" +"sake of this example, we'll be\n" +"illustrating the filesystem on our scientist Nelle's computer. After this\n" +"illustration, you'll be learning commands to explore your own filesystem,\n" +"which will be constructed in a similar way, but not be exactly identical. " +msgstr "" +"To understand what a \"home directory\" is,\n" +"let's have a look at how the file system as a whole is organized. For the\n" +"sake of this example, we'll be\n" +"illustrating the filesystem on our scientist Nelle's computer. After this\n" +"illustration, you'll be learning commands to explore your own filesystem,\n" +"which will be constructed in a similar way, but not be exactly identical. " + +#: shell-novice/_episodes/02-filedir.md:79 +msgid "On Nelle's computer, the filesystem looks like this:" +msgstr "On Nelle's computer, the filesystem looks like this:" + +#: shell-novice/_episodes/02-filedir.md:81 +msgid "![The File System](../fig/filesystem.svg)" +msgstr "![The File System](../fig/filesystem.svg)" + +#: shell-novice/_episodes/02-filedir.md:83 +msgid "" +"At the top is the **root directory**\n" +"that holds everything else.\n" +"We refer to it using a slash character `/` on its own;\n" +"this is the leading slash in `/Users/nelle`." +msgstr "" +"At the top is the **root directory**\n" +"that holds everything else.\n" +"We refer to it using a slash character `/` on its own;\n" +"this is the leading slash in `/Users/nelle`." + +#: shell-novice/_episodes/02-filedir.md:88 +msgid "" +"Inside that directory are several other directories:\n" +"`bin` (which is where some built-in programs are stored),\n" +"`data` (for miscellaneous data files),\n" +"`Users` (where users' personal directories are located),\n" +"`tmp` (for temporary files that don't need to be stored long-term),\n" +"and so on. " +msgstr "" +"Inside that directory are several other directories:\n" +"`bin` (which is where some built-in programs are stored),\n" +"`data` (for miscellaneous data files),\n" +"`Users` (where users' personal directories are located),\n" +"`tmp` (for temporary files that don't need to be stored long-term),\n" +"and so on. " + +#: shell-novice/_episodes/02-filedir.md:95 +msgid "" +"We know that our current working directory `/Users/nelle` is stored inside `/Users`\n" +"because `/Users` is the first part of its name.\n" +"Similarly,\n" +"we know that `/Users` is stored inside the root directory `/`\n" +"because its name begins with `/`." +msgstr "" +"We know that our current working directory `/Users/nelle` is stored inside `/Users`\n" +"because `/Users` is the first part of its name.\n" +"Similarly,\n" +"we know that `/Users` is stored inside the root directory `/`\n" +"because its name begins with `/`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:101 +msgid "> ## Slashes" +msgstr "> ## Slashes" + +#: shell-novice/_episodes/02-filedir.md:102 +msgid "" +">\n" +"> Notice that there are two meanings for the `/` character.\n" +"> When it appears at the front of a file or directory name,\n" +"> it refers to the root directory. When it appears *inside* a name,\n" +"> it's just a separator." +msgstr "" +">\n" +"> Notice that there are two meanings for the `/` character.\n" +"> When it appears at the front of a file or directory name,\n" +"> it refers to the root directory. When it appears *inside* a name,\n" +"> it's just a separator." + +#: shell-novice/_episodes/02-filedir.md:109 +msgid "" +"Underneath `/Users`,\n" +"we find one directory for each user with an account on Nelle's machine,\n" +"her colleagues the Mummy and Wolfman. " +msgstr "" +"Underneath `/Users`,\n" +"we find one directory for each user with an account on Nelle's machine,\n" +"her colleagues the Mummy and Wolfman. " + +#: shell-novice/_episodes/02-filedir.md:113 +msgid "![Home Directories](../fig/home-directories.svg)" +msgstr "![Home Directories](../fig/home-directories.svg)" + +#: shell-novice/_episodes/02-filedir.md:115 +msgid "" +"The Mummy's files are stored in `/Users/imhotep`,\n" +"Wolfman's in `/Users/larry`,\n" +"and Nelle's in `/Users/nelle`. Because Nelle is the user in our\n" +"examples here, this is why we get `/Users/nelle` as our home directory. \n" +"Typically, when you open a new command prompt you will be in\n" +"your home directory to start. " +msgstr "" +"The Mummy's files are stored in `/Users/imhotep`,\n" +"Wolfman's in `/Users/larry`,\n" +"and Nelle's in `/Users/nelle`. Because Nelle is the user in our\n" +"examples here, this is why we get `/Users/nelle` as our home directory. \n" +"Typically, when you open a new command prompt you will be in\n" +"your home directory to start. " + +#: shell-novice/_episodes/02-filedir.md:122 +msgid "" +"Now let's learn the command that will let us see the contents of our\n" +"own filesystem. We can see what's in our home directory by running `ls`,\n" +"which stands for \"listing\":" +msgstr "" +"Now let's learn the command that will let us see the contents of our\n" +"own filesystem. We can see what's in our home directory by running `ls`,\n" +"which stands for \"listing\":" + +# code block +#: shell-novice/_episodes/02-filedir.md:126 +#: shell-novice/_episodes/03-create.md:180 +#: shell-novice/_episodes/03-create.md:243 +msgid "" +"~~~\n" +"$ ls\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:131 +msgid "" +"~~~\n" +"Applications Documents Library Music Public\n" +"Desktop Downloads Movies Pictures\n" +"~~~" +msgstr "" +"~~~\n" +"Applications Documents Library Music Public\n" +"Desktop Downloads Movies Pictures\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:137 +msgid "" +"(Again, your results may be slightly different depending on your operating\n" +"system and how you have customized your filesystem.)" +msgstr "" +"(Again, your results may be slightly different depending on your operating\n" +"system and how you have customized your filesystem.)" + +#: shell-novice/_episodes/02-filedir.md:140 +msgid "" +"`ls` prints the names of the files and directories in the current directory. \n" +"We can make its output more comprehensible by using the **flag** `-F`\n" +"(also known as a **switch** or an **option**) ,\n" +"which tells `ls` to add a marker to file and directory names to indicate what\n" +"they are. A trailing `/` indicates that this is a directory. Depending on your\n" +"settings, it might also use colors to indicate whether each entry is a file or \n" +"directory.\n" +"You might recall that we used `ls -F` in an earlier example." +msgstr "" +"`ls` prints the names of the files and directories in the current directory. \n" +"We can make its output more comprehensible by using the **flag** `-F`\n" +"(also known as a **switch** or an **option**) ,\n" +"which tells `ls` to add a marker to file and directory names to indicate what\n" +"they are. A trailing `/` indicates that this is a directory. Depending on your\n" +"settings, it might also use colors to indicate whether each entry is a file or \n" +"directory.\n" +"You might recall that we used `ls -F` in an earlier example." + +# code block +#: shell-novice/_episodes/02-filedir.md:149 +#: shell-novice/_episodes/02-filedir.md:484 +#: shell-novice/_episodes/03-create.md:37 +#: shell-novice/_episodes/03-create.md:61 +msgid "" +"~~~\n" +"$ ls -F\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls -F\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:154 +msgid "" +"~~~\n" +"Applications/ Documents/ Library/ Music/ Public/\n" +"Desktop/ Downloads/ Movies/ Pictures/\n" +"~~~" +msgstr "" +"~~~\n" +"Applications/ Documents/ Library/ Music/ Public/\n" +"Desktop/ Downloads/ Movies/ Pictures/\n" +"~~~" + +# header +#: shell-novice/_episodes/02-filedir.md:160 +msgid "### Getting help" +msgstr "### Getting help" + +#: shell-novice/_episodes/02-filedir.md:162 +msgid "" +"`ls` has lots of other **flags**. There are two common ways to find out how \n" +"to use a command and what flags it accepts:" +msgstr "" +"`ls` has lots of other **flags**. There are two common ways to find out how \n" +"to use a command and what flags it accepts:" + +# ordered list +#: shell-novice/_episodes/02-filedir.md:165 +msgid "1. We can pass a `--help` flag to the command, such as:" +msgstr "1. We can pass a `--help` flag to the command, such as:" + +#: shell-novice/_episodes/02-filedir.md:166 +msgid "" +" ~~~\n" +" $ ls --help\n" +" ~~~" +msgstr "" +" ~~~\n" +" $ ls --help\n" +" ~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:169 +#: shell-novice/_episodes/02-filedir.md:175 shell-novice/_extras/guide.md:210 +msgid " {: .bash}" +msgstr " {: .bash}" + +# ordered list +#: shell-novice/_episodes/02-filedir.md:171 +msgid "2. We can read its manual with `man`, such as:" +msgstr "2. We can read its manual with `man`, such as:" + +#: shell-novice/_episodes/02-filedir.md:172 +msgid "" +" ~~~\n" +" $ man ls \n" +" ~~~" +msgstr "" +" ~~~\n" +" $ man ls \n" +" ~~~" + +#: shell-novice/_episodes/02-filedir.md:177 +msgid "" +"If you use a Mac, or Git for Windows, you might find that only one of these works \n" +"(probably `man` on Mac and `--help` in Windows). We'll describe both ways." +msgstr "" +"If you use a Mac, or Git for Windows, you might find that only one of these works \n" +"(probably `man` on Mac and `--help` in Windows). We'll describe both ways." + +#: shell-novice/_episodes/02-filedir.md:180 +msgid "" +"Of course there is a third way: searching the internet via your web browser. \n" +"When using internet search, including the phrase `unix man page` in your search\n" +"query will help to find relevant results." +msgstr "" +"Of course there is a third way: searching the internet via your web browser. \n" +"When using internet search, including the phrase `unix man page` in your search\n" +"query will help to find relevant results." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:184 +msgid "> ## Manual pages on the web" +msgstr "> ## Manual pages on the web" + +#: shell-novice/_episodes/02-filedir.md:185 +msgid "" +">\n" +"> GNU provides links to its\n" +"> [manuals](http://www.gnu.org/manual/manual.html) including the\n" +"> [core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html),\n" +"> which covers many commands introduced within this lesson." +msgstr "" +">\n" +"> GNU provides links to its\n" +"> [manuals](http://www.gnu.org/manual/manual.html) including the\n" +"> [core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html),\n" +"> which covers many commands introduced within this lesson." + +# header +#: shell-novice/_episodes/02-filedir.md:192 +msgid "#### The `--help` flag" +msgstr "#### The `--help` flag" + +#: shell-novice/_episodes/02-filedir.md:194 +msgid "" +"Many bash commands, and programs that people have written that can be\n" +"run from within bash, support a `--help` flag to display more\n" +"information on how to use the command or program." +msgstr "" +"Many bash commands, and programs that people have written that can be\n" +"run from within bash, support a `--help` flag to display more\n" +"information on how to use the command or program." + +# code block +#: shell-novice/_episodes/02-filedir.md:198 +msgid "" +"~~~\n" +"$ ls --help\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls --help\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:203 +msgid "" +"~~~\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"\n" +"Mandatory arguments to long options are mandatory for short options too.\n" +" -a, --all do not ignore entries starting with .\n" +" -A, --almost-all do not list implied . and ..\n" +" --author with -l, print the author of each file\n" +" -b, --escape print C-style escapes for nongraphic characters\n" +" --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n" +" '--block-size=M' prints sizes in units of\n" +" 1,048,576 bytes; see SIZE format below\n" +" -B, --ignore-backups do not list implied entries ending with ~\n" +" -c with -lt: sort by, and show, ctime (time of last\n" +" modification of file status information);\n" +" with -l: show ctime and sort by name;\n" +" otherwise: sort by ctime, newest first\n" +" -C list entries by columns\n" +" --color[=WHEN] colorize the output; WHEN can be 'always' (default\n" +" if omitted), 'auto', or 'never'; more info below\n" +" -d, --directory list directories themselves, not their contents\n" +" -D, --dired generate output designed for Emacs' dired mode\n" +" -f do not sort, enable -aU, disable -ls --color\n" +" -F, --classify append indicator (one of */=>@|) to entries\n" +" --file-type likewise, except do not append '*'\n" +" --format=WORD across -x, commas -m, horizontal -x, long -l,\n" +" single-column -1, verbose -l, vertical -C\n" +" --full-time like -l --time-style=full-iso\n" +" -g like -l, but do not list owner\n" +" --group-directories-first\n" +" group directories before files;\n" +" can be augmented with a --sort option, but any\n" +" use of --sort=none (-U) disables grouping\n" +" -G, --no-group in a long listing, don't print group names\n" +" -h, --human-readable with -l and/or -s, print human readable sizes\n" +" (e.g., 1K 234M 2G)\n" +" --si likewise, but use powers of 1000 not 1024\n" +" -H, --dereference-command-line\n" +" follow symbolic links listed on the command line\n" +" --dereference-command-line-symlink-to-dir\n" +" follow each command line symbolic link\n" +" that points to a directory\n" +" --hide=PATTERN do not list implied entries matching shell PATTERN\n" +" (overridden by -a or -A)\n" +" --indicator-style=WORD append indicator with style WORD to entry names:\n" +" none (default), slash (-p),\n" +" file-type (--file-type), classify (-F)\n" +" -i, --inode print the index number of each file\n" +" -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n" +" -k, --kibibytes default to 1024-byte blocks for disk usage\n" +" -l use a long listing format\n" +" -L, --dereference when showing file information for a symbolic\n" +" link, show information for the file the link\n" +" references rather than for the link itself\n" +" -m fill width with a comma separated list of entries\n" +" -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n" +" -N, --literal print raw entry names (don't treat e.g. control\n" +" characters specially)\n" +" -o like -l, but do not list group information\n" +" -p, --indicator-style=slash\n" +" append / indicator to directories\n" +" -q, --hide-control-chars print ? instead of nongraphic characters\n" +" --show-control-chars show nongraphic characters as-is (the default,\n" +" unless program is 'ls' and output is a terminal)\n" +" -Q, --quote-name enclose entry names in double quotes\n" +" --quoting-style=WORD use quoting style WORD for entry names:\n" +" literal, locale, shell, shell-always,\n" +" shell-escape, shell-escape-always, c, escape\n" +" -r, --reverse reverse order while sorting\n" +" -R, --recursive list subdirectories recursively\n" +" -s, --size print the allocated size of each file, in blocks\n" +" -S sort by file size, largest first\n" +" --sort=WORD sort by WORD instead of name: none (-U), size (-S),\n" +" time (-t), version (-v), extension (-X)\n" +" --time=WORD with -l, show time as WORD instead of default\n" +" modification time: atime or access or use (-u);\n" +" ctime or status (-c); also use specified time\n" +" as sort key if --sort=time (newest first)\n" +" --time-style=STYLE with -l, show times using style STYLE:\n" +" full-iso, long-iso, iso, locale, or +FORMAT;\n" +" FORMAT is interpreted like in 'date'; if FORMAT\n" +" is FORMAT1FORMAT2, then FORMAT1 applies\n" +" to non-recent files and FORMAT2 to recent files;\n" +" if STYLE is prefixed with 'posix-', STYLE\n" +" takes effect only outside the POSIX locale\n" +" -t sort by modification time, newest first\n" +" -T, --tabsize=COLS assume tab stops at each COLS instead of 8\n" +" -u with -lt: sort by, and show, access time;\n" +" with -l: show access time and sort by name;\n" +" otherwise: sort by access time, newest first\n" +" -U do not sort; list entries in directory order\n" +" -v natural sort of (version) numbers within text\n" +" -w, --width=COLS set output width to COLS. 0 means no limit\n" +" -x list entries by lines instead of by columns\n" +" -X sort alphabetically by entry extension\n" +" -Z, --context print any security context of each file\n" +" -1 list one file per line. Avoid '\\n' with -q or -b\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\n" +"Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\n" +"\n" +"Using color to distinguish file types is disabled both by default and\n" +"with --color=never. With --color=auto, ls emits color codes only when\n" +"standard output is connected to a terminal. The LS_COLORS environment\n" +"variable can change the settings. Use the dircolors command to set it.\n" +"\n" +"Exit status:\n" +" 0 if OK,\n" +" 1 if minor problems (e.g., cannot access subdirectory),\n" +" 2 if serious trouble (e.g., cannot access command-line argument).\n" +"\n" +"GNU coreutils online help: \n" +"Full documentation at: \n" +"or available locally via: info '(coreutils) ls invocation'\n" +"~~~" +msgstr "" +"~~~\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"\n" +"Mandatory arguments to long options are mandatory for short options too.\n" +" -a, --all do not ignore entries starting with .\n" +" -A, --almost-all do not list implied . and ..\n" +" --author with -l, print the author of each file\n" +" -b, --escape print C-style escapes for nongraphic characters\n" +" --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n" +" '--block-size=M' prints sizes in units of\n" +" 1,048,576 bytes; see SIZE format below\n" +" -B, --ignore-backups do not list implied entries ending with ~\n" +" -c with -lt: sort by, and show, ctime (time of last\n" +" modification of file status information);\n" +" with -l: show ctime and sort by name;\n" +" otherwise: sort by ctime, newest first\n" +" -C list entries by columns\n" +" --color[=WHEN] colorize the output; WHEN can be 'always' (default\n" +" if omitted), 'auto', or 'never'; more info below\n" +" -d, --directory list directories themselves, not their contents\n" +" -D, --dired generate output designed for Emacs' dired mode\n" +" -f do not sort, enable -aU, disable -ls --color\n" +" -F, --classify append indicator (one of */=>@|) to entries\n" +" --file-type likewise, except do not append '*'\n" +" --format=WORD across -x, commas -m, horizontal -x, long -l,\n" +" single-column -1, verbose -l, vertical -C\n" +" --full-time like -l --time-style=full-iso\n" +" -g like -l, but do not list owner\n" +" --group-directories-first\n" +" group directories before files;\n" +" can be augmented with a --sort option, but any\n" +" use of --sort=none (-U) disables grouping\n" +" -G, --no-group in a long listing, don't print group names\n" +" -h, --human-readable with -l and/or -s, print human readable sizes\n" +" (e.g., 1K 234M 2G)\n" +" --si likewise, but use powers of 1000 not 1024\n" +" -H, --dereference-command-line\n" +" follow symbolic links listed on the command line\n" +" --dereference-command-line-symlink-to-dir\n" +" follow each command line symbolic link\n" +" that points to a directory\n" +" --hide=PATTERN do not list implied entries matching shell PATTERN\n" +" (overridden by -a or -A)\n" +" --indicator-style=WORD append indicator with style WORD to entry names:\n" +" none (default), slash (-p),\n" +" file-type (--file-type), classify (-F)\n" +" -i, --inode print the index number of each file\n" +" -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n" +" -k, --kibibytes default to 1024-byte blocks for disk usage\n" +" -l use a long listing format\n" +" -L, --dereference when showing file information for a symbolic\n" +" link, show information for the file the link\n" +" references rather than for the link itself\n" +" -m fill width with a comma separated list of entries\n" +" -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n" +" -N, --literal print raw entry names (don't treat e.g. control\n" +" characters specially)\n" +" -o like -l, but do not list group information\n" +" -p, --indicator-style=slash\n" +" append / indicator to directories\n" +" -q, --hide-control-chars print ? instead of nongraphic characters\n" +" --show-control-chars show nongraphic characters as-is (the default,\n" +" unless program is 'ls' and output is a terminal)\n" +" -Q, --quote-name enclose entry names in double quotes\n" +" --quoting-style=WORD use quoting style WORD for entry names:\n" +" literal, locale, shell, shell-always,\n" +" shell-escape, shell-escape-always, c, escape\n" +" -r, --reverse reverse order while sorting\n" +" -R, --recursive list subdirectories recursively\n" +" -s, --size print the allocated size of each file, in blocks\n" +" -S sort by file size, largest first\n" +" --sort=WORD sort by WORD instead of name: none (-U), size (-S),\n" +" time (-t), version (-v), extension (-X)\n" +" --time=WORD with -l, show time as WORD instead of default\n" +" modification time: atime or access or use (-u);\n" +" ctime or status (-c); also use specified time\n" +" as sort key if --sort=time (newest first)\n" +" --time-style=STYLE with -l, show times using style STYLE:\n" +" full-iso, long-iso, iso, locale, or +FORMAT;\n" +" FORMAT is interpreted like in 'date'; if FORMAT\n" +" is FORMAT1FORMAT2, then FORMAT1 applies\n" +" to non-recent files and FORMAT2 to recent files;\n" +" if STYLE is prefixed with 'posix-', STYLE\n" +" takes effect only outside the POSIX locale\n" +" -t sort by modification time, newest first\n" +" -T, --tabsize=COLS assume tab stops at each COLS instead of 8\n" +" -u with -lt: sort by, and show, access time;\n" +" with -l: show access time and sort by name;\n" +" otherwise: sort by access time, newest first\n" +" -U do not sort; list entries in directory order\n" +" -v natural sort of (version) numbers within text\n" +" -w, --width=COLS set output width to COLS. 0 means no limit\n" +" -x list entries by lines instead of by columns\n" +" -X sort alphabetically by entry extension\n" +" -Z, --context print any security context of each file\n" +" -1 list one file per line. Avoid '\\n' with -q or -b\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\n" +"Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\n" +"\n" +"Using color to distinguish file types is disabled both by default and\n" +"with --color=never. With --color=auto, ls emits color codes only when\n" +"standard output is connected to a terminal. The LS_COLORS environment\n" +"variable can change the settings. Use the dircolors command to set it.\n" +"\n" +"Exit status:\n" +" 0 if OK,\n" +" 1 if minor problems (e.g., cannot access subdirectory),\n" +" 2 if serious trouble (e.g., cannot access command-line argument).\n" +"\n" +"GNU coreutils online help: \n" +"Full documentation at: \n" +"or available locally via: info '(coreutils) ls invocation'\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:323 +msgid "> ## Unsupported command-line options" +msgstr "> ## Unsupported command-line options" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:324 +msgid "> If you try to use an option (flag) that is not supported, `ls` and other programs" +msgstr "> If you try to use an option (flag) that is not supported, `ls` and other programs" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:325 +msgid "> will usually print an error message similar to this:" +msgstr "> will usually print an error message similar to this:" + +#: shell-novice/_episodes/02-filedir.md:326 +msgid "" +">\n" +"> ~~~\n" +"> $ ls -j\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> \n" +"> ~~~\n" +"> ls: invalid option -- 'j'\n" +"> Try 'ls --help' for more information.\n" +"> ~~~" +msgstr "" +">\n" +"> ~~~\n" +"> $ ls -j\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> \n" +"> ~~~\n" +"> ls: invalid option -- 'j'\n" +"> Try 'ls --help' for more information.\n" +"> ~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:336 +msgid "> {: .error}" +msgstr "> {: .error}" + +# header +#: shell-novice/_episodes/02-filedir.md:339 +msgid "#### The `man` command" +msgstr "#### The `man` command" + +#: shell-novice/_episodes/02-filedir.md:341 +msgid "" +"The other way to learn about `ls` is to type \n" +"~~~\n" +"$ man ls\n" +"~~~" +msgstr "" +"The other way to learn about `ls` is to type \n" +"~~~\n" +"$ man ls\n" +"~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:345 +msgid "{: .bash}" +msgstr "{: .bash}" + +#: shell-novice/_episodes/02-filedir.md:347 +msgid "" +"This will turn your terminal into a page with a description \n" +"of the `ls` command and its options and, if you're lucky, some examples\n" +"of how to use it." +msgstr "" +"This will turn your terminal into a page with a description \n" +"of the `ls` command and its options and, if you're lucky, some examples\n" +"of how to use it." + +#: shell-novice/_episodes/02-filedir.md:351 +msgid "" +"To navigate through the `man` pages,\n" +"you may use the up and down arrow keys to move line-by-line,\n" +"or try the \"b\" and spacebar keys to skip up and down by a full page.\n" +"To search for a character or word in the `man` pages, \n" +"use \"/\" followed by the character or word you are searching for. " +msgstr "" +"To navigate through the `man` pages,\n" +"you may use the up and down arrow keys to move line-by-line,\n" +"or try the \"b\" and spacebar keys to skip up and down by a full page.\n" +"To search for a character or word in the `man` pages, \n" +"use \"/\" followed by the character or word you are searching for. " + +#: shell-novice/_episodes/02-filedir.md:357 +msgid "To **quit** the `man` pages, press `q`. " +msgstr "To **quit** the `man` pages, press `q`. " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:360 +msgid "> ## Exploring More `ls` Flags" +msgstr "> ## Exploring More `ls` Flags" + +#: shell-novice/_episodes/02-filedir.md:361 +msgid "" +">\n" +"> What does the command `ls` do when used with the `-l` and `-h` flags?\n" +">\n" +"> Some of its output is about properties that we do not cover in this lesson (such\n" +"> as file permissions and ownership), but the rest should be useful\n" +"> nevertheless.\n" +">\n" +"> > ## Solution\n" +"> > The `-l` flag makes `ls` use a **l**ong listing format, showing not only\n" +"> > the file/directory names but also additional information such as the file size\n" +"> > and the time of its last modification. The `-h` flag makes the file size\n" +"> > \"**h**uman readable\", i.e. display something like `5.3K` instead of `5369`." +msgstr "" +">\n" +"> What does the command `ls` do when used with the `-l` and `-h` flags?\n" +">\n" +"> Some of its output is about properties that we do not cover in this lesson (such\n" +"> as file permissions and ownership), but the rest should be useful\n" +"> nevertheless.\n" +">\n" +"> > ## Solution\n" +"> > The `-l` flag makes `ls` use a **l**ong listing format, showing not only\n" +"> > the file/directory names but also additional information such as the file size\n" +"> > and the time of its last modification. The `-h` flag makes the file size\n" +"> > \"**h**uman readable\", i.e. display something like `5.3K` instead of `5369`." + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:373 +#: shell-novice/_episodes/02-filedir.md:387 +#: shell-novice/_episodes/02-filedir.md:706 +#: shell-novice/_episodes/02-filedir.md:727 +#: shell-novice/_episodes/02-filedir.md:753 +#: shell-novice/_episodes/03-create.md:226 +#: shell-novice/_episodes/03-create.md:324 +#: shell-novice/_episodes/03-create.md:471 +#: shell-novice/_episodes/03-create.md:555 +#: shell-novice/_episodes/03-create.md:604 +#: shell-novice/_episodes/03-create.md:650 +#: shell-novice/_episodes/03-create.md:691 +#: shell-novice/_episodes/03-create.md:740 +#: shell-novice/_episodes/04-pipefilter.md:123 +#: shell-novice/_episodes/04-pipefilter.md:168 +#: shell-novice/_episodes/04-pipefilter.md:263 +#: shell-novice/_episodes/04-pipefilter.md:340 +#: shell-novice/_episodes/04-pipefilter.md:483 +#: shell-novice/_episodes/04-pipefilter.md:604 +#: shell-novice/_episodes/04-pipefilter.md:641 +#: shell-novice/_episodes/04-pipefilter.md:702 +#: shell-novice/_episodes/04-pipefilter.md:733 +#: shell-novice/_episodes/04-pipefilter.md:860 +#: shell-novice/_episodes/04-pipefilter.md:884 +#: shell-novice/_episodes/05-loop.md:186 shell-novice/_episodes/05-loop.md:261 +#: shell-novice/_episodes/05-loop.md:282 shell-novice/_episodes/05-loop.md:606 +#: shell-novice/_episodes/05-loop.md:633 shell-novice/_episodes/05-loop.md:685 +#: shell-novice/_episodes/05-loop.md:712 +#: shell-novice/_episodes/06-script.md:312 +#: shell-novice/_episodes/06-script.md:387 +#: shell-novice/_episodes/06-script.md:496 +#: shell-novice/_episodes/06-script.md:526 +#: shell-novice/_episodes/06-script.md:570 +#: shell-novice/_episodes/06-script.md:612 +#: shell-novice/_episodes/07-find.md:249 shell-novice/_episodes/07-find.md:338 +#: shell-novice/_episodes/07-find.md:382 shell-novice/_episodes/07-find.md:605 +#: shell-novice/_episodes/07-find.md:657 shell-novice/_episodes/07-find.md:679 +msgid "> {: .solution}" +msgstr "> {: .solution}" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:374 +#: shell-novice/_episodes/02-filedir.md:388 +#: shell-novice/_episodes/02-filedir.md:707 +#: shell-novice/_episodes/02-filedir.md:728 +#: shell-novice/_episodes/02-filedir.md:754 +#: shell-novice/_episodes/03-create.md:227 +#: shell-novice/_episodes/03-create.md:325 +#: shell-novice/_episodes/03-create.md:472 +#: shell-novice/_episodes/03-create.md:556 +#: shell-novice/_episodes/03-create.md:605 +#: shell-novice/_episodes/03-create.md:651 +#: shell-novice/_episodes/03-create.md:692 +#: shell-novice/_episodes/03-create.md:741 +#: shell-novice/_episodes/04-pipefilter.md:124 +#: shell-novice/_episodes/04-pipefilter.md:169 +#: shell-novice/_episodes/04-pipefilter.md:239 +#: shell-novice/_episodes/04-pipefilter.md:264 +#: shell-novice/_episodes/04-pipefilter.md:341 +#: shell-novice/_episodes/04-pipefilter.md:484 +#: shell-novice/_episodes/04-pipefilter.md:605 +#: shell-novice/_episodes/04-pipefilter.md:642 +#: shell-novice/_episodes/04-pipefilter.md:667 +#: shell-novice/_episodes/04-pipefilter.md:703 +#: shell-novice/_episodes/04-pipefilter.md:734 +#: shell-novice/_episodes/04-pipefilter.md:861 +#: shell-novice/_episodes/04-pipefilter.md:885 +#: shell-novice/_episodes/05-loop.md:187 shell-novice/_episodes/05-loop.md:283 +#: shell-novice/_episodes/05-loop.md:607 shell-novice/_episodes/05-loop.md:634 +#: shell-novice/_episodes/05-loop.md:686 shell-novice/_episodes/05-loop.md:713 +#: shell-novice/_episodes/06-script.md:313 +#: shell-novice/_episodes/06-script.md:388 +#: shell-novice/_episodes/06-script.md:497 +#: shell-novice/_episodes/06-script.md:527 +#: shell-novice/_episodes/06-script.md:571 +#: shell-novice/_episodes/06-script.md:613 +#: shell-novice/_episodes/07-find.md:250 shell-novice/_episodes/07-find.md:339 +#: shell-novice/_episodes/07-find.md:383 shell-novice/_episodes/07-find.md:606 +#: shell-novice/_episodes/07-find.md:658 shell-novice/_episodes/07-find.md:680 +msgid "{: .challenge}" +msgstr "{: .challenge}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:376 +msgid "> ## Listing Recursively and By Time" +msgstr "> ## Listing Recursively and By Time" + +#: shell-novice/_episodes/02-filedir.md:377 +msgid "" +">\n" +"> The command `ls -R` lists the contents of directories recursively, i.e., lists\n" +"> their sub-directories, sub-sub-directories, and so on at each level. The command\n" +"> `ls -t` lists things by time of last change, with most recently changed files or\n" +"> directories first.\n" +"> In what order does `ls -R -t` display things? Hint: `ls -l` uses a long listing\n" +"> format to view timestamps.\n" +">\n" +"> > ## Solution\n" +"> > The files/directories in each directory are sorted by time of last change." +msgstr "" +">\n" +"> The command `ls -R` lists the contents of directories recursively, i.e., lists\n" +"> their sub-directories, sub-sub-directories, and so on at each level. The command\n" +"> `ls -t` lists things by time of last change, with most recently changed files or\n" +"> directories first.\n" +"> In what order does `ls -R -t` display things? Hint: `ls -l` uses a long listing\n" +"> format to view timestamps.\n" +">\n" +"> > ## Solution\n" +"> > The files/directories in each directory are sorted by time of last change." + +#: shell-novice/_episodes/02-filedir.md:390 +msgid "" +"Here,\n" +"we can see that our home directory contains mostly **sub-directories**.\n" +"Any names in your output that don't have trailing slashes,\n" +"are plain old **files**.\n" +"And note that there is a space between `ls` and `-F`:\n" +"without it,\n" +"the shell thinks we're trying to run a command called `ls-F`,\n" +"which doesn't exist." +msgstr "" +"Here,\n" +"we can see that our home directory contains mostly **sub-directories**.\n" +"Any names in your output that don't have trailing slashes,\n" +"are plain old **files**.\n" +"And note that there is a space between `ls` and `-F`:\n" +"without it,\n" +"the shell thinks we're trying to run a command called `ls-F`,\n" +"which doesn't exist." + +#: shell-novice/_episodes/02-filedir.md:399 +msgid "" +"We can also use `ls` to see the contents of a different directory. Let's take a\n" +"look at our `Desktop` directory by running `ls -F Desktop`,\n" +"i.e.,\n" +"the command `ls` with the `-F` **flag** and the **argument** `Desktop`.\n" +"The argument `Desktop` tells `ls` that\n" +"we want a listing of something other than our current working directory:" +msgstr "" +"We can also use `ls` to see the contents of a different directory. Let's take a\n" +"look at our `Desktop` directory by running `ls -F Desktop`,\n" +"i.e.,\n" +"the command `ls` with the `-F` **flag** and the **argument** `Desktop`.\n" +"The argument `Desktop` tells `ls` that\n" +"we want a listing of something other than our current working directory:" + +# code block +#: shell-novice/_episodes/02-filedir.md:406 +msgid "" +"~~~\n" +"$ ls -F Desktop\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls -F Desktop\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:411 +msgid "" +"~~~\n" +"data-shell/\n" +"~~~" +msgstr "" +"~~~\n" +"data-shell/\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:416 +msgid "" +"Your output should be a list of all the files and sub-directories on your\n" +"Desktop, including the `data-shell` directory you downloaded at\n" +"the start of the lesson. Take a look at your Desktop to confirm that\n" +"your output is accurate. " +msgstr "" +"Your output should be a list of all the files and sub-directories on your\n" +"Desktop, including the `data-shell` directory you downloaded at\n" +"the start of the lesson. Take a look at your Desktop to confirm that\n" +"your output is accurate. " + +#: shell-novice/_episodes/02-filedir.md:421 +msgid "" +"As you may now see, using a bash shell is strongly dependent on the idea that\n" +"your files are organized in a hierarchical file system.\n" +"Organizing things hierarchically in this way helps us keep track of our work:\n" +"it's possible to put hundreds of files in our home directory,\n" +"just as it's possible to pile hundreds of printed papers on our desk,\n" +"but it's a self-defeating strategy." +msgstr "" +"As you may now see, using a bash shell is strongly dependent on the idea that\n" +"your files are organized in a hierarchical file system.\n" +"Organizing things hierarchically in this way helps us keep track of our work:\n" +"it's possible to put hundreds of files in our home directory,\n" +"just as it's possible to pile hundreds of printed papers on our desk,\n" +"but it's a self-defeating strategy." + +#: shell-novice/_episodes/02-filedir.md:428 +msgid "" +"Now that we know the `data-shell` directory is located on our Desktop, we\n" +"can do two things. " +msgstr "" +"Now that we know the `data-shell` directory is located on our Desktop, we\n" +"can do two things. " + +#: shell-novice/_episodes/02-filedir.md:431 +msgid "" +"First, we can look at its contents, using the same strategy as before, passing\n" +"a directory name to `ls`:" +msgstr "" +"First, we can look at its contents, using the same strategy as before, passing\n" +"a directory name to `ls`:" + +# code block +#: shell-novice/_episodes/02-filedir.md:434 +msgid "" +"~~~\n" +"$ ls -F Desktop/data-shell\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls -F Desktop/data-shell\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:439 +msgid "" +"~~~\n" +"creatures/ molecules/ notes.txt solar.pdf\n" +"data/ north-pacific-gyre/ pizza.cfg writing/\n" +"~~~" +msgstr "" +"~~~\n" +"creatures/ molecules/ notes.txt solar.pdf\n" +"data/ north-pacific-gyre/ pizza.cfg writing/\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:445 +msgid "" +"Second, we can actually change our location to a different directory, so\n" +"we are no longer located in\n" +"our home directory. " +msgstr "" +"Second, we can actually change our location to a different directory, so\n" +"we are no longer located in\n" +"our home directory. " + +#: shell-novice/_episodes/02-filedir.md:449 +msgid "" +"The command to change locations is `cd` followed by a\n" +"directory name to change our working directory.\n" +"`cd` stands for \"change directory\",\n" +"which is a bit misleading:\n" +"the command doesn't change the directory,\n" +"it changes the shell's idea of what directory we are in." +msgstr "" +"The command to change locations is `cd` followed by a\n" +"directory name to change our working directory.\n" +"`cd` stands for \"change directory\",\n" +"which is a bit misleading:\n" +"the command doesn't change the directory,\n" +"it changes the shell's idea of what directory we are in." + +#: shell-novice/_episodes/02-filedir.md:456 +msgid "" +"Let's say we want to move to the `data` directory we saw above. We can\n" +"use the following series of commands to get there:" +msgstr "" +"Let's say we want to move to the `data` directory we saw above. We can\n" +"use the following series of commands to get there:" + +# code block +#: shell-novice/_episodes/02-filedir.md:459 +msgid "" +"~~~\n" +"$ cd Desktop\n" +"$ cd data-shell\n" +"$ cd data\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd Desktop\n" +"$ cd data-shell\n" +"$ cd data\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:466 +msgid "" +"These commands will move us from our home directory onto our Desktop, then into\n" +"the `data-shell` directory, then into the `data` directory. `cd` doesn't print anything,\n" +"but if we run `pwd` after it, we can see that we are now\n" +"in `/Users/nelle/Desktop/data-shell/data`.\n" +"If we run `ls` without arguments now,\n" +"it lists the contents of `/Users/nelle/Desktop/data-shell/data`,\n" +"because that's where we now are:" +msgstr "" +"These commands will move us from our home directory onto our Desktop, then into\n" +"the `data-shell` directory, then into the `data` directory. `cd` doesn't print anything,\n" +"but if we run `pwd` after it, we can see that we are now\n" +"in `/Users/nelle/Desktop/data-shell/data`.\n" +"If we run `ls` without arguments now,\n" +"it lists the contents of `/Users/nelle/Desktop/data-shell/data`,\n" +"because that's where we now are:" + +# code block +#: shell-novice/_episodes/02-filedir.md:479 +#: shell-novice/_episodes/02-filedir.md:652 +msgid "" +"~~~\n" +"/Users/nelle/Desktop/data-shell/data\n" +"~~~" +msgstr "" +"~~~\n" +"/Users/nelle/Desktop/data-shell/data\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:489 +msgid "" +"~~~\n" +"amino-acids.txt elements/ pdb/\t salmon.txt\n" +"animals.txt morse.txt planets.txt sunspot.txt\n" +"~~~" +msgstr "" +"~~~\n" +"amino-acids.txt elements/ pdb/\t salmon.txt\n" +"animals.txt morse.txt planets.txt sunspot.txt\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:495 +msgid "" +"We now know how to go down the directory tree, but\n" +"how do we go up? We might try the following:" +msgstr "" +"We now know how to go down the directory tree, but\n" +"how do we go up? We might try the following:" + +# code block +#: shell-novice/_episodes/02-filedir.md:498 +msgid "" +"~~~\n" +"$ cd data-shell\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd data-shell\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:503 +msgid "" +"~~~\n" +"-bash: cd: data-shell: No such file or directory\n" +"~~~" +msgstr "" +"~~~\n" +"-bash: cd: data-shell: No such file or directory\n" +"~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:506 +#: shell-novice/_episodes/03-create.md:299 +#: shell-novice/_episodes/03-create.md:505 shell-novice/_episodes/05-loop.md:53 +msgid "{: .error}" +msgstr "{: .error}" + +#: shell-novice/_episodes/02-filedir.md:508 +msgid "But we get an error! Why is this? " +msgstr "But we get an error! Why is this? " + +#: shell-novice/_episodes/02-filedir.md:510 +msgid "" +"With our methods so far,\n" +"`cd` can only see sub-directories inside your current directory. There are\n" +"different ways to see directories above your current location; we'll start\n" +"with the simplest. " +msgstr "" +"With our methods so far,\n" +"`cd` can only see sub-directories inside your current directory. There are\n" +"different ways to see directories above your current location; we'll start\n" +"with the simplest. " + +#: shell-novice/_episodes/02-filedir.md:515 +msgid "" +"There is a shortcut in the shell to move up one directory level\n" +"that looks like this:" +msgstr "" +"There is a shortcut in the shell to move up one directory level\n" +"that looks like this:" + +# code block +#: shell-novice/_episodes/02-filedir.md:518 +#: shell-novice/_episodes/03-create.md:283 +msgid "" +"~~~\n" +"$ cd ..\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd ..\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:523 +msgid "" +"`..` is a special directory name meaning\n" +"\"the directory containing this one\",\n" +"or more succinctly,\n" +"the **parent** of the current directory.\n" +"Sure enough,\n" +"if we run `pwd` after running `cd ..`, we're back in `/Users/nelle/Desktop/data-shell`:" +msgstr "" +"`..` is a special directory name meaning\n" +"\"the directory containing this one\",\n" +"or more succinctly,\n" +"the **parent** of the current directory.\n" +"Sure enough,\n" +"if we run `pwd` after running `cd ..`, we're back in `/Users/nelle/Desktop/data-shell`:" + +# code block +#: shell-novice/_episodes/02-filedir.md:535 +#: shell-novice/_episodes/03-create.md:32 +#: shell-novice/_episodes/03-create.md:355 +msgid "" +"~~~\n" +"/Users/nelle/Desktop/data-shell\n" +"~~~" +msgstr "" +"~~~\n" +"/Users/nelle/Desktop/data-shell\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:540 +msgid "" +"The special directory `..` doesn't usually show up when we run `ls`. If we want\n" +"to display it, we can give `ls` the `-a` flag:" +msgstr "" +"The special directory `..` doesn't usually show up when we run `ls`. If we want\n" +"to display it, we can give `ls` the `-a` flag:" + +# code block +#: shell-novice/_episodes/02-filedir.md:543 +msgid "" +"~~~\n" +"$ ls -F -a\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls -F -a\n" +"~~~" + +# code block +#: shell-novice/_episodes/02-filedir.md:548 +msgid "" +"~~~\n" +"./ .bash_profile data/ north-pacific-gyre/ pizza.cfg thesis/\n" +"../ creatures/ molecules/ notes.txt solar.pdf writing/\n" +"~~~" +msgstr "" +"~~~\n" +"./ .bash_profile data/ north-pacific-gyre/ pizza.cfg thesis/\n" +"../ creatures/ molecules/ notes.txt solar.pdf writing/\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:554 +msgid "" +"`-a` stands for \"show all\";\n" +"it forces `ls` to show us file and directory names that begin with `.`,\n" +"such as `..` (which, if we're in `/Users/nelle`, refers to the `/Users` directory)\n" +"As you can see,\n" +"it also displays another special directory that's just called `.`,\n" +"which means \"the current working directory\".\n" +"It may seem redundant to have a name for it,\n" +"but we'll see some uses for it soon." +msgstr "" +"`-a` stands for \"show all\";\n" +"it forces `ls` to show us file and directory names that begin with `.`,\n" +"such as `..` (which, if we're in `/Users/nelle`, refers to the `/Users` directory)\n" +"As you can see,\n" +"it also displays another special directory that's just called `.`,\n" +"which means \"the current working directory\".\n" +"It may seem redundant to have a name for it,\n" +"but we'll see some uses for it soon." + +#: shell-novice/_episodes/02-filedir.md:563 +msgid "" +"Note that in most command line tools, multiple flags can be combined \n" +"with a single `-` and no spaces between the flags: `ls -F -a` is \n" +"equivalent to `ls -Fa`." +msgstr "" +"Note that in most command line tools, multiple flags can be combined \n" +"with a single `-` and no spaces between the flags: `ls -F -a` is \n" +"equivalent to `ls -Fa`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:567 +msgid "> ## Other Hidden Files" +msgstr "> ## Other Hidden Files" + +#: shell-novice/_episodes/02-filedir.md:568 +msgid "" +">\n" +"> In addition to the hidden directories `..` and `.`, you may also see a file\n" +"> called `.bash_profile`. This file usually contains shell configuration\n" +"> settings. You may also see other files and directories beginning\n" +"> with `.`. These are usually files and directories that are used to configure\n" +"> different programs on your computer. The prefix `.` is used to prevent these\n" +"> configuration files from cluttering the terminal when a standard `ls` command\n" +"> is used." +msgstr "" +">\n" +"> In addition to the hidden directories `..` and `.`, you may also see a file\n" +"> called `.bash_profile`. This file usually contains shell configuration\n" +"> settings. You may also see other files and directories beginning\n" +"> with `.`. These are usually files and directories that are used to configure\n" +"> different programs on your computer. The prefix `.` is used to prevent these\n" +"> configuration files from cluttering the terminal when a standard `ls` command\n" +"> is used." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:578 +msgid "> ## Orthogonality" +msgstr "> ## Orthogonality" + +#: shell-novice/_episodes/02-filedir.md:579 +msgid "" +">\n" +"> The special names `.` and `..` don't belong to `cd`;\n" +"> they are interpreted the same way by every program.\n" +"> For example,\n" +"> if we are in `/Users/nelle/data`,\n" +"> the command `ls ..` will give us a listing of `/Users/nelle`.\n" +"> When the meanings of the parts are the same no matter how they're combined,\n" +"> programmers say they are **orthogonal**:\n" +"> Orthogonal systems tend to be easier for people to learn\n" +"> because there are fewer special cases and exceptions to keep track of." +msgstr "" +">\n" +"> The special names `.` and `..` don't belong to `cd`;\n" +"> they are interpreted the same way by every program.\n" +"> For example,\n" +"> if we are in `/Users/nelle/data`,\n" +"> the command `ls ..` will give us a listing of `/Users/nelle`.\n" +"> When the meanings of the parts are the same no matter how they're combined,\n" +"> programmers say they are **orthogonal**:\n" +"> Orthogonal systems tend to be easier for people to learn\n" +"> because there are fewer special cases and exceptions to keep track of." + +#: shell-novice/_episodes/02-filedir.md:591 +msgid "" +"These then, are the basic commands for navigating the filesystem on your computer:\n" +"`pwd`, `ls` and `cd`. Let's explore some variations on those commands. What happens\n" +"if you type `cd` on its own, without giving\n" +"a directory? " +msgstr "" +"These then, are the basic commands for navigating the filesystem on your computer:\n" +"`pwd`, `ls` and `cd`. Let's explore some variations on those commands. What happens\n" +"if you type `cd` on its own, without giving\n" +"a directory? " + +# code block +#: shell-novice/_episodes/02-filedir.md:596 +msgid "" +"~~~\n" +"$ cd\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:601 +msgid "How can you check what happened? `pwd` gives us the answer! " +msgstr "How can you check what happened? `pwd` gives us the answer! " + +#: shell-novice/_episodes/02-filedir.md:613 +msgid "" +"It turns out that `cd` without an argument will return you to your home directory,\n" +"which is great if you've gotten lost in your own filesystem. " +msgstr "" +"It turns out that `cd` without an argument will return you to your home directory,\n" +"which is great if you've gotten lost in your own filesystem. " + +#: shell-novice/_episodes/02-filedir.md:616 +msgid "" +"Let's try returning to the `data` directory from before. Last time, we used\n" +"three commands, but we can actually string together the list of directories\n" +"to move to `data` in one step:" +msgstr "" +"Let's try returning to the `data` directory from before. Last time, we used\n" +"three commands, but we can actually string together the list of directories\n" +"to move to `data` in one step:" + +# code block +#: shell-novice/_episodes/02-filedir.md:620 +msgid "" +"~~~\n" +"$ cd Desktop/data-shell/data\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd Desktop/data-shell/data\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:625 +msgid "Check that we've moved to the right place by running `pwd` and `ls -F` " +msgstr "Check that we've moved to the right place by running `pwd` and `ls -F` " + +#: shell-novice/_episodes/02-filedir.md:627 +msgid "" +"If we want to move up one level from the data directory, we could use `cd ..`. But\n" +"there is another way to move to any directory, regardless of your\n" +"current location. " +msgstr "" +"If we want to move up one level from the data directory, we could use `cd ..`. But\n" +"there is another way to move to any directory, regardless of your\n" +"current location. " + +#: shell-novice/_episodes/02-filedir.md:631 +msgid "" +"So far, when specifying directory names, or even a directory path (as above),\n" +"we have been using **relative paths**. When you use a relative path with a command\n" +"like `ls` or `cd`, it tries to find that location from where we are,\n" +"rather than from the root of the file system. " +msgstr "" +"So far, when specifying directory names, or even a directory path (as above),\n" +"we have been using **relative paths**. When you use a relative path with a command\n" +"like `ls` or `cd`, it tries to find that location from where we are,\n" +"rather than from the root of the file system. " + +#: shell-novice/_episodes/02-filedir.md:636 +msgid "" +"However, it is possible to specify the **absolute path** to a directory by\n" +"including its entire path from the root directory, which is indicated by a\n" +"leading slash. The leading `/` tells the computer to follow the path from\n" +"the root of the file system, so it always refers to exactly one directory,\n" +"no matter where we are when we run the command." +msgstr "" +"However, it is possible to specify the **absolute path** to a directory by\n" +"including its entire path from the root directory, which is indicated by a\n" +"leading slash. The leading `/` tells the computer to follow the path from\n" +"the root of the file system, so it always refers to exactly one directory,\n" +"no matter where we are when we run the command." + +#: shell-novice/_episodes/02-filedir.md:642 +msgid "" +"This allows us to move to our `data-shell` directory from anywhere on\n" +"the filesystem (including from inside `data`). To find the absolute path\n" +"we're looking for, we can use `pwd` and then extract the piece we need\n" +"to move to `data-shell`. " +msgstr "" +"This allows us to move to our `data-shell` directory from anywhere on\n" +"the filesystem (including from inside `data`). To find the absolute path\n" +"we're looking for, we can use `pwd` and then extract the piece we need\n" +"to move to `data-shell`. " + +# code block +#: shell-novice/_episodes/02-filedir.md:657 +msgid "" +"~~~\n" +"$ cd /Users/nelle/Desktop/data-shell\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd /Users/nelle/Desktop/data-shell\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:662 +msgid "Run `pwd` and `ls -F` to ensure that we're in the directory we expect. " +msgstr "Run `pwd` and `ls -F` to ensure that we're in the directory we expect. " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:664 +msgid "> ## Two More Shortcuts" +msgstr "> ## Two More Shortcuts" + +#: shell-novice/_episodes/02-filedir.md:665 +msgid "" +">\n" +"> The shell interprets the character `~` (tilde) at the start of a path to\n" +"> mean \"the current user's home directory\". For example, if Nelle's home\n" +"> directory is `/Users/nelle`, then `~/data` is equivalent to\n" +"> `/Users/nelle/data`. This only works if it is the first character in the\n" +"> path: `here/there/~/elsewhere` is *not* `here/there/Users/nelle/elsewhere`.\n" +">\n" +"> Another shortcut is the `-` (dash) character. `cd` will translate `-` into\n" +"> *the previous directory I was in*, which is faster than having to remember,\n" +"> then type, the full path. This is a *very* efficient way of moving back\n" +"> and forth between directories. The difference between `cd ..` and `cd -` is\n" +"> that the former brings you *up*, while the latter brings you *back*. You can\n" +"> think of it as the *Last Channel* button on a TV remote." +msgstr "" +">\n" +"> The shell interprets the character `~` (tilde) at the start of a path to\n" +"> mean \"the current user's home directory\". For example, if Nelle's home\n" +"> directory is `/Users/nelle`, then `~/data` is equivalent to\n" +"> `/Users/nelle/data`. This only works if it is the first character in the\n" +"> path: `here/there/~/elsewhere` is *not* `here/there/Users/nelle/elsewhere`.\n" +">\n" +"> Another shortcut is the `-` (dash) character. `cd` will translate `-` into\n" +"> *the previous directory I was in*, which is faster than having to remember,\n" +"> then type, the full path. This is a *very* efficient way of moving back\n" +"> and forth between directories. The difference between `cd ..` and `cd -` is\n" +"> that the former brings you *up*, while the latter brings you *back*. You can\n" +"> think of it as the *Last Channel* button on a TV remote." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:680 +msgid "> ## Absolute vs Relative Paths" +msgstr "> ## Absolute vs Relative Paths" + +#: shell-novice/_episodes/02-filedir.md:681 +msgid "" +">\n" +"> Starting from `/Users/amanda/data/`,\n" +"> which of the following commands could Amanda use to navigate to her home directory,\n" +"> which is `/Users/amanda`?\n" +">\n" +"> 1. `cd .`\n" +"> 2. `cd /`\n" +"> 3. `cd /home/amanda`\n" +"> 4. `cd ../..`\n" +"> 5. `cd ~`\n" +"> 6. `cd home`\n" +"> 7. `cd ~/data/..`\n" +"> 8. `cd`\n" +"> 9. `cd ..`\n" +">\n" +"> > ## Solution\n" +"> > 1. No: `.` stands for the current directory.\n" +"> > 2. No: `/` stands for the root directory.\n" +"> > 3. No: Amanda's home directory is `/Users/amanda`.\n" +"> > 4. No: this goes up two levels, i.e. ends in `/Users`.\n" +"> > 5. Yes: `~` stands for the user's home directory, in this case `/Users/amanda`.\n" +"> > 6. No: this would navigate into a directory `home` in the current directory if it exists.\n" +"> > 7. Yes: unnecessarily complicated, but correct.\n" +"> > 8. Yes: shortcut to go back to the user's home directory.\n" +"> > 9. Yes: goes up one level." +msgstr "" +">\n" +"> Starting from `/Users/amanda/data/`,\n" +"> which of the following commands could Amanda use to navigate to her home directory,\n" +"> which is `/Users/amanda`?\n" +">\n" +"> 1. `cd .`\n" +"> 2. `cd /`\n" +"> 3. `cd /home/amanda`\n" +"> 4. `cd ../..`\n" +"> 5. `cd ~`\n" +"> 6. `cd home`\n" +"> 7. `cd ~/data/..`\n" +"> 8. `cd`\n" +"> 9. `cd ..`\n" +">\n" +"> > ## Solution\n" +"> > 1. No: `.` stands for the current directory.\n" +"> > 2. No: `/` stands for the root directory.\n" +"> > 3. No: Amanda's home directory is `/Users/amanda`.\n" +"> > 4. No: this goes up two levels, i.e. ends in `/Users`.\n" +"> > 5. Yes: `~` stands for the user's home directory, in this case `/Users/amanda`.\n" +"> > 6. No: this would navigate into a directory `home` in the current directory if it exists.\n" +"> > 7. Yes: unnecessarily complicated, but correct.\n" +"> > 8. Yes: shortcut to go back to the user's home directory.\n" +"> > 9. Yes: goes up one level." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:709 +msgid "> ## Relative Path Resolution" +msgstr "> ## Relative Path Resolution" + +#: shell-novice/_episodes/02-filedir.md:710 +msgid "" +">\n" +"> Using the filesystem diagram below, if `pwd` displays `/Users/thing`,\n" +"> what will `ls -F ../backup` display?\n" +">\n" +"> 1. `../backup: No such file or directory`\n" +"> 2. `2012-12-01 2013-01-08 2013-01-27`\n" +"> 3. `2012-12-01/ 2013-01-08/ 2013-01-27/`\n" +"> 4. `original/ pnas_final/ pnas_sub/`\n" +">\n" +"> ![File System for Challenge Questions](../fig/filesystem-challenge.svg)\n" +">\n" +"> > ## Solution\n" +"> > 1. No: there *is* a directory `backup` in `/Users`.\n" +"> > 2. No: this is the content of `Users/thing/backup`,\n" +"> > but with `..` we asked for one level further up.\n" +"> > 3. No: see previous explanation.\n" +"> > 4. Yes: `../backup/` refers to `/Users/backup/`." +msgstr "" +">\n" +"> Using the filesystem diagram below, if `pwd` displays `/Users/thing`,\n" +"> what will `ls -F ../backup` display?\n" +">\n" +"> 1. `../backup: No such file or directory`\n" +"> 2. `2012-12-01 2013-01-08 2013-01-27`\n" +"> 3. `2012-12-01/ 2013-01-08/ 2013-01-27/`\n" +"> 4. `original/ pnas_final/ pnas_sub/`\n" +">\n" +"> ![File System for Challenge Questions](../fig/filesystem-challenge.svg)\n" +">\n" +"> > ## Solution\n" +"> > 1. No: there *is* a directory `backup` in `/Users`.\n" +"> > 2. No: this is the content of `Users/thing/backup`,\n" +"> > but with `..` we asked for one level further up.\n" +"> > 3. No: see previous explanation.\n" +"> > 4. Yes: `../backup/` refers to `/Users/backup/`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:730 +msgid "> ## `ls` Reading Comprehension" +msgstr "> ## `ls` Reading Comprehension" + +#: shell-novice/_episodes/02-filedir.md:731 +msgid "" +">\n" +"> Assuming a directory structure as in the above Figure\n" +"> (File System for Challenge Questions), if `pwd` displays `/Users/backup`,\n" +"> and `-r` tells `ls` to display things in reverse order,\n" +"> what command will display:\n" +">\n" +"> ~~~\n" +"> pnas_sub/ pnas_final/ original/\n" +"> ~~~" +msgstr "" +">\n" +"> Assuming a directory structure as in the above Figure\n" +"> (File System for Challenge Questions), if `pwd` displays `/Users/backup`,\n" +"> and `-r` tells `ls` to display things in reverse order,\n" +"> what command will display:\n" +">\n" +"> ~~~\n" +"> pnas_sub/ pnas_final/ original/\n" +"> ~~~" + +# SC/DC Template label +#: shell-novice/_episodes/02-filedir.md:740 +#: shell-novice/_episodes/03-create.md:569 +#: shell-novice/_episodes/03-create.md:577 +#: shell-novice/_episodes/03-create.md:619 +#: shell-novice/_episodes/03-create.md:632 +#: shell-novice/_episodes/03-create.md:640 +#: shell-novice/_episodes/03-create.md:674 +#: shell-novice/_episodes/04-pipefilter.md:323 +#: shell-novice/_episodes/04-pipefilter.md:334 +#: shell-novice/_episodes/04-pipefilter.md:630 +#: shell-novice/_episodes/04-pipefilter.md:691 +#: shell-novice/_episodes/04-pipefilter.md:716 +#: shell-novice/_episodes/05-loop.md:124 shell-novice/_episodes/05-loop.md:369 +#: shell-novice/_episodes/05-loop.md:559 shell-novice/_episodes/07-find.md:239 +#: shell-novice/_episodes/07-find.md:272 +msgid "> {: .output}" +msgstr "> {: .output}" + +#: shell-novice/_episodes/02-filedir.md:741 +msgid "" +">\n" +"> 1. `ls pwd`\n" +"> 2. `ls -r -F`\n" +"> 3. `ls -r -F /Users/backup`\n" +"> 4. Either #2 or #3 above, but not #1.\n" +">\n" +"> > ## Solution\n" +"> > 1. No: `pwd` is not the name of a directory.\n" +"> > 2. Yes: `ls` without directory argument lists files and directories\n" +"> > in the current directory.\n" +"> > 3. Yes: uses the absolute path explicitly.\n" +"> > 4. Correct: see explanations above." +msgstr "" +">\n" +"> 1. `ls pwd`\n" +"> 2. `ls -r -F`\n" +"> 3. `ls -r -F /Users/backup`\n" +"> 4. Either #2 or #3 above, but not #1.\n" +">\n" +"> > ## Solution\n" +"> > 1. No: `pwd` is not the name of a directory.\n" +"> > 2. Yes: `ls` without directory argument lists files and directories\n" +"> > in the current directory.\n" +"> > 3. Yes: uses the absolute path explicitly.\n" +"> > 4. Correct: see explanations above." + +# header +#: shell-novice/_episodes/02-filedir.md:756 +msgid "### Nelle's Pipeline: Organizing Files" +msgstr "### Nelle's Pipeline: Organizing Files" + +#: shell-novice/_episodes/02-filedir.md:758 +msgid "" +"Knowing just this much about files and directories,\n" +"Nelle is ready to organize the files that the protein assay machine will create.\n" +"First,\n" +"she creates a directory called `north-pacific-gyre`\n" +"(to remind herself where the data came from).\n" +"Inside that,\n" +"she creates a directory called `2012-07-03`,\n" +"which is the date she started processing the samples.\n" +"She used to use names like `conference-paper` and `revised-results`,\n" +"but she found them hard to understand after a couple of years.\n" +"(The final straw was when she found herself creating\n" +"a directory called `revised-revised-results-3`.)" +msgstr "" +"Knowing just this much about files and directories,\n" +"Nelle is ready to organize the files that the protein assay machine will create.\n" +"First,\n" +"she creates a directory called `north-pacific-gyre`\n" +"(to remind herself where the data came from).\n" +"Inside that,\n" +"she creates a directory called `2012-07-03`,\n" +"which is the date she started processing the samples.\n" +"She used to use names like `conference-paper` and `revised-results`,\n" +"but she found them hard to understand after a couple of years.\n" +"(The final straw was when she found herself creating\n" +"a directory called `revised-revised-results-3`.)" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/02-filedir.md:771 +msgid "> ## Sorting Output" +msgstr "> ## Sorting Output" + +#: shell-novice/_episodes/02-filedir.md:772 +msgid "" +">\n" +"> Nelle names her directories \"year-month-day\",\n" +"> with leading zeroes for months and days,\n" +"> because the shell displays file and directory names in alphabetical order.\n" +"> If she used month names,\n" +"> December would come before July;\n" +"> if she didn't use leading zeroes,\n" +"> November ('11') would come before July ('7'). Similarly, putting the year first\n" +"> means that June 2012 will come before June 2013." +msgstr "" +">\n" +"> Nelle names her directories \"year-month-day\",\n" +"> with leading zeroes for months and days,\n" +"> because the shell displays file and directory names in alphabetical order.\n" +"> If she used month names,\n" +"> December would come before July;\n" +"> if she didn't use leading zeroes,\n" +"> November ('11') would come before July ('7'). Similarly, putting the year first\n" +"> means that June 2012 will come before June 2013." + +#: shell-novice/_episodes/02-filedir.md:783 +msgid "" +"Each of her physical samples is labelled according to her lab's convention\n" +"with a unique ten-character ID,\n" +"such as \"NENE01729A\".\n" +"This is what she used in her collection log\n" +"to record the location, time, depth, and other characteristics of the sample,\n" +"so she decides to use it as part of each data file's name.\n" +"Since the assay machine's output is plain text,\n" +"she will call her files `NENE01729A.txt`, `NENE01812A.txt`, and so on.\n" +"All 1520 files will go into the same directory." +msgstr "" +"Each of her physical samples is labelled according to her lab's convention\n" +"with a unique ten-character ID,\n" +"such as \"NENE01729A\".\n" +"This is what she used in her collection log\n" +"to record the location, time, depth, and other characteristics of the sample,\n" +"so she decides to use it as part of each data file's name.\n" +"Since the assay machine's output is plain text,\n" +"she will call her files `NENE01729A.txt`, `NENE01812A.txt`, and so on.\n" +"All 1520 files will go into the same directory." + +#: shell-novice/_episodes/02-filedir.md:793 +msgid "" +"Now in her current directory `data-shell`,\n" +"Nelle can see what files she has using the command:" +msgstr "" +"Now in her current directory `data-shell`,\n" +"Nelle can see what files she has using the command:" + +# code block +#: shell-novice/_episodes/02-filedir.md:796 +msgid "" +"~~~\n" +"$ ls north-pacific-gyre/2012-07-03/\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls north-pacific-gyre/2012-07-03/\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:801 +msgid "" +"This is a lot to type,\n" +"but she can let the shell do most of the work through what is called **tab completion**.\n" +"If she types:" +msgstr "" +"This is a lot to type,\n" +"but she can let the shell do most of the work through what is called **tab completion**.\n" +"If she types:" + +# code block +#: shell-novice/_episodes/02-filedir.md:805 +msgid "" +"~~~\n" +"$ ls nor\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls nor\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:810 +msgid "" +"and then presses tab (the tab key on her keyboard),\n" +"the shell automatically completes the directory name for her:" +msgstr "" +"and then presses tab (the tab key on her keyboard),\n" +"the shell automatically completes the directory name for her:" + +# code block +#: shell-novice/_episodes/02-filedir.md:813 +msgid "" +"~~~\n" +"$ ls north-pacific-gyre/\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls north-pacific-gyre/\n" +"~~~" + +#: shell-novice/_episodes/02-filedir.md:818 +msgid "" +"If she presses tab again,\n" +"Bash will add `2012-07-03/` to the command,\n" +"since it's the only possible completion.\n" +"Pressing tab again does nothing,\n" +"since there are 19 possibilities;\n" +"pressing tab twice brings up a list of all the files,\n" +"and so on.\n" +"This is called **tab completion**,\n" +"and we will see it in many other tools as we go on." +msgstr "" +"If she presses tab again,\n" +"Bash will add `2012-07-03/` to the command,\n" +"since it's the only possible completion.\n" +"Pressing tab again does nothing,\n" +"since there are 19 possibilities;\n" +"pressing tab twice brings up a list of all the files,\n" +"and so on.\n" +"This is called **tab completion**,\n" +"and we will see it in many other tools as we go on." + +# Front Matter +#: shell-novice/_episodes/03-create.md:1 +msgid "" +"---\n" +"title: \"Working With Files and Directories\"\n" +"teaching: 25\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I create, copy, and delete files and directories?\"\n" +"- \"How can I edit files?\"\n" +"objectives:\n" +"- \"Create a directory hierarchy that matches a given diagram.\"\n" +"- \"Create files in that hierarchy using an editor or by copying and renaming existing files.\"\n" +"- \"Delete specified files and/or directories.\"\n" +"keypoints:\n" +"- \"`cp old new` copies a file.\"\n" +"- \"`mkdir path` creates a new directory.\"\n" +"- \"`mv old new` moves (renames) a file or directory.\"\n" +"- \"`rm path` removes (deletes) a file.\"\n" +"- \"Use of the Control key may be described in many ways, including `Ctrl-X`, `Control-X`, and `^X`.\"\n" +"- \"The shell does not have a trash bin: once something is deleted, it's really gone.\"\n" +"- \"Depending on the type of work you do, you may need a more powerful text editor than Nano.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Working With Files and Directories\"\n" +"teaching: 25\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I create, copy, and delete files and directories?\"\n" +"- \"How can I edit files?\"\n" +"objectives:\n" +"- \"Create a directory hierarchy that matches a given diagram.\"\n" +"- \"Create files in that hierarchy using an editor or by copying and renaming existing files.\"\n" +"- \"Delete specified files and/or directories.\"\n" +"keypoints:\n" +"- \"`cp old new` copies a file.\"\n" +"- \"`mkdir path` creates a new directory.\"\n" +"- \"`mv old new` moves (renames) a file or directory.\"\n" +"- \"`rm path` removes (deletes) a file.\"\n" +"- \"Use of the Control key may be described in many ways, including `Ctrl-X`, `Control-X`, and `^X`.\"\n" +"- \"The shell does not have a trash bin: once something is deleted, it's really gone.\"\n" +"- \"Depending on the type of work you do, you may need a more powerful text editor than Nano.\"\n" +"---" + +#: shell-novice/_episodes/03-create.md:22 +msgid "" +"We now know how to explore files and directories,\n" +"but how do we create them in the first place?\n" +"Let's go back to our `data-shell` directory on the Desktop\n" +"and use `ls -F` to see what it contains:" +msgstr "" +"We now know how to explore files and directories,\n" +"but how do we create them in the first place?\n" +"Let's go back to our `data-shell` directory on the Desktop\n" +"and use `ls -F` to see what it contains:" + +# code block +#: shell-novice/_episodes/03-create.md:42 +msgid "" +"~~~\n" +"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf writing/\n" +"~~~" +msgstr "" +"~~~\n" +"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf writing/\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:47 +msgid "" +"Let's create a new directory called `thesis` using the command `mkdir thesis`\n" +"(which has no output):" +msgstr "" +"Let's create a new directory called `thesis` using the command `mkdir thesis`\n" +"(which has no output):" + +# code block +#: shell-novice/_episodes/03-create.md:50 +msgid "" +"~~~\n" +"$ mkdir thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ mkdir thesis\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:55 +msgid "" +"As you might guess from its name,\n" +"`mkdir` means \"make directory\".\n" +"Since `thesis` is a relative path\n" +"(i.e., doesn't have a leading slash),\n" +"the new directory is created in the current working directory:" +msgstr "" +"As you might guess from its name,\n" +"`mkdir` means \"make directory\".\n" +"Since `thesis` is a relative path\n" +"(i.e., doesn't have a leading slash),\n" +"the new directory is created in the current working directory:" + +# code block +#: shell-novice/_episodes/03-create.md:66 +msgid "" +"~~~\n" +"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf thesis/ writing/\n" +"~~~" +msgstr "" +"~~~\n" +"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf thesis/ writing/\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:71 +msgid "> ## Two ways of doing the same thing" +msgstr "> ## Two ways of doing the same thing" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:72 +msgid "> Using the shell to create a directory is no different than using a file explorer." +msgstr "> Using the shell to create a directory is no different than using a file explorer." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:73 +msgid "> If you open the current directory using your operating system's graphical file explorer," +msgstr "> If you open the current directory using your operating system's graphical file explorer," + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:74 +msgid "> the `thesis` directory will appear there too." +msgstr "> the `thesis` directory will appear there too." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:75 +msgid "> While they are two different ways of interacting with the files," +msgstr "> While they are two different ways of interacting with the files," + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:76 +msgid "> the files and directories themselves are the same." +msgstr "> the files and directories themselves are the same." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:79 +msgid "> ## Good names for files and directories" +msgstr "> ## Good names for files and directories" + +#: shell-novice/_episodes/03-create.md:80 +msgid "" +">\n" +"> Complicated names of files and directories can make your life painful\n" +"> when working on the command line. Here we provide a few useful\n" +"> tips for the names of your files.\n" +">\n" +"> 1. Don't use whitespaces.\n" +">\n" +"> Whitespaces can make a name more meaningful\n" +"> but since whitespace is used to break arguments on the command line\n" +"> it is better to avoid them in names of files and directories.\n" +"> You can use `-` or `_` instead of whitespace.\n" +">\n" +"> 2. Don't begin the name with `-` (dash).\n" +">\n" +"> Commands treat names starting with `-` as options.\n" +">\n" +"> 3. Stick with letters, numbers, `.` (period), `-` (dash) and `_` (underscore).\n" +">\n" +"> Many other characters have special meanings on the command line.\n" +"> We will learn about some of these during this lesson.\n" +"> There are special characters that can cause your command to not work as\n" +"> expected and can even result in data loss.\n" +">\n" +"> If you need to refer to names of files or directories that have whitespace\n" +"> or another non-alphanumeric character, you should surround the name in quotes (`\"\"`)." +msgstr "" +">\n" +"> Complicated names of files and directories can make your life painful\n" +"> when working on the command line. Here we provide a few useful\n" +"> tips for the names of your files.\n" +">\n" +"> 1. Don't use whitespaces.\n" +">\n" +"> Whitespaces can make a name more meaningful\n" +"> but since whitespace is used to break arguments on the command line\n" +"> it is better to avoid them in names of files and directories.\n" +"> You can use `-` or `_` instead of whitespace.\n" +">\n" +"> 2. Don't begin the name with `-` (dash).\n" +">\n" +"> Commands treat names starting with `-` as options.\n" +">\n" +"> 3. Stick with letters, numbers, `.` (period), `-` (dash) and `_` (underscore).\n" +">\n" +"> Many other characters have special meanings on the command line.\n" +"> We will learn about some of these during this lesson.\n" +"> There are special characters that can cause your command to not work as\n" +"> expected and can even result in data loss.\n" +">\n" +"> If you need to refer to names of files or directories that have whitespace\n" +"> or another non-alphanumeric character, you should surround the name in quotes (`\"\"`)." + +#: shell-novice/_episodes/03-create.md:107 +msgid "Since we've just created the `thesis` directory, there's nothing in it yet:" +msgstr "Since we've just created the `thesis` directory, there's nothing in it yet:" + +# code block +#: shell-novice/_episodes/03-create.md:109 +msgid "" +"~~~\n" +"$ ls -F thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls -F thesis\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:114 +msgid "" +"Let's change our working directory to `thesis` using `cd`,\n" +"then run a text editor called Nano to create a file called `draft.txt`:" +msgstr "" +"Let's change our working directory to `thesis` using `cd`,\n" +"then run a text editor called Nano to create a file called `draft.txt`:" + +# code block +#: shell-novice/_episodes/03-create.md:117 +msgid "" +"~~~\n" +"$ cd thesis\n" +"$ nano draft.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd thesis\n" +"$ nano draft.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:123 +msgid "> ## Which Editor?" +msgstr "> ## Which Editor?" + +#: shell-novice/_episodes/03-create.md:124 +msgid "" +">\n" +"> When we say, \"`nano` is a text editor,\" we really do mean \"text\": it can\n" +"> only work with plain character data, not tables, images, or any other\n" +"> human-friendly media. We use it in examples because it is one of the \n" +"> least complex text editors. However, because of this trait, it may \n" +"> not be powerful enough or flexible enough for the work you need to do\n" +"> after this workshop. On Unix systems (such as Linux and Mac OS X),\n" +"> many programmers use [Emacs](http://www.gnu.org/software/emacs/) or\n" +"> [Vim](http://www.vim.org/) (both of which require more time to learn), \n" +"> or a graphical editor such as\n" +"> [Gedit](http://projects.gnome.org/gedit/). On Windows, you may wish to\n" +"> use [Notepad++](http://notepad-plus-plus.org/). Windows also has a built-in\n" +"> editor called `notepad` that can be run from the command line in the same\n" +"> way as `nano` for the purposes of this lesson. \n" +">\n" +"> No matter what editor you use, you will need to know where it searches\n" +"> for and saves files. If you start it from the shell, it will (probably)\n" +"> use your current working directory as its default location. If you use\n" +"> your computer's start menu, it may want to save files in your desktop or\n" +"> documents directory instead. You can change this by navigating to\n" +"> another directory the first time you \"Save As...\"" +msgstr "" +">\n" +"> When we say, \"`nano` is a text editor,\" we really do mean \"text\": it can\n" +"> only work with plain character data, not tables, images, or any other\n" +"> human-friendly media. We use it in examples because it is one of the \n" +"> least complex text editors. However, because of this trait, it may \n" +"> not be powerful enough or flexible enough for the work you need to do\n" +"> after this workshop. On Unix systems (such as Linux and Mac OS X),\n" +"> many programmers use [Emacs](http://www.gnu.org/software/emacs/) or\n" +"> [Vim](http://www.vim.org/) (both of which require more time to learn), \n" +"> or a graphical editor such as\n" +"> [Gedit](http://projects.gnome.org/gedit/). On Windows, you may wish to\n" +"> use [Notepad++](http://notepad-plus-plus.org/). Windows also has a built-in\n" +"> editor called `notepad` that can be run from the command line in the same\n" +"> way as `nano` for the purposes of this lesson. \n" +">\n" +"> No matter what editor you use, you will need to know where it searches\n" +"> for and saves files. If you start it from the shell, it will (probably)\n" +"> use your current working directory as its default location. If you use\n" +"> your computer's start menu, it may want to save files in your desktop or\n" +"> documents directory instead. You can change this by navigating to\n" +"> another directory the first time you \"Save As...\"" + +#: shell-novice/_episodes/03-create.md:147 +msgid "" +"Let's type in a few lines of text.\n" +"Once we're happy with our text, we can press `Ctrl-O` (press the Ctrl or Control key and, while\n" +"holding it down, press the O key) to write our data to disk\n" +"(we'll be asked what file we want to save this to:\n" +"press Return to accept the suggested default of `draft.txt`)." +msgstr "" +"Let's type in a few lines of text.\n" +"Once we're happy with our text, we can press `Ctrl-O` (press the Ctrl or Control key and, while\n" +"holding it down, press the O key) to write our data to disk\n" +"(we'll be asked what file we want to save this to:\n" +"press Return to accept the suggested default of `draft.txt`)." + +#: shell-novice/_episodes/03-create.md:153 +msgid "![Nano in Action](../fig/nano-screenshot.png)" +msgstr "![Nano in Action](../fig/nano-screenshot.png)" + +#: shell-novice/_episodes/03-create.md:155 +msgid "" +"Once our file is saved, we can use `Ctrl-X` to quit the editor and\n" +"return to the shell." +msgstr "" +"Once our file is saved, we can use `Ctrl-X` to quit the editor and\n" +"return to the shell." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:158 +msgid "> ## Control, Ctrl, or ^ Key" +msgstr "> ## Control, Ctrl, or ^ Key" + +#: shell-novice/_episodes/03-create.md:159 +msgid "" +">\n" +"> The Control key is also called the \"Ctrl\" key. There are various ways\n" +"> in which using the Control key may be described. For example, you may\n" +"> see an instruction to press the Control key and, while holding it down,\n" +"> press the X key, described as any of:\n" +">\n" +"> * `Control-X`\n" +"> * `Control+X`\n" +"> * `Ctrl-X`\n" +"> * `Ctrl+X`\n" +"> * `^X`\n" +"> * `C-x`\n" +">\n" +"> In nano, along the bottom of the screen you'll see `^G Get Help ^O WriteOut`.\n" +"> This means that you can use `Control-G` to get help and `Control-O` to save your\n" +"> file." +msgstr "" +">\n" +"> The Control key is also called the \"Ctrl\" key. There are various ways\n" +"> in which using the Control key may be described. For example, you may\n" +"> see an instruction to press the Control key and, while holding it down,\n" +"> press the X key, described as any of:\n" +">\n" +"> * `Control-X`\n" +"> * `Control+X`\n" +"> * `Ctrl-X`\n" +"> * `Ctrl+X`\n" +"> * `^X`\n" +"> * `C-x`\n" +">\n" +"> In nano, along the bottom of the screen you'll see `^G Get Help ^O WriteOut`.\n" +"> This means that you can use `Control-G` to get help and `Control-O` to save your\n" +"> file." + +#: shell-novice/_episodes/03-create.md:177 +msgid "" +"`nano` doesn't leave any output on the screen after it exits,\n" +"but `ls` now shows that we have created a file called `draft.txt`:" +msgstr "" +"`nano` doesn't leave any output on the screen after it exits,\n" +"but `ls` now shows that we have created a file called `draft.txt`:" + +# code block +#: shell-novice/_episodes/03-create.md:185 +#: shell-novice/_episodes/03-create.md:278 +#: shell-novice/_episodes/03-create.md:367 +msgid "" +"~~~\n" +"draft.txt\n" +"~~~" +msgstr "" +"~~~\n" +"draft.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:190 +msgid "> ## Creating Files a Different Way" +msgstr "> ## Creating Files a Different Way" + +#: shell-novice/_episodes/03-create.md:191 +msgid "" +">\n" +"> We have seen how to create text files using the `nano` editor.\n" +"> Now, try the following command in your home directory:\n" +">\n" +"> ~~~\n" +"> $ cd # go to your home directory\n" +"> $ touch my_file.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. What did the touch command do?\n" +"> When you look at your home directory using the GUI file explorer,\n" +"> does the file show up?\n" +">\n" +"> 2. Use `ls -l` to inspect the files. How large is `my_file.txt`?\n" +">\n" +"> 3. When might you want to create a file this way?\n" +">\n" +"> > ## Solution\n" +"> > 1. The touch command generates a new file called 'my_file.txt' in\n" +"> > your home directory. If you are in your home directory, you\n" +"> > can observe this newly generated file by typing 'ls' at the \n" +"> > command line prompt. 'my_file.txt' can also be viewed in your\n" +"> > GUI file explorer.\n" +"> >\n" +"> > 2. When you inspect the file with 'ls -l', note that the size of\n" +"> > 'my_file.txt' is 0kb. In other words, it contains no data.\n" +"> > If you open 'my_file.txt' using your text editor it is blank.\n" +"> >\n" +"> > 3. Some programs do not generate output files themselves, but\n" +"> > instead require that empty files have already been generated.\n" +"> > When the program is run, it searches for an existing file to\n" +"> > populate with its output. The touch command allows you to\n" +"> > efficiently generate a blank text file to be used by such\n" +"> > programs." +msgstr "" +">\n" +"> We have seen how to create text files using the `nano` editor.\n" +"> Now, try the following command in your home directory:\n" +">\n" +"> ~~~\n" +"> $ cd # go to your home directory\n" +"> $ touch my_file.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. What did the touch command do?\n" +"> When you look at your home directory using the GUI file explorer,\n" +"> does the file show up?\n" +">\n" +"> 2. Use `ls -l` to inspect the files. How large is `my_file.txt`?\n" +">\n" +"> 3. When might you want to create a file this way?\n" +">\n" +"> > ## Solution\n" +"> > 1. The touch command generates a new file called 'my_file.txt' in\n" +"> > your home directory. If you are in your home directory, you\n" +"> > can observe this newly generated file by typing 'ls' at the \n" +"> > command line prompt. 'my_file.txt' can also be viewed in your\n" +"> > GUI file explorer.\n" +"> >\n" +"> > 2. When you inspect the file with 'ls -l', note that the size of\n" +"> > 'my_file.txt' is 0kb. In other words, it contains no data.\n" +"> > If you open 'my_file.txt' using your text editor it is blank.\n" +"> >\n" +"> > 3. Some programs do not generate output files themselves, but\n" +"> > instead require that empty files have already been generated.\n" +"> > When the program is run, it searches for an existing file to\n" +"> > populate with its output. The touch command allows you to\n" +"> > efficiently generate a blank text file to be used by such\n" +"> > programs." + +#: shell-novice/_episodes/03-create.md:229 +msgid "" +"Returning to the `data-shell` directory,\n" +"let's tidy up the `thesis` directory by removing the draft we created:" +msgstr "" +"Returning to the `data-shell` directory,\n" +"let's tidy up the `thesis` directory by removing the draft we created:" + +# code block +#: shell-novice/_episodes/03-create.md:232 +msgid "" +"~~~\n" +"$ cd thesis\n" +"$ rm draft.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd thesis\n" +"$ rm draft.txt\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:238 +msgid "" +"This command removes files (`rm` is short for \"remove\").\n" +"If we run `ls` again,\n" +"its output is empty once more,\n" +"which tells us that our file is gone:" +msgstr "" +"This command removes files (`rm` is short for \"remove\").\n" +"If we run `ls` again,\n" +"its output is empty once more,\n" +"which tells us that our file is gone:" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:248 +msgid "> ## Deleting Is Forever" +msgstr "> ## Deleting Is Forever" + +#: shell-novice/_episodes/03-create.md:249 +msgid "" +">\n" +"> The Unix shell doesn't have a trash bin that we can recover deleted\n" +"> files from (though most graphical interfaces to Unix do). Instead,\n" +"> when we delete files, they are unhooked from the file system so that\n" +"> their storage space on disk can be recycled. Tools for finding and\n" +"> recovering deleted files do exist, but there's no guarantee they'll\n" +"> work in any particular situation, since the computer may recycle the\n" +"> file's disk space right away." +msgstr "" +">\n" +"> The Unix shell doesn't have a trash bin that we can recover deleted\n" +"> files from (though most graphical interfaces to Unix do). Instead,\n" +"> when we delete files, they are unhooked from the file system so that\n" +"> their storage space on disk can be recycled. Tools for finding and\n" +"> recovering deleted files do exist, but there's no guarantee they'll\n" +"> work in any particular situation, since the computer may recycle the\n" +"> file's disk space right away." + +#: shell-novice/_episodes/03-create.md:259 +msgid "" +"Let's re-create that file\n" +"and then move up one directory to `/Users/nelle/Desktop/data-shell` using `cd ..`:" +msgstr "" +"Let's re-create that file\n" +"and then move up one directory to `/Users/nelle/Desktop/data-shell` using `cd ..`:" + +# code block +#: shell-novice/_episodes/03-create.md:267 +msgid "" +"~~~\n" +"/Users/nelle/Desktop/data-shell/thesis\n" +"~~~" +msgstr "" +"~~~\n" +"/Users/nelle/Desktop/data-shell/thesis\n" +"~~~" + +# code block +#: shell-novice/_episodes/03-create.md:272 +msgid "" +"~~~\n" +"$ nano draft.txt\n" +"$ ls\n" +"~~~" +msgstr "" +"~~~\n" +"$ nano draft.txt\n" +"$ ls\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:288 +msgid "" +"If we try to remove the entire `thesis` directory using `rm thesis`,\n" +"we get an error message:" +msgstr "" +"If we try to remove the entire `thesis` directory using `rm thesis`,\n" +"we get an error message:" + +# code block +#: shell-novice/_episodes/03-create.md:291 +msgid "" +"~~~\n" +"$ rm thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ rm thesis\n" +"~~~" + +# code block +#: shell-novice/_episodes/03-create.md:296 +msgid "" +"~~~\n" +"rm: cannot remove `thesis': Is a directory\n" +"~~~" +msgstr "" +"~~~\n" +"rm: cannot remove `thesis': Is a directory\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:301 +msgid "This happens because `rm` by default only works on files, not directories." +msgstr "This happens because `rm` by default only works on files, not directories." + +#: shell-novice/_episodes/03-create.md:303 +msgid "" +"To really get rid of `thesis` we must also delete the file `draft.txt`.\n" +"We can do this with the [recursive](https://en.wikipedia.org/wiki/Recursion) option for `rm`:" +msgstr "" +"To really get rid of `thesis` we must also delete the file `draft.txt`.\n" +"We can do this with the [recursive](https://en.wikipedia.org/wiki/Recursion) option for `rm`:" + +# code block +#: shell-novice/_episodes/03-create.md:306 +msgid "" +"~~~\n" +"$ rm -r thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ rm -r thesis\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:311 +msgid "> ## Using `rm` Safely" +msgstr "> ## Using `rm` Safely" + +#: shell-novice/_episodes/03-create.md:312 +msgid "" +">\n" +"> What happens when we type `rm -i thesis/quotations.txt`?\n" +"> Why would we want this protection when using `rm`?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ rm: remove regular file 'thesis/quotations.txt'?\n" +"> > ```\n" +"> > {: .language-bash} \n" +"> > The -i option will prompt before every removal. \n" +"> > The Unix shell doesn't have a trash bin, so all the files removed will disappear forever. \n" +"> > By using the -i flag, we have the chance to check that we are deleting only the files that we want to remove." +msgstr "" +">\n" +"> What happens when we type `rm -i thesis/quotations.txt`?\n" +"> Why would we want this protection when using `rm`?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ rm: remove regular file 'thesis/quotations.txt'?\n" +"> > ```\n" +"> > {: .language-bash} \n" +"> > The -i option will prompt before every removal. \n" +"> > The Unix shell doesn't have a trash bin, so all the files removed will disappear forever. \n" +"> > By using the -i flag, we have the chance to check that we are deleting only the files that we want to remove." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:327 +msgid "> ## With Great Power Comes Great Responsibility" +msgstr "> ## With Great Power Comes Great Responsibility" + +#: shell-novice/_episodes/03-create.md:328 +msgid "" +">\n" +"> Removing the files in a directory recursively can be a very dangerous\n" +"> operation. If we're concerned about what we might be deleting we can\n" +"> add the \"interactive\" flag `-i` to `rm` which will ask us for confirmation\n" +"> before each step\n" +">\n" +"> ~~~\n" +"> $ rm -r -i thesis\n" +"> rm: descend into directory ‘thesis’? y\n" +"> rm: remove regular file ‘thesis/draft.txt’? y\n" +"> rm: remove directory ‘thesis’? y\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> This removes everything in the directory, then the directory itself, asking\n" +"> at each step for you to confirm the deletion." +msgstr "" +">\n" +"> Removing the files in a directory recursively can be a very dangerous\n" +"> operation. If we're concerned about what we might be deleting we can\n" +"> add the \"interactive\" flag `-i` to `rm` which will ask us for confirmation\n" +"> before each step\n" +">\n" +"> ~~~\n" +"> $ rm -r -i thesis\n" +"> rm: descend into directory ‘thesis’? y\n" +"> rm: remove regular file ‘thesis/draft.txt’? y\n" +"> rm: remove directory ‘thesis’? y\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> This removes everything in the directory, then the directory itself, asking\n" +"> at each step for you to confirm the deletion." + +#: shell-novice/_episodes/03-create.md:346 +msgid "" +"Let's create that directory and file one more time.\n" +"(Note that this time we're running `nano` with the path `thesis/draft.txt`,\n" +"rather than going into the `thesis` directory and running `nano` on `draft.txt` there.)" +msgstr "" +"Let's create that directory and file one more time.\n" +"(Note that this time we're running `nano` with the path `thesis/draft.txt`,\n" +"rather than going into the `thesis` directory and running `nano` on `draft.txt` there.)" + +# code block +#: shell-novice/_episodes/03-create.md:360 +msgid "" +"~~~\n" +"$ mkdir thesis\n" +"$ nano thesis/draft.txt\n" +"$ ls thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ mkdir thesis\n" +"$ nano thesis/draft.txt\n" +"$ ls thesis\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:372 +msgid "" +"`draft.txt` isn't a particularly informative name,\n" +"so let's change the file's name using `mv`,\n" +"which is short for \"move\":" +msgstr "" +"`draft.txt` isn't a particularly informative name,\n" +"so let's change the file's name using `mv`,\n" +"which is short for \"move\":" + +# code block +#: shell-novice/_episodes/03-create.md:376 +msgid "" +"~~~\n" +"$ mv thesis/draft.txt thesis/quotes.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ mv thesis/draft.txt thesis/quotes.txt\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:381 +msgid "" +"The first argument tells `mv` what we're \"moving\",\n" +"while the second is where it's to go.\n" +"In this case,\n" +"we're moving `thesis/draft.txt` to `thesis/quotes.txt`,\n" +"which has the same effect as renaming the file.\n" +"Sure enough,\n" +"`ls` shows us that `thesis` now contains one file called `quotes.txt`:" +msgstr "" +"The first argument tells `mv` what we're \"moving\",\n" +"while the second is where it's to go.\n" +"In this case,\n" +"we're moving `thesis/draft.txt` to `thesis/quotes.txt`,\n" +"which has the same effect as renaming the file.\n" +"Sure enough,\n" +"`ls` shows us that `thesis` now contains one file called `quotes.txt`:" + +# code block +#: shell-novice/_episodes/03-create.md:389 +#: shell-novice/_episodes/03-create.md:424 +msgid "" +"~~~\n" +"$ ls thesis\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls thesis\n" +"~~~" + +# code block +#: shell-novice/_episodes/03-create.md:394 +#: shell-novice/_episodes/03-create.md:438 +msgid "" +"~~~\n" +"quotes.txt\n" +"~~~" +msgstr "" +"~~~\n" +"quotes.txt\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:399 +msgid "" +"One has to be careful when specifying the target file name, since `mv` will\n" +"silently overwrite any existing file with the same name, which could\n" +"lead to data loss. An additional flag, `mv -i` (or `mv --interactive`),\n" +"can be used to make `mv` ask you for confirmation before overwriting." +msgstr "" +"One has to be careful when specifying the target file name, since `mv` will\n" +"silently overwrite any existing file with the same name, which could\n" +"lead to data loss. An additional flag, `mv -i` (or `mv --interactive`),\n" +"can be used to make `mv` ask you for confirmation before overwriting." + +#: shell-novice/_episodes/03-create.md:404 +msgid "" +"Just for the sake of consistency,\n" +"`mv` also works on directories" +msgstr "" +"Just for the sake of consistency,\n" +"`mv` also works on directories" + +#: shell-novice/_episodes/03-create.md:407 +msgid "" +"Let's move `quotes.txt` into the current working directory.\n" +"We use `mv` once again,\n" +"but this time we'll just use the name of a directory as the second argument\n" +"to tell `mv` that we want to keep the filename,\n" +"but put the file somewhere new.\n" +"(This is why the command is called \"move\".)\n" +"In this case,\n" +"the directory name we use is the special directory name `.` that we mentioned earlier." +msgstr "" +"Let's move `quotes.txt` into the current working directory.\n" +"We use `mv` once again,\n" +"but this time we'll just use the name of a directory as the second argument\n" +"to tell `mv` that we want to keep the filename,\n" +"but put the file somewhere new.\n" +"(This is why the command is called \"move\".)\n" +"In this case,\n" +"the directory name we use is the special directory name `.` that we mentioned earlier." + +# code block +#: shell-novice/_episodes/03-create.md:416 +msgid "" +"~~~\n" +"$ mv thesis/quotes.txt .\n" +"~~~" +msgstr "" +"~~~\n" +"$ mv thesis/quotes.txt .\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:421 +msgid "" +"The effect is to move the file from the directory it was in to the current working directory.\n" +"`ls` now shows us that `thesis` is empty:" +msgstr "" +"The effect is to move the file from the directory it was in to the current working directory.\n" +"`ls` now shows us that `thesis` is empty:" + +#: shell-novice/_episodes/03-create.md:429 +msgid "" +"Further,\n" +"`ls` with a filename or directory name as an argument only lists that file or directory.\n" +"We can use this to see that `quotes.txt` is still in our current directory:" +msgstr "" +"Further,\n" +"`ls` with a filename or directory name as an argument only lists that file or directory.\n" +"We can use this to see that `quotes.txt` is still in our current directory:" + +# code block +#: shell-novice/_episodes/03-create.md:433 +msgid "" +"~~~\n" +"$ ls quotes.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls quotes.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:443 +msgid "> ## Moving to the Current Folder" +msgstr "> ## Moving to the Current Folder" + +#: shell-novice/_episodes/03-create.md:444 +msgid "" +">\n" +"> After running the following commands,\n" +"> Jamie realizes that she put the files `sucrose.dat` and `maltose.dat` into the wrong folder:\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> analyzed/ raw/\n" +"> $ ls -F analyzed\n" +"> fructose.dat glucose.dat maltose.dat sucrose.dat\n" +"> $ cd raw/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Fill in the blanks to move these files to the current folder\n" +"> (i.e., the one she is currently in):\n" +">\n" +"> ~~~\n" +"> $ mv ___/sucrose.dat ___/maltose.dat ___\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ mv ../analyzed/sucrose.dat ../analyzed/maltose.dat .\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > Recall that `..` refers to the parent directory (i.e. one above the current directory)\n" +"> > and that `.` refers to the current directory." +msgstr "" +">\n" +"> After running the following commands,\n" +"> Jamie realizes that she put the files `sucrose.dat` and `maltose.dat` into the wrong folder:\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> analyzed/ raw/\n" +"> $ ls -F analyzed\n" +"> fructose.dat glucose.dat maltose.dat sucrose.dat\n" +"> $ cd raw/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Fill in the blanks to move these files to the current folder\n" +"> (i.e., the one she is currently in):\n" +">\n" +"> ~~~\n" +"> $ mv ___/sucrose.dat ___/maltose.dat ___\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ mv ../analyzed/sucrose.dat ../analyzed/maltose.dat .\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > Recall that `..` refers to the parent directory (i.e. one above the current directory)\n" +"> > and that `.` refers to the current directory." + +#: shell-novice/_episodes/03-create.md:474 +msgid "" +"The `cp` command works very much like `mv`,\n" +"except it copies a file instead of moving it.\n" +"We can check that it did the right thing using `ls`\n" +"with two paths as arguments --- like most Unix commands,\n" +"`ls` can be given multiple paths at once:" +msgstr "" +"The `cp` command works very much like `mv`,\n" +"except it copies a file instead of moving it.\n" +"We can check that it did the right thing using `ls`\n" +"with two paths as arguments --- like most Unix commands,\n" +"`ls` can be given multiple paths at once:" + +# code block +#: shell-novice/_episodes/03-create.md:480 +msgid "" +"~~~\n" +"$ cp quotes.txt thesis/quotations.txt\n" +"$ ls quotes.txt thesis/quotations.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cp quotes.txt thesis/quotations.txt\n" +"$ ls quotes.txt thesis/quotations.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/03-create.md:486 +msgid "" +"~~~\n" +"quotes.txt thesis/quotations.txt\n" +"~~~" +msgstr "" +"~~~\n" +"quotes.txt thesis/quotations.txt\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:491 +msgid "" +"To prove that we made a copy,\n" +"let's delete the `quotes.txt` file in the current directory\n" +"and then run that same `ls` again." +msgstr "" +"To prove that we made a copy,\n" +"let's delete the `quotes.txt` file in the current directory\n" +"and then run that same `ls` again." + +# code block +#: shell-novice/_episodes/03-create.md:495 +msgid "" +"~~~\n" +"$ rm quotes.txt\n" +"$ ls quotes.txt thesis/quotations.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ rm quotes.txt\n" +"$ ls quotes.txt thesis/quotations.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/03-create.md:501 +msgid "" +"~~~\n" +"ls: cannot access quotes.txt: No such file or directory\n" +"thesis/quotations.txt\n" +"~~~" +msgstr "" +"~~~\n" +"ls: cannot access quotes.txt: No such file or directory\n" +"thesis/quotations.txt\n" +"~~~" + +#: shell-novice/_episodes/03-create.md:507 +msgid "" +"This time it tells us that it can't find `quotes.txt` in the current directory,\n" +"but it does find the copy in `thesis` that we didn't delete." +msgstr "" +"This time it tells us that it can't find `quotes.txt` in the current directory,\n" +"but it does find the copy in `thesis` that we didn't delete." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:510 +msgid "> ## What's In A Name?" +msgstr "> ## What's In A Name?" + +#: shell-novice/_episodes/03-create.md:511 +msgid "" +">\n" +"> You may have noticed that all of Nelle's files' names are \"something dot\n" +"> something\", and in this part of the lesson, we always used the extension\n" +"> `.txt`. This is just a convention: we can call a file `mythesis` or\n" +"> almost anything else we want. However, most people use two-part names\n" +"> most of the time to help them (and their programs) tell different kinds\n" +"> of files apart. The second part of such a name is called the\n" +"> **filename extension**, and indicates\n" +"> what type of data the file holds: `.txt` signals a plain text file, `.pdf`\n" +"> indicates a PDF document, `.cfg` is a configuration file full of parameters\n" +"> for some program or other, `.png` is a PNG image, and so on.\n" +">\n" +"> This is just a convention, albeit an important one. Files contain\n" +"> bytes: it's up to us and our programs to interpret those bytes\n" +"> according to the rules for plain text files, PDF documents, configuration\n" +"> files, images, and so on.\n" +">\n" +"> Naming a PNG image of a whale as `whale.mp3` doesn't somehow\n" +"> magically turn it into a recording of whalesong, though it *might*\n" +"> cause the operating system to try to open it with a music player\n" +"> when someone double-clicks it." +msgstr "" +">\n" +"> You may have noticed that all of Nelle's files' names are \"something dot\n" +"> something\", and in this part of the lesson, we always used the extension\n" +"> `.txt`. This is just a convention: we can call a file `mythesis` or\n" +"> almost anything else we want. However, most people use two-part names\n" +"> most of the time to help them (and their programs) tell different kinds\n" +"> of files apart. The second part of such a name is called the\n" +"> **filename extension**, and indicates\n" +"> what type of data the file holds: `.txt` signals a plain text file, `.pdf`\n" +"> indicates a PDF document, `.cfg` is a configuration file full of parameters\n" +"> for some program or other, `.png` is a PNG image, and so on.\n" +">\n" +"> This is just a convention, albeit an important one. Files contain\n" +"> bytes: it's up to us and our programs to interpret those bytes\n" +"> according to the rules for plain text files, PDF documents, configuration\n" +"> files, images, and so on.\n" +">\n" +"> Naming a PNG image of a whale as `whale.mp3` doesn't somehow\n" +"> magically turn it into a recording of whalesong, though it *might*\n" +"> cause the operating system to try to open it with a music player\n" +"> when someone double-clicks it." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:534 +msgid "> ## Renaming Files" +msgstr "> ## Renaming Files" + +#: shell-novice/_episodes/03-create.md:535 +msgid "" +">\n" +"> Suppose that you created a `.txt` file in your current directory to contain a list of the\n" +"> statistical tests you will need to do to analyze your data, and named it: `statstics.txt`\n" +">\n" +"> After creating and saving this file you realize you misspelled the filename! You want to\n" +"> correct the mistake, which of the following commands could you use to do so?\n" +">\n" +"> 1. `cp statstics.txt statistics.txt`\n" +"> 2. `mv statstics.txt statistics.txt`\n" +"> 3. `mv statstics.txt .`\n" +"> 4. `cp statstics.txt .`\n" +">\n" +"> > ## Solution\n" +"> > 1. No. While this would create a file with the correct name, the incorrectly named file still exists in the directory\n" +"> > and would need to be deleted.\n" +"> > 2. Yes, this would work to rename the file.\n" +"> > 3. No, the period(.) indicates where to move the file, but does not provide a new file name; identical file names\n" +"> > cannot be created.\n" +"> > 4. No, the period(.) indicates where to copy the file, but does not provide a new file name; identical file names\n" +"> > cannot be created." +msgstr "" +">\n" +"> Suppose that you created a `.txt` file in your current directory to contain a list of the\n" +"> statistical tests you will need to do to analyze your data, and named it: `statstics.txt`\n" +">\n" +"> After creating and saving this file you realize you misspelled the filename! You want to\n" +"> correct the mistake, which of the following commands could you use to do so?\n" +">\n" +"> 1. `cp statstics.txt statistics.txt`\n" +"> 2. `mv statstics.txt statistics.txt`\n" +"> 3. `mv statstics.txt .`\n" +"> 4. `cp statstics.txt .`\n" +">\n" +"> > ## Solution\n" +"> > 1. No. While this would create a file with the correct name, the incorrectly named file still exists in the directory\n" +"> > and would need to be deleted.\n" +"> > 2. Yes, this would work to rename the file.\n" +"> > 3. No, the period(.) indicates where to move the file, but does not provide a new file name; identical file names\n" +"> > cannot be created.\n" +"> > 4. No, the period(.) indicates where to copy the file, but does not provide a new file name; identical file names\n" +"> > cannot be created." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:558 +msgid "> ## Moving and Copying" +msgstr "> ## Moving and Copying" + +#: shell-novice/_episodes/03-create.md:559 +msgid "" +">\n" +"> What is the output of the closing `ls` command in the sequence shown below?\n" +">\n" +"> ~~~\n" +"> $ pwd\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> /Users/jamie/data\n" +"> ~~~" +msgstr "" +">\n" +"> What is the output of the closing `ls` command in the sequence shown below?\n" +">\n" +"> ~~~\n" +"> $ pwd\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> /Users/jamie/data\n" +"> ~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:571 +#: shell-novice/_episodes/03-create.md:582 +msgid "> $ ls" +msgstr "> $ ls" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:575 +msgid "> proteins.dat" +msgstr "> proteins.dat" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:579 +msgid "> $ mkdir recombine" +msgstr "> $ mkdir recombine" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:580 +msgid "> $ mv proteins.dat recombine/" +msgstr "> $ mv proteins.dat recombine/" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:581 +msgid "> $ cp recombine/proteins.dat ../proteins-saved.dat" +msgstr "> $ cp recombine/proteins.dat ../proteins-saved.dat" + +#: shell-novice/_episodes/03-create.md:585 +msgid "" +">\n" +"> 1. `proteins-saved.dat recombine`\n" +"> 2. `recombine`\n" +"> 3. `proteins.dat recombine`\n" +"> 4. `proteins-saved.dat`\n" +">\n" +"> > ## Solution\n" +"> > We start in the `/Users/jamie/data` directory, and create a new folder called `recombine`.\n" +"> > The second line moves (`mv`) the file `proteins.dat` to the new folder (`recombine`).\n" +"> > The third line makes a copy of the file we just moved. The tricky part here is where the file was\n" +"> > copied to. Recall that `..` means \"go up a level\", so the copied file is now in `/Users/jamie`.\n" +"> > Notice that `..` is interpreted with respect to the current working\n" +"> > directory, **not** with respect to the location of the file being copied.\n" +"> > So, the only thing that will show using ls (in `/Users/jamie/data`) is the recombine folder.\n" +"> >\n" +"> > 1. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`\n" +"> > 2. Yes\n" +"> > 3. No, see explanation above. `proteins.dat` is located at `/Users/jamie/data/recombine`\n" +"> > 4. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`" +msgstr "" +">\n" +"> 1. `proteins-saved.dat recombine`\n" +"> 2. `recombine`\n" +"> 3. `proteins.dat recombine`\n" +"> 4. `proteins-saved.dat`\n" +">\n" +"> > ## Solution\n" +"> > We start in the `/Users/jamie/data` directory, and create a new folder called `recombine`.\n" +"> > The second line moves (`mv`) the file `proteins.dat` to the new folder (`recombine`).\n" +"> > The third line makes a copy of the file we just moved. The tricky part here is where the file was\n" +"> > copied to. Recall that `..` means \"go up a level\", so the copied file is now in `/Users/jamie`.\n" +"> > Notice that `..` is interpreted with respect to the current working\n" +"> > directory, **not** with respect to the location of the file being copied.\n" +"> > So, the only thing that will show using ls (in `/Users/jamie/data`) is the recombine folder.\n" +"> >\n" +"> > 1. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`\n" +"> > 2. Yes\n" +"> > 3. No, see explanation above. `proteins.dat` is located at `/Users/jamie/data/recombine`\n" +"> > 4. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:607 +msgid "> ## Organizing Directories and Files" +msgstr "> ## Organizing Directories and Files" + +#: shell-novice/_episodes/03-create.md:608 +msgid "" +">\n" +"> Jamie is working on a project and she sees that her files aren't very well\n" +"> organized:\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> analyzed/ fructose.dat raw/ sucrose.dat\n" +"> ~~~" +msgstr "" +">\n" +"> Jamie is working on a project and she sees that her files aren't very well\n" +"> organized:\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> analyzed/ fructose.dat raw/ sucrose.dat\n" +"> ~~~" + +#: shell-novice/_episodes/03-create.md:620 +msgid "" +">\n" +"> The `fructose.dat` and `sucrose.dat` files contain output from her data\n" +"> analysis. What command(s) covered in this lesson does she need to run so that the commands below will\n" +"> produce the output shown?\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> analyzed/ raw/\n" +"> ~~~" +msgstr "" +">\n" +"> The `fructose.dat` and `sucrose.dat` files contain output from her data\n" +"> analysis. What command(s) covered in this lesson does she need to run so that the commands below will\n" +"> produce the output shown?\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> analyzed/ raw/\n" +"> ~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:634 +msgid "> $ ls analyzed" +msgstr "> $ ls analyzed" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:638 +msgid "> fructose.dat sucrose.dat" +msgstr "> fructose.dat sucrose.dat" + +#: shell-novice/_episodes/03-create.md:641 +msgid "" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > mv *.dat analyzed\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > Jamie needs to move her files `fructose.dat` and `sucrose.dat` to the `analyzed` directory.\n" +"> > The shell will expand *.dat to match all .dat files in the current directory.\n" +"> > The `mv` command then moves the list of .dat files to the \"analyzed\" directory." +msgstr "" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > mv *.dat analyzed\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > Jamie needs to move her files `fructose.dat` and `sucrose.dat` to the `analyzed` directory.\n" +"> > The shell will expand *.dat to match all .dat files in the current directory.\n" +"> > The `mv` command then moves the list of .dat files to the \"analyzed\" directory." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:653 +msgid "> ## Copy with Multiple Filenames" +msgstr "> ## Copy with Multiple Filenames" + +#: shell-novice/_episodes/03-create.md:654 +msgid "" +">\n" +"> For this exercise, you can test the commands in the `data-shell/data directory`.\n" +">\n" +"> In the example below, what does `cp` do when given several filenames and a directory name?\n" +">\n" +"> ~~~\n" +"> $ mkdir backup\n" +"> $ cp amino-acids.txt animals.txt backup/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> In the example below, what does `cp` do when given three or more file names?\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> amino-acids.txt animals.txt backup/ elements/ morse.txt pdb/ planets.txt salmon.txt sunspot.txt\n" +"> ~~~" +msgstr "" +">\n" +"> For this exercise, you can test the commands in the `data-shell/data directory`.\n" +">\n" +"> In the example below, what does `cp` do when given several filenames and a directory name?\n" +">\n" +"> ~~~\n" +"> $ mkdir backup\n" +"> $ cp amino-acids.txt animals.txt backup/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> In the example below, what does `cp` do when given three or more file names?\n" +">\n" +"> ~~~\n" +"> $ ls -F\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> amino-acids.txt animals.txt backup/ elements/ morse.txt pdb/ planets.txt salmon.txt sunspot.txt\n" +"> ~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:676 +msgid "> $ cp amino-acids.txt animals.txt morse.txt " +msgstr "> $ cp amino-acids.txt animals.txt morse.txt " + +#: shell-novice/_episodes/03-create.md:679 +msgid "" +">\n" +"> > ## Solution\n" +"> > If given more than one file name followed by a directory name (i.e. the destination directory must \n" +"> > be the last argument), `cp` copies the files to the named directory.\n" +"> >\n" +"> > If given three file names, `cp` throws an error because it is expecting a directory\n" +"> > name as the last argument.\n" +"> >\n" +"> > ```\n" +"> > cp: target ‘morse.txt’ is not a directory\n" +"> > ```\n" +"> > {: .output}" +msgstr "" +">\n" +"> > ## Solution\n" +"> > If given more than one file name followed by a directory name (i.e. the destination directory must \n" +"> > be the last argument), `cp` copies the files to the named directory.\n" +"> >\n" +"> > If given three file names, `cp` throws an error because it is expecting a directory\n" +"> > name as the last argument.\n" +"> >\n" +"> > ```\n" +"> > cp: target ‘morse.txt’ is not a directory\n" +"> > ```\n" +"> > {: .output}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/03-create.md:694 +msgid "> ## Copy a folder structure sans files" +msgstr "> ## Copy a folder structure sans files" + +#: shell-novice/_episodes/03-create.md:695 +msgid "" +">\n" +"> You're starting a new experiment, and would like to duplicate the file\n" +"> structure from your previous experiment without the data files so you can\n" +"> add new data.\n" +">\n" +"> Assume that the file structure is in a folder called '2016-05-18-data',\n" +"> which contains a `data` folder that in turn contains folders named `raw` and\n" +"> `processed` that contain data files. The goal is to copy the file structure\n" +"> of the `2016-05-18-data` folder into a folder called `2016-05-20-data` and\n" +"> remove the data files from the directory you just created.\n" +">\n" +"> Which of the following set of commands would achieve this objective?\n" +"> What would the other commands do?\n" +">\n" +"> ~~~\n" +"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" +"> $ rm 2016-05-20-data/raw/*\n" +"> $ rm 2016-05-20-data/processed/*\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> $ rm 2016-05-20-data/raw/*\n" +"> $ rm 2016-05-20-data/processed/*\n" +"> $ cp -r 2016-05-18-data/ 2016-5-20-data/\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" +"> $ rm -r -i 2016-05-20-data/\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> >\n" +"> > ## Solution\n" +"> > The first set of commands achieves this objective.\n" +"> > First we have a recursive copy of a data folder.\n" +"> > Then two `rm` commands which remove all files in the specified directories.\n" +"> > The shell expands the '*' wild card to match all files and subdirectories.\n" +"> >\n" +"> > The second set of commands have the wrong order: \n" +"> > attempting to delete files which haven't yet been copied,\n" +"> > followed by the recursive copy command which would copy them.\n" +"> >\n" +"> > The third set of commands would achieve the objective, but in a time-consuming way:\n" +"> > the first command copies the directory recursively, but the second command deletes\n" +"> > interactively, prompting for confirmation for each file and directory." +msgstr "" +">\n" +"> You're starting a new experiment, and would like to duplicate the file\n" +"> structure from your previous experiment without the data files so you can\n" +"> add new data.\n" +">\n" +"> Assume that the file structure is in a folder called '2016-05-18-data',\n" +"> which contains a `data` folder that in turn contains folders named `raw` and\n" +"> `processed` that contain data files. The goal is to copy the file structure\n" +"> of the `2016-05-18-data` folder into a folder called `2016-05-20-data` and\n" +"> remove the data files from the directory you just created.\n" +">\n" +"> Which of the following set of commands would achieve this objective?\n" +"> What would the other commands do?\n" +">\n" +"> ~~~\n" +"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" +"> $ rm 2016-05-20-data/raw/*\n" +"> $ rm 2016-05-20-data/processed/*\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> $ rm 2016-05-20-data/raw/*\n" +"> $ rm 2016-05-20-data/processed/*\n" +"> $ cp -r 2016-05-18-data/ 2016-5-20-data/\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" +"> $ rm -r -i 2016-05-20-data/\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> >\n" +"> > ## Solution\n" +"> > The first set of commands achieves this objective.\n" +"> > First we have a recursive copy of a data folder.\n" +"> > Then two `rm` commands which remove all files in the specified directories.\n" +"> > The shell expands the '*' wild card to match all files and subdirectories.\n" +"> >\n" +"> > The second set of commands have the wrong order: \n" +"> > attempting to delete files which haven't yet been copied,\n" +"> > followed by the recursive copy command which would copy them.\n" +"> >\n" +"> > The third set of commands would achieve the objective, but in a time-consuming way:\n" +"> > the first command copies the directory recursively, but the second command deletes\n" +"> > interactively, prompting for confirmation for each file and directory." + +# Front Matter +#: shell-novice/_episodes/04-pipefilter.md:1 +msgid "" +"---\n" +"title: \"Pipes and Filters\"\n" +"teaching: 30\n" +"exercises: 20\n" +"questions:\n" +"- \"How can I combine existing commands to do new things?\"\n" +"objectives:\n" +"- \"Redirect a command's output to a file.\"\n" +"- \"Process a file instead of keyboard input using redirection.\"\n" +"- \"Construct command pipelines with two or more stages.\"\n" +"- \"Explain what usually happens if a program or pipeline isn't given any input to process.\"\n" +"- \"Explain Unix's 'small pieces, loosely joined' philosophy.\"\n" +"keypoints:\n" +"- \"`cat` displays the contents of its inputs.\"\n" +"- \"`head` displays the first few lines of its input.\"\n" +"- \"`tail` displays the last few lines of its input.\"\n" +"- \"`sort` sorts its inputs.\"\n" +"- \"`wc` counts lines, words, and characters in its inputs.\"\n" +"- \"`*` matches zero or more characters in a filename, so `*.txt` matches all files ending in `.txt`.\"\n" +"- \"`?` matches any single character in a filename, so `?.txt` matches `a.txt` but not `any.txt`.\"\n" +"- \"`command > file` redirects a command's output to a file.\"\n" +"- \"`first | second` is a pipeline: the output of the first command is used as the input to the second.\"\n" +"- \"The best way to use the shell is to use pipes to combine simple single-purpose programs (filters).\"\n" +"---" +msgstr "" +"---\n" +"title: \"Pipes and Filters\"\n" +"teaching: 30\n" +"exercises: 20\n" +"questions:\n" +"- \"How can I combine existing commands to do new things?\"\n" +"objectives:\n" +"- \"Redirect a command's output to a file.\"\n" +"- \"Process a file instead of keyboard input using redirection.\"\n" +"- \"Construct command pipelines with two or more stages.\"\n" +"- \"Explain what usually happens if a program or pipeline isn't given any input to process.\"\n" +"- \"Explain Unix's 'small pieces, loosely joined' philosophy.\"\n" +"keypoints:\n" +"- \"`cat` displays the contents of its inputs.\"\n" +"- \"`head` displays the first few lines of its input.\"\n" +"- \"`tail` displays the last few lines of its input.\"\n" +"- \"`sort` sorts its inputs.\"\n" +"- \"`wc` counts lines, words, and characters in its inputs.\"\n" +"- \"`*` matches zero or more characters in a filename, so `*.txt` matches all files ending in `.txt`.\"\n" +"- \"`?` matches any single character in a filename, so `?.txt` matches `a.txt` but not `any.txt`.\"\n" +"- \"`command > file` redirects a command's output to a file.\"\n" +"- \"`first | second` is a pipeline: the output of the first command is used as the input to the second.\"\n" +"- \"The best way to use the shell is to use pipes to combine simple single-purpose programs (filters).\"\n" +"---" + +#: shell-novice/_episodes/04-pipefilter.md:26 +msgid "" +"Now that we know a few basic commands,\n" +"we can finally look at the shell's most powerful feature:\n" +"the ease with which it lets us combine existing programs in new ways.\n" +"We'll start with a directory called `molecules`\n" +"that contains six files describing some simple organic molecules.\n" +"The `.pdb` extension indicates that these files are in Protein Data Bank format,\n" +"a simple text format that specifies the type and position of each atom in the molecule." +msgstr "" +"Now that we know a few basic commands,\n" +"we can finally look at the shell's most powerful feature:\n" +"the ease with which it lets us combine existing programs in new ways.\n" +"We'll start with a directory called `molecules`\n" +"that contains six files describing some simple organic molecules.\n" +"The `.pdb` extension indicates that these files are in Protein Data Bank format,\n" +"a simple text format that specifies the type and position of each atom in the molecule." + +# code block +#: shell-novice/_episodes/04-pipefilter.md:34 +msgid "" +"~~~\n" +"$ ls molecules\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls molecules\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:39 +msgid "" +"~~~\n" +"cubane.pdb ethane.pdb methane.pdb\n" +"octane.pdb pentane.pdb propane.pdb\n" +"~~~" +msgstr "" +"~~~\n" +"cubane.pdb ethane.pdb methane.pdb\n" +"octane.pdb pentane.pdb propane.pdb\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:45 +msgid "" +"Let's go into that directory with `cd` and run the command `wc *.pdb`.\n" +"`wc` is the \"word count\" command:\n" +"it counts the number of lines, words, and characters in files.\n" +"The `*` in `*.pdb` matches zero or more characters,\n" +"so the shell turns `*.pdb` into a list of all `.pdb` files in the current directory:" +msgstr "" +"Let's go into that directory with `cd` and run the command `wc *.pdb`.\n" +"`wc` is the \"word count\" command:\n" +"it counts the number of lines, words, and characters in files.\n" +"The `*` in `*.pdb` matches zero or more characters,\n" +"so the shell turns `*.pdb` into a list of all `.pdb` files in the current directory:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:51 +msgid "" +"~~~\n" +"$ cd molecules\n" +"$ wc *.pdb\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd molecules\n" +"$ wc *.pdb\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:57 +msgid "" +"~~~\n" +" 20 156 1158 cubane.pdb\n" +" 12 84 622 ethane.pdb\n" +" 9 57 422 methane.pdb\n" +" 30 246 1828 octane.pdb\n" +" 21 165 1226 pentane.pdb\n" +" 15 111 825 propane.pdb\n" +" 107 819 6081 total\n" +"~~~" +msgstr "" +"~~~\n" +" 20 156 1158 cubane.pdb\n" +" 12 84 622 ethane.pdb\n" +" 9 57 422 methane.pdb\n" +" 30 246 1828 octane.pdb\n" +" 21 165 1226 pentane.pdb\n" +" 15 111 825 propane.pdb\n" +" 107 819 6081 total\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:68 +#: shell-novice/_episodes/07-find.md:252 +msgid "> ## Wildcards" +msgstr "> ## Wildcards" + +#: shell-novice/_episodes/04-pipefilter.md:69 +msgid "" +">\n" +"> `*` is a **wildcard**. It matches zero or more\n" +"> characters, so `*.pdb` matches `ethane.pdb`, `propane.pdb`, and every\n" +"> file that ends with '.pdb'. On the other hand, `p*.pdb` only matches\n" +"> `pentane.pdb` and `propane.pdb`, because the 'p' at the front only\n" +"> matches filenames that begin with the letter 'p'.\n" +">\n" +"> `?` is also a wildcard, but it only matches a single character. This\n" +"> means that `p?.pdb` would match `pi.pdb` or `p5.pdb` (if we had these two\n" +"> files in the `molecules` directory), but not `propane.pdb`.\n" +"> We can use any number of wildcards at a time: for example, `p*.p?*`\n" +"> matches anything that starts with a 'p' and ends with '.', 'p', and at\n" +"> least one more character (since the `?` has to match one character, and\n" +"> the final `*` can match any number of characters). Thus, `p*.p?*` would\n" +"> match `preferred.practice`, and even `p.pi` (since the first `*` can\n" +"> match no characters at all), but not `quality.practice` (doesn't start\n" +"> with 'p') or `preferred.p` (there isn't at least one character after the\n" +"> '.p').\n" +">\n" +"> When the shell sees a wildcard, it expands the wildcard to create a\n" +"> list of matching filenames *before* running the command that was\n" +"> asked for. As an exception, if a wildcard expression does not match\n" +"> any file, Bash will pass the expression as an argument to the command\n" +"> as it is. For example typing `ls *.pdf` in the `molecules` directory\n" +"> (which contains only files with names ending with `.pdb`) results in\n" +"> an error message that there is no file called `*.pdf`.\n" +"> However, generally commands like `wc` and `ls` see the lists of\n" +"> file names matching these expressions, but not the wildcards\n" +"> themselves. It is the shell, not the other programs, that deals with\n" +"> expanding wildcards, and this is another example of orthogonal design." +msgstr "" +">\n" +"> `*` is a **wildcard**. It matches zero or more\n" +"> characters, so `*.pdb` matches `ethane.pdb`, `propane.pdb`, and every\n" +"> file that ends with '.pdb'. On the other hand, `p*.pdb` only matches\n" +"> `pentane.pdb` and `propane.pdb`, because the 'p' at the front only\n" +"> matches filenames that begin with the letter 'p'.\n" +">\n" +"> `?` is also a wildcard, but it only matches a single character. This\n" +"> means that `p?.pdb` would match `pi.pdb` or `p5.pdb` (if we had these two\n" +"> files in the `molecules` directory), but not `propane.pdb`.\n" +"> We can use any number of wildcards at a time: for example, `p*.p?*`\n" +"> matches anything that starts with a 'p' and ends with '.', 'p', and at\n" +"> least one more character (since the `?` has to match one character, and\n" +"> the final `*` can match any number of characters). Thus, `p*.p?*` would\n" +"> match `preferred.practice`, and even `p.pi` (since the first `*` can\n" +"> match no characters at all), but not `quality.practice` (doesn't start\n" +"> with 'p') or `preferred.p` (there isn't at least one character after the\n" +"> '.p').\n" +">\n" +"> When the shell sees a wildcard, it expands the wildcard to create a\n" +"> list of matching filenames *before* running the command that was\n" +"> asked for. As an exception, if a wildcard expression does not match\n" +"> any file, Bash will pass the expression as an argument to the command\n" +"> as it is. For example typing `ls *.pdf` in the `molecules` directory\n" +"> (which contains only files with names ending with `.pdb`) results in\n" +"> an error message that there is no file called `*.pdf`.\n" +"> However, generally commands like `wc` and `ls` see the lists of\n" +"> file names matching these expressions, but not the wildcards\n" +"> themselves. It is the shell, not the other programs, that deals with\n" +"> expanding wildcards, and this is another example of orthogonal design." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:101 +msgid "> ## Using Wildcards" +msgstr "> ## Using Wildcards" + +#: shell-novice/_episodes/04-pipefilter.md:102 +msgid "" +">\n" +"> When run in the `molecules` directory, which `ls` command(s) will\n" +"> produce this output?\n" +">\n" +"> `ethane.pdb methane.pdb`\n" +">\n" +"> 1. `ls *t*ane.pdb`\n" +"> 2. `ls *t?ne.*`\n" +"> 3. `ls *t??ne.pdb`\n" +"> 4. `ls ethane.*`\n" +">\n" +"> > ## Solution\n" +">> The solution is `3.`\n" +">>\n" +">> `1.` shows all files that contain any number and combination of characters, followed by the letter `t`, another single character, and end with `ane.pdb`. This includes `octane.pdb` and `pentane.pdb`. \n" +">>\n" +">> `2.` shows all files containing any number and combination of characters, `t`, another single character, `ne.` followed by any number and combination of characters. This will give us `octane.pdb` and `pentane.pdb` but doesn't match anything which ends in `thane.pdb`.\n" +">>\n" +">> `3.` fixes the problems of option 2 by matching two characters between `t` and `ne`. This is the solution.\n" +">>\n" +">> `4.` only shows files starting with `ethane.`." +msgstr "" +">\n" +"> When run in the `molecules` directory, which `ls` command(s) will\n" +"> produce this output?\n" +">\n" +"> `ethane.pdb methane.pdb`\n" +">\n" +"> 1. `ls *t*ane.pdb`\n" +"> 2. `ls *t?ne.*`\n" +"> 3. `ls *t??ne.pdb`\n" +"> 4. `ls ethane.*`\n" +">\n" +"> > ## Solution\n" +">> The solution is `3.`\n" +">>\n" +">> `1.` shows all files that contain any number and combination of characters, followed by the letter `t`, another single character, and end with `ane.pdb`. This includes `octane.pdb` and `pentane.pdb`. \n" +">>\n" +">> `2.` shows all files containing any number and combination of characters, `t`, another single character, `ne.` followed by any number and combination of characters. This will give us `octane.pdb` and `pentane.pdb` but doesn't match anything which ends in `thane.pdb`.\n" +">>\n" +">> `3.` fixes the problems of option 2 by matching two characters between `t` and `ne`. This is the solution.\n" +">>\n" +">> `4.` only shows files starting with `ethane.`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:126 +msgid "> ## More on Wildcards" +msgstr "> ## More on Wildcards" + +#: shell-novice/_episodes/04-pipefilter.md:127 +msgid "" +">\n" +"> Sam has a directory containing calibration data, datasets, and descriptions of\n" +"> the datasets:\n" +">\n" +"> ~~~\n" +"> 2015-10-23-calibration.txt\n" +"> 2015-10-23-dataset1.txt\n" +"> 2015-10-23-dataset2.txt\n" +"> 2015-10-23-dataset_overview.txt\n" +"> 2015-10-26-calibration.txt\n" +"> 2015-10-26-dataset1.txt\n" +"> 2015-10-26-dataset2.txt\n" +"> 2015-10-26-dataset_overview.txt\n" +"> 2015-11-23-calibration.txt\n" +"> 2015-11-23-dataset1.txt\n" +"> 2015-11-23-dataset2.txt\n" +"> 2015-11-23-dataset_overview.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Before heading off to another field trip, she wants to back up her data and\n" +"> send some datasets to her colleague Bob. Sam uses the following commands\n" +"> to get the job done:\n" +">\n" +"> ~~~\n" +"> $ cp *dataset* /backup/datasets\n" +"> $ cp ____calibration____ /backup/calibration\n" +"> $ cp 2015-____-____ ~/send_to_bob/all_november_files/\n" +"> $ cp ____ ~/send_to_bob/all_datasets_created_on_a_23rd/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Help Sam by filling in the blanks.\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ cp *calibration.txt /backup/calibration\n" +"> > $ cp 2015-11-* ~/send_to_bob/all_november_files/\n" +"> > $ cp *-23-dataset* ~send_to_bob/all_datasets_created_on_a_23rd/\n" +"> > ```\n" +"> > {: .language-bash}" +msgstr "" +">\n" +"> Sam has a directory containing calibration data, datasets, and descriptions of\n" +"> the datasets:\n" +">\n" +"> ~~~\n" +"> 2015-10-23-calibration.txt\n" +"> 2015-10-23-dataset1.txt\n" +"> 2015-10-23-dataset2.txt\n" +"> 2015-10-23-dataset_overview.txt\n" +"> 2015-10-26-calibration.txt\n" +"> 2015-10-26-dataset1.txt\n" +"> 2015-10-26-dataset2.txt\n" +"> 2015-10-26-dataset_overview.txt\n" +"> 2015-11-23-calibration.txt\n" +"> 2015-11-23-dataset1.txt\n" +"> 2015-11-23-dataset2.txt\n" +"> 2015-11-23-dataset_overview.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Before heading off to another field trip, she wants to back up her data and\n" +"> send some datasets to her colleague Bob. Sam uses the following commands\n" +"> to get the job done:\n" +">\n" +"> ~~~\n" +"> $ cp *dataset* /backup/datasets\n" +"> $ cp ____calibration____ /backup/calibration\n" +"> $ cp 2015-____-____ ~/send_to_bob/all_november_files/\n" +"> $ cp ____ ~/send_to_bob/all_datasets_created_on_a_23rd/\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Help Sam by filling in the blanks.\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ cp *calibration.txt /backup/calibration\n" +"> > $ cp 2015-11-* ~/send_to_bob/all_november_files/\n" +"> > $ cp *-23-dataset* ~send_to_bob/all_datasets_created_on_a_23rd/\n" +"> > ```\n" +"> > {: .language-bash}" + +#: shell-novice/_episodes/04-pipefilter.md:171 +msgid "" +"If we run `wc -l` instead of just `wc`,\n" +"the output shows only the number of lines per file:" +msgstr "" +"If we run `wc -l` instead of just `wc`,\n" +"the output shows only the number of lines per file:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:174 +msgid "" +"~~~\n" +"$ wc -l *.pdb\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.pdb\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:179 +#: shell-novice/_episodes/04-pipefilter.md:277 +msgid "" +"~~~\n" +" 20 cubane.pdb\n" +" 12 ethane.pdb\n" +" 9 methane.pdb\n" +" 30 octane.pdb\n" +" 21 pentane.pdb\n" +" 15 propane.pdb\n" +" 107 total\n" +"~~~" +msgstr "" +"~~~\n" +" 20 cubane.pdb\n" +" 12 ethane.pdb\n" +" 9 methane.pdb\n" +" 30 octane.pdb\n" +" 21 pentane.pdb\n" +" 15 propane.pdb\n" +" 107 total\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:190 +msgid "" +"We can also use `-w` to get only the number of words,\n" +"or `-c` to get only the number of characters." +msgstr "" +"We can also use `-w` to get only the number of words,\n" +"or `-c` to get only the number of characters." + +#: shell-novice/_episodes/04-pipefilter.md:193 +msgid "" +"Which of these files is shortest?\n" +"It's an easy question to answer when there are only six files,\n" +"but what if there were 6000?\n" +"Our first step toward a solution is to run the command:" +msgstr "" +"Which of these files is shortest?\n" +"It's an easy question to answer when there are only six files,\n" +"but what if there were 6000?\n" +"Our first step toward a solution is to run the command:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:198 +msgid "" +"~~~\n" +"$ wc -l *.pdb > lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.pdb > lengths.txt\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:203 +msgid "" +"The greater than symbol, `>`, tells the shell to **redirect** the command's output\n" +"to a file instead of printing it to the screen. (This is why there is no screen output:\n" +"everything that `wc` would have printed has gone into the\n" +"file `lengths.txt` instead.) The shell will create\n" +"the file if it doesn't exist. If the file exists, it will be\n" +"silently overwritten, which may lead to data loss and thus requires\n" +"some caution.\n" +"`ls lengths.txt` confirms that the file exists:" +msgstr "" +"The greater than symbol, `>`, tells the shell to **redirect** the command's output\n" +"to a file instead of printing it to the screen. (This is why there is no screen output:\n" +"everything that `wc` would have printed has gone into the\n" +"file `lengths.txt` instead.) The shell will create\n" +"the file if it doesn't exist. If the file exists, it will be\n" +"silently overwritten, which may lead to data loss and thus requires\n" +"some caution.\n" +"`ls lengths.txt` confirms that the file exists:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:212 +msgid "" +"~~~\n" +"$ ls lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls lengths.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:217 +msgid "" +"~~~\n" +"lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"lengths.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:222 +msgid "> ## What Does `>>` Mean?" +msgstr "> ## What Does `>>` Mean?" + +#: shell-novice/_episodes/04-pipefilter.md:223 +msgid "" +">\n" +"> What is the difference between:\n" +">\n" +"> ~~~\n" +"> $ echo hello > testfile01.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> and:\n" +">\n" +"> ~~~\n" +"> $ echo hello >> testfile02.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Hint: Try executing each command twice in a row and then examining the output files." +msgstr "" +">\n" +"> What is the difference between:\n" +">\n" +"> ~~~\n" +"> $ echo hello > testfile01.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> and:\n" +">\n" +"> ~~~\n" +"> $ echo hello >> testfile02.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Hint: Try executing each command twice in a row and then examining the output files." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:241 +msgid "> ## Appending Data" +msgstr "> ## Appending Data" + +#: shell-novice/_episodes/04-pipefilter.md:242 +msgid "" +">\n" +"> Consider the file `data-shell/data/animals.txt`.\n" +"> After these commands, select the answer that\n" +"> corresponds to the file `animalsUpd.txt`:\n" +">\n" +"> ~~~\n" +"> $ head -3 animals.txt > animalsUpd.txt\n" +"> $ tail -2 animals.txt >> animalsUpd.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. The first three lines of `animals.txt`\n" +"> 2. The last two lines of `animals.txt`\n" +"> 3. The first three lines and the last two lines of `animals.txt`\n" +"> 4. The second and third lines of `animals.txt`\n" +">\n" +"> > ## Solution\n" +"> > Option 3 is correct. \n" +"> > For option 1 to be correct we would only run the `head` command.\n" +"> > For option 2 to be correct we would only run the `tail` command.\n" +"> > For option 4 to be correct we would have to pipe the output of `head` into `tail -2` by doing `head -3 animals.txt | tail -2 >> animalsUpd.txt`" +msgstr "" +">\n" +"> Consider the file `data-shell/data/animals.txt`.\n" +"> After these commands, select the answer that\n" +"> corresponds to the file `animalsUpd.txt`:\n" +">\n" +"> ~~~\n" +"> $ head -3 animals.txt > animalsUpd.txt\n" +"> $ tail -2 animals.txt >> animalsUpd.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. The first three lines of `animals.txt`\n" +"> 2. The last two lines of `animals.txt`\n" +"> 3. The first three lines and the last two lines of `animals.txt`\n" +"> 4. The second and third lines of `animals.txt`\n" +">\n" +"> > ## Solution\n" +"> > Option 3 is correct. \n" +"> > For option 1 to be correct we would only run the `head` command.\n" +"> > For option 2 to be correct we would only run the `tail` command.\n" +"> > For option 4 to be correct we would have to pipe the output of `head` into `tail -2` by doing `head -3 animals.txt | tail -2 >> animalsUpd.txt`" + +#: shell-novice/_episodes/04-pipefilter.md:266 +msgid "" +"We can now send the content of `lengths.txt` to the screen using `cat lengths.txt`.\n" +"`cat` stands for \"concatenate\":\n" +"it prints the contents of files one after another.\n" +"There's only one file in this case,\n" +"so `cat` just shows us what it contains:" +msgstr "" +"We can now send the content of `lengths.txt` to the screen using `cat lengths.txt`.\n" +"`cat` stands for \"concatenate\":\n" +"it prints the contents of files one after another.\n" +"There's only one file in this case,\n" +"so `cat` just shows us what it contains:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:272 +msgid "" +"~~~\n" +"$ cat lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cat lengths.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:288 +msgid "> ## Output Page by Page" +msgstr "> ## Output Page by Page" + +#: shell-novice/_episodes/04-pipefilter.md:289 +msgid "" +">\n" +"> We'll continue to use `cat` in this lesson, for convenience and consistency,\n" +"> but it has the disadvantage that it always dumps the whole file onto your screen.\n" +"> More useful in practice is the command `less`,\n" +"> which you use with `$ less lengths.txt`.\n" +"> This displays a screenful of the file, and then stops.\n" +"> You can go forward one screenful by pressing the spacebar,\n" +"> or back one by pressing `b`. Press `q` to quit." +msgstr "" +">\n" +"> We'll continue to use `cat` in this lesson, for convenience and consistency,\n" +"> but it has the disadvantage that it always dumps the whole file onto your screen.\n" +"> More useful in practice is the command `less`,\n" +"> which you use with `$ less lengths.txt`.\n" +"> This displays a screenful of the file, and then stops.\n" +"> You can go forward one screenful by pressing the spacebar,\n" +"> or back one by pressing `b`. Press `q` to quit." + +#: shell-novice/_episodes/04-pipefilter.md:299 +msgid "Now let's use the `sort` command to sort its contents." +msgstr "Now let's use the `sort` command to sort its contents." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:301 +msgid "> ## What Does `sort -n` Do?" +msgstr "> ## What Does `sort -n` Do?" + +#: shell-novice/_episodes/04-pipefilter.md:302 +msgid "" +">\n" +"> If we run `sort` on a file containing the following lines:\n" +">\n" +"> ~~~\n" +"> 10\n" +"> 2\n" +"> 19\n" +"> 22\n" +"> 6\n" +"> ~~~" +msgstr "" +">\n" +"> If we run `sort` on a file containing the following lines:\n" +">\n" +"> ~~~\n" +"> 10\n" +"> 2\n" +"> 19\n" +"> 22\n" +"> 6\n" +"> ~~~" + +# SC/DC Template label +#: shell-novice/_episodes/04-pipefilter.md:312 +#: shell-novice/_episodes/04-pipefilter.md:620 +#: shell-novice/_episodes/04-pipefilter.md:658 +#: shell-novice/_episodes/05-loop.md:348 +#: shell-novice/_episodes/06-script.md:288 +#: shell-novice/_episodes/07-find.md:294 shell-novice/_episodes/07-find.md:305 +msgid "> {: .source}" +msgstr "> {: .source}" + +#: shell-novice/_episodes/04-pipefilter.md:313 +msgid "" +">\n" +"> the output is:\n" +">\n" +"> ~~~\n" +"> 10\n" +"> 19\n" +"> 2\n" +"> 22\n" +"> 6\n" +"> ~~~" +msgstr "" +">\n" +"> the output is:\n" +">\n" +"> ~~~\n" +"> 10\n" +"> 19\n" +"> 2\n" +"> 22\n" +"> 6\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:324 +msgid "" +">\n" +"> If we run `sort -n` on the same input, we get this instead:\n" +">\n" +"> ~~~\n" +"> 2\n" +"> 6\n" +"> 10\n" +"> 19\n" +"> 22\n" +"> ~~~" +msgstr "" +">\n" +"> If we run `sort -n` on the same input, we get this instead:\n" +">\n" +"> ~~~\n" +"> 2\n" +"> 6\n" +"> 10\n" +"> 19\n" +"> 22\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:335 +msgid "" +">\n" +"> Explain why `-n` has this effect.\n" +">\n" +"> > ## Solution\n" +"> > The `-n` flag specifies a numeric sort, rather than alphabetical." +msgstr "" +">\n" +"> Explain why `-n` has this effect.\n" +">\n" +"> > ## Solution\n" +"> > The `-n` flag specifies a numeric sort, rather than alphabetical." + +#: shell-novice/_episodes/04-pipefilter.md:343 +msgid "" +"We will also use the `-n` flag to specify that the sort is\n" +"numerical instead of alphabetical.\n" +"This does *not* change the file;\n" +"instead, it sends the sorted result to the screen:" +msgstr "" +"We will also use the `-n` flag to specify that the sort is\n" +"numerical instead of alphabetical.\n" +"This does *not* change the file;\n" +"instead, it sends the sorted result to the screen:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:348 +msgid "" +"~~~\n" +"$ sort -n lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ sort -n lengths.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:353 +msgid "" +"~~~\n" +" 9 methane.pdb\n" +" 12 ethane.pdb\n" +" 15 propane.pdb\n" +" 20 cubane.pdb\n" +" 21 pentane.pdb\n" +" 30 octane.pdb\n" +"107 total\n" +"~~~" +msgstr "" +"~~~\n" +" 9 methane.pdb\n" +" 12 ethane.pdb\n" +" 15 propane.pdb\n" +" 20 cubane.pdb\n" +" 21 pentane.pdb\n" +" 30 octane.pdb\n" +"107 total\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:364 +msgid "" +"We can put the sorted list of lines in another temporary file called `sorted-lengths.txt`\n" +"by putting `> sorted-lengths.txt` after the command,\n" +"just as we used `> lengths.txt` to put the output of `wc` into `lengths.txt`.\n" +"Once we've done that,\n" +"we can run another command called `head` to get the first few lines in `sorted-lengths.txt`:" +msgstr "" +"We can put the sorted list of lines in another temporary file called `sorted-lengths.txt`\n" +"by putting `> sorted-lengths.txt` after the command,\n" +"just as we used `> lengths.txt` to put the output of `wc` into `lengths.txt`.\n" +"Once we've done that,\n" +"we can run another command called `head` to get the first few lines in `sorted-lengths.txt`:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:370 +msgid "" +"~~~\n" +"$ sort -n lengths.txt > sorted-lengths.txt\n" +"$ head -n 1 sorted-lengths.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ sort -n lengths.txt > sorted-lengths.txt\n" +"$ head -n 1 sorted-lengths.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:376 +#: shell-novice/_episodes/04-pipefilter.md:415 +msgid "" +"~~~\n" +" 9 methane.pdb\n" +"~~~" +msgstr "" +"~~~\n" +" 9 methane.pdb\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:381 +msgid "" +"Using `-n 1` with `head` tells it that\n" +"we only want the first line of the file;\n" +"`-n 20` would get the first 20,\n" +"and so on.\n" +"Since `sorted-lengths.txt` contains the lengths of our files ordered from least to greatest,\n" +"the output of `head` must be the file with the fewest lines." +msgstr "" +"Using `-n 1` with `head` tells it that\n" +"we only want the first line of the file;\n" +"`-n 20` would get the first 20,\n" +"and so on.\n" +"Since `sorted-lengths.txt` contains the lengths of our files ordered from least to greatest,\n" +"the output of `head` must be the file with the fewest lines." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:388 +msgid "> ## Redirecting to the same file" +msgstr "> ## Redirecting to the same file" + +#: shell-novice/_episodes/04-pipefilter.md:389 +msgid "" +">\n" +"> It's a very bad idea to try redirecting\n" +"> the output of a command that operates on a file\n" +"> to the same file. For example:\n" +">\n" +"> ~~~\n" +"> $ sort -n lengths.txt > lengths.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Doing something like this may give you\n" +"> incorrect results and/or delete\n" +"> the contents of `lengths.txt`." +msgstr "" +">\n" +"> It's a very bad idea to try redirecting\n" +"> the output of a command that operates on a file\n" +"> to the same file. For example:\n" +">\n" +"> ~~~\n" +"> $ sort -n lengths.txt > lengths.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Doing something like this may give you\n" +"> incorrect results and/or delete\n" +"> the contents of `lengths.txt`." + +#: shell-novice/_episodes/04-pipefilter.md:404 +msgid "" +"If you think this is confusing,\n" +"you're in good company:\n" +"even once you understand what `wc`, `sort`, and `head` do,\n" +"all those intermediate files make it hard to follow what's going on.\n" +"We can make it easier to understand by running `sort` and `head` together:" +msgstr "" +"If you think this is confusing,\n" +"you're in good company:\n" +"even once you understand what `wc`, `sort`, and `head` do,\n" +"all those intermediate files make it hard to follow what's going on.\n" +"We can make it easier to understand by running `sort` and `head` together:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:410 +msgid "" +"~~~\n" +"$ sort -n lengths.txt | head -n 1\n" +"~~~" +msgstr "" +"~~~\n" +"$ sort -n lengths.txt | head -n 1\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:420 +msgid "" +"The vertical bar, `|`, between the two commands is called a **pipe**.\n" +"It tells the shell that we want to use\n" +"the output of the command on the left\n" +"as the input to the command on the right.\n" +"The computer might create a temporary file if it needs to,\n" +"or copy data from one program to the other in memory,\n" +"or something else entirely;\n" +"we don't have to know or care." +msgstr "" +"The vertical bar, `|`, between the two commands is called a **pipe**.\n" +"It tells the shell that we want to use\n" +"the output of the command on the left\n" +"as the input to the command on the right.\n" +"The computer might create a temporary file if it needs to,\n" +"or copy data from one program to the other in memory,\n" +"or something else entirely;\n" +"we don't have to know or care." + +#: shell-novice/_episodes/04-pipefilter.md:429 +msgid "" +"Nothing prevents us from chaining pipes consecutively.\n" +"That is, we can for example send the output of `wc` directly to `sort`,\n" +"and then the resulting output to `head`.\n" +"Thus we first use a pipe to send the output of `wc` to `sort`:" +msgstr "" +"Nothing prevents us from chaining pipes consecutively.\n" +"That is, we can for example send the output of `wc` directly to `sort`,\n" +"and then the resulting output to `head`.\n" +"Thus we first use a pipe to send the output of `wc` to `sort`:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:434 +#: shell-novice/_episodes/06-script.md:223 +msgid "" +"~~~\n" +"$ wc -l *.pdb | sort -n\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.pdb | sort -n\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:439 +msgid "" +"~~~\n" +" 9 methane.pdb\n" +" 12 ethane.pdb\n" +" 15 propane.pdb\n" +" 20 cubane.pdb\n" +" 21 pentane.pdb\n" +" 30 octane.pdb\n" +" 107 total\n" +"~~~" +msgstr "" +"~~~\n" +" 9 methane.pdb\n" +" 12 ethane.pdb\n" +" 15 propane.pdb\n" +" 20 cubane.pdb\n" +" 21 pentane.pdb\n" +" 30 octane.pdb\n" +" 107 total\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:450 +msgid "And now we send the output of this pipe, through another pipe, to `head`, so that the full pipeline becomes:" +msgstr "And now we send the output of this pipe, through another pipe, to `head`, so that the full pipeline becomes:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:452 +msgid "" +"~~~\n" +"$ wc -l *.pdb | sort -n | head -n 1\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.pdb | sort -n | head -n 1\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:457 +msgid "" +"~~~\n" +" 9 methane.pdb\n" +"~~~" +msgstr "" +"~~~\n" +" 9 methane.pdb\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:462 +msgid "" +"This is exactly like a mathematician nesting functions like *log(3x)*\n" +"and saying \"the log of three times *x*\".\n" +"In our case,\n" +"the calculation is \"head of sort of line count of `*.pdb`\"." +msgstr "" +"This is exactly like a mathematician nesting functions like *log(3x)*\n" +"and saying \"the log of three times *x*\".\n" +"In our case,\n" +"the calculation is \"head of sort of line count of `*.pdb`\"." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:467 +msgid "> ## Piping Commands Together" +msgstr "> ## Piping Commands Together" + +#: shell-novice/_episodes/04-pipefilter.md:468 +msgid "" +">\n" +"> In our current directory, we want to find the 3 files which have the least number of\n" +"> lines. Which command listed below would work?\n" +">\n" +"> 1. `wc -l * > sort -n > head -n 3`\n" +"> 2. `wc -l * | sort -n | head -n 1-3`\n" +"> 3. `wc -l * | head -n 3 | sort -n`\n" +"> 4. `wc -l * | sort -n | head -n 3`\n" +">\n" +"> > ## Solution\n" +"> > Option 4 is the solution.\n" +"> > The pipe character `|` is used to feed the standard output from one process to\n" +"> > the standard input of another.\n" +"> > `>` is used to redirect standard output to a file.\n" +"> > Try it in the `data-shell/molecules` directory!" +msgstr "" +">\n" +"> In our current directory, we want to find the 3 files which have the least number of\n" +"> lines. Which command listed below would work?\n" +">\n" +"> 1. `wc -l * > sort -n > head -n 3`\n" +"> 2. `wc -l * | sort -n | head -n 1-3`\n" +"> 3. `wc -l * | head -n 3 | sort -n`\n" +"> 4. `wc -l * | sort -n | head -n 3`\n" +">\n" +"> > ## Solution\n" +"> > Option 4 is the solution.\n" +"> > The pipe character `|` is used to feed the standard output from one process to\n" +"> > the standard input of another.\n" +"> > `>` is used to redirect standard output to a file.\n" +"> > Try it in the `data-shell/molecules` directory!" + +#: shell-novice/_episodes/04-pipefilter.md:486 +msgid "" +"Here's what actually happens behind the scenes when we create a pipe.\n" +"When a computer runs a program --- any program --- it creates a **process**\n" +"in memory to hold the program's software and its current state.\n" +"Every process has an input channel called **standard input**.\n" +"(By this point, you may be surprised that the name is so memorable, but don't worry:\n" +"most Unix programmers call it \"stdin\").\n" +"Every process also has a default output channel called **standard output**\n" +"(or \"stdout\"). A second output channel called **standard error** (stderr) also\n" +"exists. This channel is typically used for error or diagnostic messages, and it\n" +"allows a user to pipe the output of one program into another while still receiving \n" +"error messages in the terminal. " +msgstr "" +"Here's what actually happens behind the scenes when we create a pipe.\n" +"When a computer runs a program --- any program --- it creates a **process**\n" +"in memory to hold the program's software and its current state.\n" +"Every process has an input channel called **standard input**.\n" +"(By this point, you may be surprised that the name is so memorable, but don't worry:\n" +"most Unix programmers call it \"stdin\").\n" +"Every process also has a default output channel called **standard output**\n" +"(or \"stdout\"). A second output channel called **standard error** (stderr) also\n" +"exists. This channel is typically used for error or diagnostic messages, and it\n" +"allows a user to pipe the output of one program into another while still receiving \n" +"error messages in the terminal. " + +#: shell-novice/_episodes/04-pipefilter.md:498 +msgid "" +"The shell is actually just another program.\n" +"Under normal circumstances,\n" +"whatever we type on the keyboard is sent to the shell on its standard input,\n" +"and whatever it produces on standard output is displayed on our screen.\n" +"When we tell the shell to run a program,\n" +"it creates a new process\n" +"and temporarily sends whatever we type on our keyboard to that process's standard input,\n" +"and whatever the process sends to standard output to the screen." +msgstr "" +"The shell is actually just another program.\n" +"Under normal circumstances,\n" +"whatever we type on the keyboard is sent to the shell on its standard input,\n" +"and whatever it produces on standard output is displayed on our screen.\n" +"When we tell the shell to run a program,\n" +"it creates a new process\n" +"and temporarily sends whatever we type on our keyboard to that process's standard input,\n" +"and whatever the process sends to standard output to the screen." + +#: shell-novice/_episodes/04-pipefilter.md:507 +msgid "" +"Here's what happens when we run `wc -l *.pdb > lengths.txt`.\n" +"The shell starts by telling the computer to create a new process to run the `wc` program.\n" +"Since we've provided some filenames as arguments,\n" +"`wc` reads from them instead of from standard input.\n" +"And since we've used `>` to redirect output to a file,\n" +"the shell connects the process's standard output to that file." +msgstr "" +"Here's what happens when we run `wc -l *.pdb > lengths.txt`.\n" +"The shell starts by telling the computer to create a new process to run the `wc` program.\n" +"Since we've provided some filenames as arguments,\n" +"`wc` reads from them instead of from standard input.\n" +"And since we've used `>` to redirect output to a file,\n" +"the shell connects the process's standard output to that file." + +#: shell-novice/_episodes/04-pipefilter.md:514 +msgid "" +"If we run `wc -l *.pdb | sort -n` instead,\n" +"the shell creates two processes\n" +"(one for each process in the pipe)\n" +"so that `wc` and `sort` run simultaneously.\n" +"The standard output of `wc` is fed directly to the standard input of `sort`;\n" +"since there's no redirection with `>`,\n" +"`sort`'s output goes to the screen.\n" +"And if we run `wc -l *.pdb | sort -n | head -n 1`,\n" +"we get three processes with data flowing from the files,\n" +"through `wc` to `sort`,\n" +"and from `sort` through `head` to the screen." +msgstr "" +"If we run `wc -l *.pdb | sort -n` instead,\n" +"the shell creates two processes\n" +"(one for each process in the pipe)\n" +"so that `wc` and `sort` run simultaneously.\n" +"The standard output of `wc` is fed directly to the standard input of `sort`;\n" +"since there's no redirection with `>`,\n" +"`sort`'s output goes to the screen.\n" +"And if we run `wc -l *.pdb | sort -n | head -n 1`,\n" +"we get three processes with data flowing from the files,\n" +"through `wc` to `sort`,\n" +"and from `sort` through `head` to the screen." + +#: shell-novice/_episodes/04-pipefilter.md:526 +msgid "![Redirects and Pipes](../fig/redirects-and-pipes.png)" +msgstr "![Redirects and Pipes](../fig/redirects-and-pipes.png)" + +#: shell-novice/_episodes/04-pipefilter.md:528 +msgid "" +"This simple idea is why Unix has been so successful.\n" +"Instead of creating enormous programs that try to do many different things,\n" +"Unix programmers focus on creating lots of simple tools that each do one job well,\n" +"and that work well with each other.\n" +"This programming model is called \"pipes and filters\".\n" +"We've already seen pipes;\n" +"a **filter** is a program like `wc` or `sort`\n" +"that transforms a stream of input into a stream of output.\n" +"Almost all of the standard Unix tools can work this way:\n" +"unless told to do otherwise,\n" +"they read from standard input,\n" +"do something with what they've read,\n" +"and write to standard output." +msgstr "" +"This simple idea is why Unix has been so successful.\n" +"Instead of creating enormous programs that try to do many different things,\n" +"Unix programmers focus on creating lots of simple tools that each do one job well,\n" +"and that work well with each other.\n" +"This programming model is called \"pipes and filters\".\n" +"We've already seen pipes;\n" +"a **filter** is a program like `wc` or `sort`\n" +"that transforms a stream of input into a stream of output.\n" +"Almost all of the standard Unix tools can work this way:\n" +"unless told to do otherwise,\n" +"they read from standard input,\n" +"do something with what they've read,\n" +"and write to standard output." + +#: shell-novice/_episodes/04-pipefilter.md:542 +msgid "" +"The key is that any program that reads lines of text from standard input\n" +"and writes lines of text to standard output\n" +"can be combined with every other program that behaves this way as well.\n" +"You can *and should* write your programs this way\n" +"so that you and other people can put those programs into pipes to multiply their power." +msgstr "" +"The key is that any program that reads lines of text from standard input\n" +"and writes lines of text to standard output\n" +"can be combined with every other program that behaves this way as well.\n" +"You can *and should* write your programs this way\n" +"so that you and other people can put those programs into pipes to multiply their power." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:548 +msgid "> ## Redirecting Input" +msgstr "> ## Redirecting Input" + +#: shell-novice/_episodes/04-pipefilter.md:549 +msgid "" +">\n" +"> As well as using `>` to redirect a program's output, we can use `<` to\n" +"> redirect its input, i.e., to read from a file instead of from standard\n" +"> input. For example, instead of writing `wc ammonia.pdb`, we could write\n" +"> `wc < ammonia.pdb`. In the first case, `wc` gets a command line\n" +"> argument telling it what file to open. In the second, `wc` doesn't have\n" +"> any command line arguments, so it reads from standard input, but we\n" +"> have told the shell to send the contents of `ammonia.pdb` to `wc`'s\n" +"> standard input." +msgstr "" +">\n" +"> As well as using `>` to redirect a program's output, we can use `<` to\n" +"> redirect its input, i.e., to read from a file instead of from standard\n" +"> input. For example, instead of writing `wc ammonia.pdb`, we could write\n" +"> `wc < ammonia.pdb`. In the first case, `wc` gets a command line\n" +"> argument telling it what file to open. In the second, `wc` doesn't have\n" +"> any command line arguments, so it reads from standard input, but we\n" +"> have told the shell to send the contents of `ammonia.pdb` to `wc`'s\n" +"> standard input." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:560 +msgid "> ## What Does `<` Mean?" +msgstr "> ## What Does `<` Mean?" + +#: shell-novice/_episodes/04-pipefilter.md:561 +msgid "" +">\n" +"> Change directory to `data-shell` (the top level of our downloaded example data).\n" +">\n" +"> What is the difference between:\n" +">\n" +"> ~~~\n" +"> $ wc -l notes.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> and:\n" +">\n" +"> ~~~\n" +"> $ wc -l < notes.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > `<` is used to redirect input to a command. \n" +"> >\n" +"> > In both examples, the shell returns the number of lines from the input to\n" +"> > the `wc` command.\n" +"> > In the first example, the input is the file `notes.txt` and the file name is\n" +"> > given in the output from the `wc` command.\n" +"> > In the second example, the contents of the file `notes.txt` are redirected to\n" +"> > standard input.\n" +"> > It is as if we have entered the contents of the file by typing at the prompt.\n" +"> > Hence the file name is not given in the output - just the number of lines.\n" +"> > Try this for yourself:\n" +"> >\n" +"> > ```\n" +"> > $ wc -l\n" +"> > this\n" +"> > is\n" +"> > a test\n" +"> > Ctrl-D # This lets the shell know you have finished typing the input\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> >\n" +"> > ```\n" +"> > 3\n" +"> > ```\n" +"> > {: .output}" +msgstr "" +">\n" +"> Change directory to `data-shell` (the top level of our downloaded example data).\n" +">\n" +"> What is the difference between:\n" +">\n" +"> ~~~\n" +"> $ wc -l notes.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> and:\n" +">\n" +"> ~~~\n" +"> $ wc -l < notes.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > `<` is used to redirect input to a command. \n" +"> >\n" +"> > In both examples, the shell returns the number of lines from the input to\n" +"> > the `wc` command.\n" +"> > In the first example, the input is the file `notes.txt` and the file name is\n" +"> > given in the output from the `wc` command.\n" +"> > In the second example, the contents of the file `notes.txt` are redirected to\n" +"> > standard input.\n" +"> > It is as if we have entered the contents of the file by typing at the prompt.\n" +"> > Hence the file name is not given in the output - just the number of lines.\n" +"> > Try this for yourself:\n" +"> >\n" +"> > ```\n" +"> > $ wc -l\n" +"> > this\n" +"> > is\n" +"> > a test\n" +"> > Ctrl-D # This lets the shell know you have finished typing the input\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> >\n" +"> > ```\n" +"> > 3\n" +"> > ```\n" +"> > {: .output}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:607 +msgid "> ## Why Does `uniq` Only Remove Adjacent Duplicates?" +msgstr "> ## Why Does `uniq` Only Remove Adjacent Duplicates?" + +#: shell-novice/_episodes/04-pipefilter.md:608 +msgid "" +">\n" +"> The command `uniq` removes adjacent duplicated lines from its input.\n" +"> For example, the file `data-shell/data/salmon.txt` contains:\n" +">\n" +"> ~~~\n" +"> coho\n" +"> coho\n" +"> steelhead\n" +"> coho\n" +"> steelhead\n" +"> steelhead\n" +"> ~~~" +msgstr "" +">\n" +"> The command `uniq` removes adjacent duplicated lines from its input.\n" +"> For example, the file `data-shell/data/salmon.txt` contains:\n" +">\n" +"> ~~~\n" +"> coho\n" +"> coho\n" +"> steelhead\n" +"> coho\n" +"> steelhead\n" +"> steelhead\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:621 +msgid "" +">\n" +"> Running the command `uniq salmon.txt` from the `data-shell/data` directory produces:\n" +">\n" +"> ~~~\n" +"> coho\n" +"> steelhead\n" +"> coho\n" +"> steelhead\n" +"> ~~~" +msgstr "" +">\n" +"> Running the command `uniq salmon.txt` from the `data-shell/data` directory produces:\n" +">\n" +"> ~~~\n" +"> coho\n" +"> steelhead\n" +"> coho\n" +"> steelhead\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:631 +msgid "" +">\n" +"> Why do you think `uniq` only removes *adjacent* duplicated lines?\n" +"> (Hint: think about very large data sets.) What other command could\n" +"> you combine with it in a pipe to remove all duplicated lines?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ sort salmon.txt | uniq\n" +"> > ```\n" +"> > {: .language-bash}" +msgstr "" +">\n" +"> Why do you think `uniq` only removes *adjacent* duplicated lines?\n" +"> (Hint: think about very large data sets.) What other command could\n" +"> you combine with it in a pipe to remove all duplicated lines?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ sort salmon.txt | uniq\n" +"> > ```\n" +"> > {: .language-bash}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:644 +msgid "> ## Pipe Reading Comprehension" +msgstr "> ## Pipe Reading Comprehension" + +#: shell-novice/_episodes/04-pipefilter.md:645 +msgid "" +">\n" +"> A file called `animals.txt` (in the `data-shell/data` folder) contains the following data:\n" +">\n" +"> ~~~\n" +"> 2012-11-05,deer\n" +"> 2012-11-05,rabbit\n" +"> 2012-11-05,raccoon\n" +"> 2012-11-06,rabbit\n" +"> 2012-11-06,deer\n" +"> 2012-11-06,fox\n" +"> 2012-11-07,rabbit\n" +"> 2012-11-07,bear\n" +"> ~~~" +msgstr "" +">\n" +"> A file called `animals.txt` (in the `data-shell/data` folder) contains the following data:\n" +">\n" +"> ~~~\n" +"> 2012-11-05,deer\n" +"> 2012-11-05,rabbit\n" +"> 2012-11-05,raccoon\n" +"> 2012-11-06,rabbit\n" +"> 2012-11-06,deer\n" +"> 2012-11-06,fox\n" +"> 2012-11-07,rabbit\n" +"> 2012-11-07,bear\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:659 +msgid "" +">\n" +"> What text passes through each of the pipes and the final redirect in the pipeline below?\n" +">\n" +"> ~~~\n" +"> $ cat animals.txt | head -n 5 | tail -n 3 | sort -r > final.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> Hint: build the pipeline up one command at a time to test your understanding" +msgstr "" +">\n" +"> What text passes through each of the pipes and the final redirect in the pipeline below?\n" +">\n" +"> ~~~\n" +"> $ cat animals.txt | head -n 5 | tail -n 3 | sort -r > final.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> Hint: build the pipeline up one command at a time to test your understanding" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:669 +msgid "> ## Pipe Construction" +msgstr "> ## Pipe Construction" + +#: shell-novice/_episodes/04-pipefilter.md:670 +msgid "" +">\n" +"> For the file `animals.txt` from the previous exercise, the command:\n" +">\n" +"> ~~~\n" +"> $ cut -d , -f 2 animals.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> \n" +"> uses the -d flag to separate each line by comma, and the -f flag\n" +"> to print the second field in each line, to give the following output:\n" +">\n" +"> ~~~\n" +"> deer\n" +"> rabbit\n" +"> raccoon\n" +"> rabbit\n" +"> deer\n" +"> fox\n" +"> rabbit\n" +"> bear\n" +"> ~~~" +msgstr "" +">\n" +"> For the file `animals.txt` from the previous exercise, the command:\n" +">\n" +"> ~~~\n" +"> $ cut -d , -f 2 animals.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> \n" +"> uses the -d flag to separate each line by comma, and the -f flag\n" +"> to print the second field in each line, to give the following output:\n" +">\n" +"> ~~~\n" +"> deer\n" +"> rabbit\n" +"> raccoon\n" +"> rabbit\n" +"> deer\n" +"> fox\n" +"> rabbit\n" +"> bear\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:692 +msgid "" +">\n" +"> What other command(s) could be added to this in a pipeline to find\n" +"> out what animals the file contains (without any duplicates in their\n" +"> names)?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ cut -d , -f 2 animals.txt | sort | uniq\n" +"> > ```\n" +"> > {: .language-bash}" +msgstr "" +">\n" +"> What other command(s) could be added to this in a pipeline to find\n" +"> out what animals the file contains (without any duplicates in their\n" +"> names)?\n" +">\n" +"> > ## Solution\n" +"> > ```\n" +"> > $ cut -d , -f 2 animals.txt | sort | uniq\n" +"> > ```\n" +"> > {: .language-bash}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:705 +msgid "> ## Which Pipe?" +msgstr "> ## Which Pipe?" + +#: shell-novice/_episodes/04-pipefilter.md:706 +msgid "" +">\n" +"> The file `animals.txt` contains 586 lines of data formatted as follows:\n" +">\n" +"> ~~~\n" +"> 2012-11-05,deer\n" +"> 2012-11-05,rabbit\n" +"> 2012-11-05,raccoon\n" +"> 2012-11-06,rabbit\n" +"> ...\n" +"> ~~~" +msgstr "" +">\n" +"> The file `animals.txt` contains 586 lines of data formatted as follows:\n" +">\n" +"> ~~~\n" +"> 2012-11-05,deer\n" +"> 2012-11-05,rabbit\n" +"> 2012-11-05,raccoon\n" +"> 2012-11-06,rabbit\n" +"> ...\n" +"> ~~~" + +#: shell-novice/_episodes/04-pipefilter.md:717 +msgid "" +">\n" +"> Assuming your current directory is `data-shell/data/`,\n" +"> what command would you use to produce a table that shows\n" +"> the total count of each type of animal in the file?\n" +">\n" +"> 1. `grep {deer, rabbit, raccoon, deer, fox, bear} animals.txt | wc -l`\n" +"> 2. `sort animals.txt | uniq -c`\n" +"> 3. `sort -t, -k2,2 animals.txt | uniq -c`\n" +"> 4. `cut -d, -f 2 animals.txt | uniq -c`\n" +"> 5. `cut -d, -f 2 animals.txt | sort | uniq -c`\n" +"> 6. `cut -d, -f 2 animals.txt | sort | uniq -c | wc -l`\n" +">\n" +"> > ## Solution\n" +"> > Option 5. is the correct answer.\n" +"> > If you have difficulty understanding why, try running the commands, or sub-sections of\n" +"> > the pipelines (make sure you are in the `data-shell/data` directory)." +msgstr "" +">\n" +"> Assuming your current directory is `data-shell/data/`,\n" +"> what command would you use to produce a table that shows\n" +"> the total count of each type of animal in the file?\n" +">\n" +"> 1. `grep {deer, rabbit, raccoon, deer, fox, bear} animals.txt | wc -l`\n" +"> 2. `sort animals.txt | uniq -c`\n" +"> 3. `sort -t, -k2,2 animals.txt | uniq -c`\n" +"> 4. `cut -d, -f 2 animals.txt | uniq -c`\n" +"> 5. `cut -d, -f 2 animals.txt | sort | uniq -c`\n" +"> 6. `cut -d, -f 2 animals.txt | sort | uniq -c | wc -l`\n" +">\n" +"> > ## Solution\n" +"> > Option 5. is the correct answer.\n" +"> > If you have difficulty understanding why, try running the commands, or sub-sections of\n" +"> > the pipelines (make sure you are in the `data-shell/data` directory)." + +# header +#: shell-novice/_episodes/04-pipefilter.md:736 +msgid "## Nelle's Pipeline: Checking Files" +msgstr "## Nelle's Pipeline: Checking Files" + +#: shell-novice/_episodes/04-pipefilter.md:738 +msgid "" +"Nelle has run her samples through the assay machines\n" +"and created 17 files in the `north-pacific-gyre/2012-07-03` directory described earlier.\n" +"As a quick sanity check, starting from her home directory, Nelle types:" +msgstr "" +"Nelle has run her samples through the assay machines\n" +"and created 17 files in the `north-pacific-gyre/2012-07-03` directory described earlier.\n" +"As a quick sanity check, starting from her home directory, Nelle types:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:742 +msgid "" +"~~~\n" +"$ cd north-pacific-gyre/2012-07-03\n" +"$ wc -l *.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd north-pacific-gyre/2012-07-03\n" +"$ wc -l *.txt\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:748 +msgid "The output is 18 lines that look like this:" +msgstr "The output is 18 lines that look like this:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:750 +msgid "" +"~~~\n" +"300 NENE01729A.txt\n" +"300 NENE01729B.txt\n" +"300 NENE01736A.txt\n" +"300 NENE01751A.txt\n" +"300 NENE01751B.txt\n" +"300 NENE01812A.txt\n" +"... ...\n" +"~~~" +msgstr "" +"~~~\n" +"300 NENE01729A.txt\n" +"300 NENE01729B.txt\n" +"300 NENE01736A.txt\n" +"300 NENE01751A.txt\n" +"300 NENE01751B.txt\n" +"300 NENE01812A.txt\n" +"... ...\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:761 +msgid "Now she types this:" +msgstr "Now she types this:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:763 +msgid "" +"~~~\n" +"$ wc -l *.txt | sort -n | head -n 5\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.txt | sort -n | head -n 5\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:768 +msgid "" +"~~~\n" +" 240 NENE02018B.txt\n" +" 300 NENE01729A.txt\n" +" 300 NENE01729B.txt\n" +" 300 NENE01736A.txt\n" +" 300 NENE01751A.txt\n" +"~~~" +msgstr "" +"~~~\n" +" 240 NENE02018B.txt\n" +" 300 NENE01729A.txt\n" +" 300 NENE01729B.txt\n" +" 300 NENE01736A.txt\n" +" 300 NENE01751A.txt\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:777 +msgid "" +"Whoops: one of the files is 60 lines shorter than the others.\n" +"When she goes back and checks it,\n" +"she sees that she did that assay at 8:00 on a Monday morning --- someone\n" +"was probably in using the machine on the weekend,\n" +"and she forgot to reset it.\n" +"Before re-running that sample,\n" +"she checks to see if any files have too much data:" +msgstr "" +"Whoops: one of the files is 60 lines shorter than the others.\n" +"When she goes back and checks it,\n" +"she sees that she did that assay at 8:00 on a Monday morning --- someone\n" +"was probably in using the machine on the weekend,\n" +"and she forgot to reset it.\n" +"Before re-running that sample,\n" +"she checks to see if any files have too much data:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:785 +msgid "" +"~~~\n" +"$ wc -l *.txt | sort -n | tail -n 5\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l *.txt | sort -n | tail -n 5\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:790 +msgid "" +"~~~\n" +" 300 NENE02040B.txt\n" +" 300 NENE02040Z.txt\n" +" 300 NENE02043A.txt\n" +" 300 NENE02043B.txt\n" +"5040 total\n" +"~~~" +msgstr "" +"~~~\n" +" 300 NENE02040B.txt\n" +" 300 NENE02040Z.txt\n" +" 300 NENE02043A.txt\n" +" 300 NENE02043B.txt\n" +"5040 total\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:799 +msgid "" +"Those numbers look good --- but what's that 'Z' doing there in the third-to-last line?\n" +"All of her samples should be marked 'A' or 'B';\n" +"by convention,\n" +"her lab uses 'Z' to indicate samples with missing information.\n" +"To find others like it, she does this:" +msgstr "" +"Those numbers look good --- but what's that 'Z' doing there in the third-to-last line?\n" +"All of her samples should be marked 'A' or 'B';\n" +"by convention,\n" +"her lab uses 'Z' to indicate samples with missing information.\n" +"To find others like it, she does this:" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:805 +msgid "" +"~~~\n" +"$ ls *Z.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ ls *Z.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/04-pipefilter.md:810 +msgid "" +"~~~\n" +"NENE01971Z.txt NENE02040Z.txt\n" +"~~~" +msgstr "" +"~~~\n" +"NENE01971Z.txt NENE02040Z.txt\n" +"~~~" + +#: shell-novice/_episodes/04-pipefilter.md:815 +msgid "" +"Sure enough,\n" +"when she checks the log on her laptop,\n" +"there's no depth recorded for either of those samples.\n" +"Since it's too late to get the information any other way,\n" +"she must exclude those two files from her analysis.\n" +"She could just delete them using `rm`,\n" +"but there are actually some analyses she might do later where depth doesn't matter,\n" +"so instead, she'll just be careful later on to select files using the wildcard expression `*[AB].txt`.\n" +"As always,\n" +"the `*` matches any number of characters;\n" +"the expression `[AB]` matches either an 'A' or a 'B',\n" +"so this matches all the valid data files she has." +msgstr "" +"Sure enough,\n" +"when she checks the log on her laptop,\n" +"there's no depth recorded for either of those samples.\n" +"Since it's too late to get the information any other way,\n" +"she must exclude those two files from her analysis.\n" +"She could just delete them using `rm`,\n" +"but there are actually some analyses she might do later where depth doesn't matter,\n" +"so instead, she'll just be careful later on to select files using the wildcard expression `*[AB].txt`.\n" +"As always,\n" +"the `*` matches any number of characters;\n" +"the expression `[AB]` matches either an 'A' or a 'B',\n" +"so this matches all the valid data files she has." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:828 +msgid "> ## Wildcard Expressions" +msgstr "> ## Wildcard Expressions" + +#: shell-novice/_episodes/04-pipefilter.md:829 +msgid "" +">\n" +"> Wildcard expressions can be very complex, but you can sometimes write\n" +"> them in ways that only use simple syntax, at the expense of being a bit\n" +"> more verbose. \n" +"> Consider the directory `data-shell/north-pacific-gyre/2012-07-03` :\n" +"> the wildcard expression `*[AB].txt`\n" +"> matches all files ending in `A.txt` or `B.txt`. Imagine you forgot about\n" +"> this.\n" +">\n" +"> 1. Can you match the same set of files with basic wildcard expressions\n" +"> that do not use the `[]` syntax? *Hint*: You may need more than one\n" +"> expression.\n" +">\n" +"> 2. The expression that you found and the expression from the lesson match the\n" +"> same set of files in this example. What is the small difference between the\n" +"> outputs?\n" +">\n" +"> 3. Under what circumstances would your new expression produce an error message\n" +"> where the original one would not?\n" +">\n" +"> > ## Solution\n" +"> > 1. \n" +"> >\n" +"> > \t```\n" +"> > \t$ ls *A.txt\n" +"> > \t$ ls *B.txt\n" +"> > \t```\n" +"> >\t{: .language-bash}\n" +"> > 2. The output from the new commands is separated because there are two commands.\n" +"> > 3. When there are no files ending in `A.txt`, or there are no files ending in\n" +"> > `B.txt`." +msgstr "" +">\n" +"> Wildcard expressions can be very complex, but you can sometimes write\n" +"> them in ways that only use simple syntax, at the expense of being a bit\n" +"> more verbose. \n" +"> Consider the directory `data-shell/north-pacific-gyre/2012-07-03` :\n" +"> the wildcard expression `*[AB].txt`\n" +"> matches all files ending in `A.txt` or `B.txt`. Imagine you forgot about\n" +"> this.\n" +">\n" +"> 1. Can you match the same set of files with basic wildcard expressions\n" +"> that do not use the `[]` syntax? *Hint*: You may need more than one\n" +"> expression.\n" +">\n" +"> 2. The expression that you found and the expression from the lesson match the\n" +"> same set of files in this example. What is the small difference between the\n" +"> outputs?\n" +">\n" +"> 3. Under what circumstances would your new expression produce an error message\n" +"> where the original one would not?\n" +">\n" +"> > ## Solution\n" +"> > 1. \n" +"> >\n" +"> > \t```\n" +"> > \t$ ls *A.txt\n" +"> > \t$ ls *B.txt\n" +"> > \t```\n" +"> >\t{: .language-bash}\n" +"> > 2. The output from the new commands is separated because there are two commands.\n" +"> > 3. When there are no files ending in `A.txt`, or there are no files ending in\n" +"> > `B.txt`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/04-pipefilter.md:863 +msgid "> ## Removing Unneeded Files" +msgstr "> ## Removing Unneeded Files" + +#: shell-novice/_episodes/04-pipefilter.md:864 +msgid "" +">\n" +"> Suppose you want to delete your processed data files, and only keep\n" +"> your raw files and processing script to save storage.\n" +"> The raw files end in `.dat` and the processed files end in `.txt`.\n" +"> Which of the following would remove all the processed data files,\n" +"> and *only* the processed data files?\n" +">\n" +"> 1. `rm ?.txt`\n" +"> 2. `rm *.txt`\n" +"> 3. `rm * .txt`\n" +"> 4. `rm *.*`\n" +">\n" +"> > ## Solution\n" +"> > 1. This would remove `.txt` files with one-character names\n" +"> > 2. This is correct answer\n" +"> > 3. The shell would expand `*` to match everything in the current directory,\n" +"> > so the command would try to remove all matched files and an additional\n" +"> > file called `.txt`\n" +"> > 4. The shell would expand `*.*` to match all files with any extension,\n" +"> > so this command would delete all files" +msgstr "" +">\n" +"> Suppose you want to delete your processed data files, and only keep\n" +"> your raw files and processing script to save storage.\n" +"> The raw files end in `.dat` and the processed files end in `.txt`.\n" +"> Which of the following would remove all the processed data files,\n" +"> and *only* the processed data files?\n" +">\n" +"> 1. `rm ?.txt`\n" +"> 2. `rm *.txt`\n" +"> 3. `rm * .txt`\n" +"> 4. `rm *.*`\n" +">\n" +"> > ## Solution\n" +"> > 1. This would remove `.txt` files with one-character names\n" +"> > 2. This is correct answer\n" +"> > 3. The shell would expand `*` to match everything in the current directory,\n" +"> > so the command would try to remove all matched files and an additional\n" +"> > file called `.txt`\n" +"> > 4. The shell would expand `*.*` to match all files with any extension,\n" +"> > so this command would delete all files" + +# Front Matter +#: shell-novice/_episodes/05-loop.md:1 +msgid "" +"---\n" +"title: \"Loops\"\n" +"teaching: 40\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I perform the same actions on many different files?\"\n" +"objectives:\n" +"- \"Write a loop that applies one or more commands separately to each file in a set of files.\"\n" +"- \"Trace the values taken on by a loop variable during execution of the loop.\"\n" +"- \"Explain the difference between a variable's name and its value.\"\n" +"- \"Explain why spaces and some punctuation characters shouldn't be used in file names.\"\n" +"- \"Demonstrate how to see what commands have recently been executed.\"\n" +"- \"Re-run recently executed commands without retyping them.\"\n" +"keypoints:\n" +"- \"A `for` loop repeats commands once for every thing in a list.\"\n" +"- \"Every `for` loop needs a variable to refer to the thing it is currently operating on.\"\n" +"- \"Use `$name` to expand a variable (i.e., get its value). `${name}` can also be used.\"\n" +"- \"Do not use spaces, quotes, or wildcard characters such as '*' or '?' in filenames, as it complicates variable expansion.\"\n" +"- \"Give files consistent names that are easy to match with wildcard patterns to make it easy to select them for looping.\"\n" +"- \"Use the up-arrow key to scroll up through previous commands to edit and repeat them.\"\n" +"- \"Use `Ctrl-R` to search through the previously entered commands.\"\n" +"- \"Use `history` to display recent commands, and `!number` to repeat a command by number.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Loops\"\n" +"teaching: 40\n" +"exercises: 10\n" +"questions:\n" +"- \"How can I perform the same actions on many different files?\"\n" +"objectives:\n" +"- \"Write a loop that applies one or more commands separately to each file in a set of files.\"\n" +"- \"Trace the values taken on by a loop variable during execution of the loop.\"\n" +"- \"Explain the difference between a variable's name and its value.\"\n" +"- \"Explain why spaces and some punctuation characters shouldn't be used in file names.\"\n" +"- \"Demonstrate how to see what commands have recently been executed.\"\n" +"- \"Re-run recently executed commands without retyping them.\"\n" +"keypoints:\n" +"- \"A `for` loop repeats commands once for every thing in a list.\"\n" +"- \"Every `for` loop needs a variable to refer to the thing it is currently operating on.\"\n" +"- \"Use `$name` to expand a variable (i.e., get its value). `${name}` can also be used.\"\n" +"- \"Do not use spaces, quotes, or wildcard characters such as '*' or '?' in filenames, as it complicates variable expansion.\"\n" +"- \"Give files consistent names that are easy to match with wildcard patterns to make it easy to select them for looping.\"\n" +"- \"Use the up-arrow key to scroll up through previous commands to edit and repeat them.\"\n" +"- \"Use `Ctrl-R` to search through the previously entered commands.\"\n" +"- \"Use `history` to display recent commands, and `!number` to repeat a command by number.\"\n" +"---" + +#: shell-novice/_episodes/05-loop.md:25 +msgid "" +"**Loops** are key to productivity improvements through automation as they allow us to execute\n" +"commands repetitively. Similar to wildcards and tab completion, using loops also reduces the\n" +"amount of typing (and typing mistakes).\n" +"Suppose we have several hundred genome data files named `basilisk.dat`, `unicorn.dat`, and so on.\n" +"In this example,\n" +"we'll use the `creatures` directory which only has two example files,\n" +"but the principles can be applied to many many more files at once.\n" +"We would like to modify these files, but also save a version of the original files, naming the copies\n" +"`original-basilisk.dat` and `original-unicorn.dat`.\n" +"We can't use:" +msgstr "" +"**Loops** are key to productivity improvements through automation as they allow us to execute\n" +"commands repetitively. Similar to wildcards and tab completion, using loops also reduces the\n" +"amount of typing (and typing mistakes).\n" +"Suppose we have several hundred genome data files named `basilisk.dat`, `unicorn.dat`, and so on.\n" +"In this example,\n" +"we'll use the `creatures` directory which only has two example files,\n" +"but the principles can be applied to many many more files at once.\n" +"We would like to modify these files, but also save a version of the original files, naming the copies\n" +"`original-basilisk.dat` and `original-unicorn.dat`.\n" +"We can't use:" + +# code block +#: shell-novice/_episodes/05-loop.md:36 +msgid "" +"~~~\n" +"$ cp *.dat original-*.dat\n" +"~~~" +msgstr "" +"~~~\n" +"$ cp *.dat original-*.dat\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:41 +msgid "because that would expand to:" +msgstr "because that would expand to:" + +# code block +#: shell-novice/_episodes/05-loop.md:43 +msgid "" +"~~~\n" +"$ cp basilisk.dat unicorn.dat original-*.dat\n" +"~~~" +msgstr "" +"~~~\n" +"$ cp basilisk.dat unicorn.dat original-*.dat\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:48 +msgid "This wouldn't back up our files, instead we get an error:" +msgstr "This wouldn't back up our files, instead we get an error:" + +# code block +#: shell-novice/_episodes/05-loop.md:50 +msgid "" +"~~~\n" +"cp: target `original-*.dat' is not a directory\n" +"~~~" +msgstr "" +"~~~\n" +"cp: target `original-*.dat' is not a directory\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:55 +msgid "" +"This problem arises when `cp` receives more than two inputs. When this happens, it\n" +"expects the last input to be a directory where it can copy all the files it was passed.\n" +"Since there is no directory named `original-*.dat` in the `creatures` directory we get an\n" +"error." +msgstr "" +"This problem arises when `cp` receives more than two inputs. When this happens, it\n" +"expects the last input to be a directory where it can copy all the files it was passed.\n" +"Since there is no directory named `original-*.dat` in the `creatures` directory we get an\n" +"error." + +#: shell-novice/_episodes/05-loop.md:60 +msgid "" +"Instead, we can use a **loop**\n" +"to do some operation once for each thing in a list.\n" +"Here's a simple example that displays the first three lines of each file in turn:" +msgstr "" +"Instead, we can use a **loop**\n" +"to do some operation once for each thing in a list.\n" +"Here's a simple example that displays the first three lines of each file in turn:" + +# code block +#: shell-novice/_episodes/05-loop.md:64 +msgid "" +"~~~\n" +"$ for filename in basilisk.dat unicorn.dat\n" +"> do\n" +"> head -n 3 $filename\t# Indentation within the loop aids legibility\n" +"> done\n" +"~~~" +msgstr "" +"~~~\n" +"$ for filename in basilisk.dat unicorn.dat\n" +"> do\n" +"> head -n 3 $filename\t# Indentation within the loop aids legibility\n" +"> done\n" +"~~~" + +# code block +#: shell-novice/_episodes/05-loop.md:72 +msgid "" +"~~~\n" +"COMMON NAME: basilisk\n" +"CLASSIFICATION: basiliscus vulgaris\n" +"UPDATED: 1745-05-02\n" +"COMMON NAME: unicorn\n" +"CLASSIFICATION: equus monoceros\n" +"UPDATED: 1738-11-24\n" +"~~~" +msgstr "" +"~~~\n" +"COMMON NAME: basilisk\n" +"CLASSIFICATION: basiliscus vulgaris\n" +"UPDATED: 1745-05-02\n" +"COMMON NAME: unicorn\n" +"CLASSIFICATION: equus monoceros\n" +"UPDATED: 1738-11-24\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:82 +msgid "> ## Indentation of code within a for loop" +msgstr "> ## Indentation of code within a for loop" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:83 +msgid "> Note that it is common practice to indent the line(s) of code within a for loop." +msgstr "> Note that it is common practice to indent the line(s) of code within a for loop." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:84 +msgid "> The only purpose is to make the code easier to read -- it is not required for the loop to run." +msgstr "> The only purpose is to make the code easier to read -- it is not required for the loop to run." + +#: shell-novice/_episodes/05-loop.md:87 +msgid "" +"When the shell sees the keyword `for`,\n" +"it knows to repeat a command (or group of commands) once for each item in a list.\n" +"Each time the loop runs (called an iteration), an item in the list is assigned in sequence to\n" +"the **variable**, and the commands inside the loop are executed, before moving on to \n" +"the next item in the list.\n" +"Inside the loop,\n" +"we call for the variable's value by putting `$` in front of it.\n" +"The `$` tells the shell interpreter to treat\n" +"the **variable** as a variable name and substitute its value in its place,\n" +"rather than treat it as text or an external command. " +msgstr "" +"When the shell sees the keyword `for`,\n" +"it knows to repeat a command (or group of commands) once for each item in a list.\n" +"Each time the loop runs (called an iteration), an item in the list is assigned in sequence to\n" +"the **variable**, and the commands inside the loop are executed, before moving on to \n" +"the next item in the list.\n" +"Inside the loop,\n" +"we call for the variable's value by putting `$` in front of it.\n" +"The `$` tells the shell interpreter to treat\n" +"the **variable** as a variable name and substitute its value in its place,\n" +"rather than treat it as text or an external command. " + +#: shell-novice/_episodes/05-loop.md:98 +msgid "" +"In this example, the list is two filenames: `basilisk.dat` and `unicorn.dat`.\n" +"Each time the loop iterates, it will assign a file name to the variable `filename`\n" +"and run the `head` command.\n" +"The first time through the loop,\n" +"`$filename` is `basilisk.dat`. \n" +"The interpreter runs the command `head` on `basilisk.dat`, \n" +"and the prints the \n" +"first three lines of `basilisk.dat`.\n" +"For the second iteration, `$filename` becomes \n" +"`unicorn.dat`. This time, the shell runs `head` on `unicorn.dat`\n" +"and prints the first three lines of `unicorn.dat`. \n" +"Since the list was only two items, the shell exits the `for` loop." +msgstr "" +"In this example, the list is two filenames: `basilisk.dat` and `unicorn.dat`.\n" +"Each time the loop iterates, it will assign a file name to the variable `filename`\n" +"and run the `head` command.\n" +"The first time through the loop,\n" +"`$filename` is `basilisk.dat`. \n" +"The interpreter runs the command `head` on `basilisk.dat`, \n" +"and the prints the \n" +"first three lines of `basilisk.dat`.\n" +"For the second iteration, `$filename` becomes \n" +"`unicorn.dat`. This time, the shell runs `head` on `unicorn.dat`\n" +"and prints the first three lines of `unicorn.dat`. \n" +"Since the list was only two items, the shell exits the `for` loop." + +#: shell-novice/_episodes/05-loop.md:111 +msgid "" +"When using variables it is also\n" +"possible to put the names into curly braces to clearly delimit the variable\n" +"name: `$filename` is equivalent to `${filename}`, but is different from\n" +"`${file}name`. You may find this notation in other people's programs." +msgstr "" +"When using variables it is also\n" +"possible to put the names into curly braces to clearly delimit the variable\n" +"name: `$filename` is equivalent to `${filename}`, but is different from\n" +"`${file}name`. You may find this notation in other people's programs." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:116 +msgid "> ## Variables in Loops" +msgstr "> ## Variables in Loops" + +#: shell-novice/_episodes/05-loop.md:117 +msgid "" +">\n" +"> This exercise refers to the `data-shell/molecules` directory.\n" +"> `ls` gives the following output:\n" +">\n" +"> ~~~\n" +"> cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> ~~~" +msgstr "" +">\n" +"> This exercise refers to the `data-shell/molecules` directory.\n" +"> `ls` gives the following output:\n" +">\n" +"> ~~~\n" +"> cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> ~~~" + +#: shell-novice/_episodes/05-loop.md:125 +msgid "" +">\n" +"> What is the output of the following code?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +"> ls *.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Now, what is the output of the following code?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +">\tls $datafile\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Why do these two loops give different outputs?\n" +">\n" +"> > ## Solution\n" +"> > The first code block gives the same output on each iteration through\n" +"> > the loop.\n" +"> > Bash expands the wildcard `*.pdb` within the loop body (as well as\n" +"> > before the loop starts) to match all files ending in `.pdb`\n" +"> > and then lists them using `ls`.\n" +"> > The expanded loop would look like this:\n" +"> > ```\n" +"> > for datafile in cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > do\n" +"> >\tls cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > done\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> >\n" +"> > ```\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > ```\n" +"> > {: .output}\n" +"> >\n" +"> > The second code block lists a different file on each loop iteration.\n" +"> > The value of the `datafile` variable is evaluated using `$datafile`,\n" +"> > and then listed using `ls`.\n" +"> >\n" +"> > ```\n" +"> > cubane.pdb\n" +"> > ethane.pdb\n" +"> > methane.pdb\n" +"> > octane.pdb\n" +"> > pentane.pdb\n" +"> > propane.pdb\n" +"> > ```\n" +"> > {: .output}" +msgstr "" +">\n" +"> What is the output of the following code?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +"> ls *.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Now, what is the output of the following code?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +">\tls $datafile\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Why do these two loops give different outputs?\n" +">\n" +"> > ## Solution\n" +"> > The first code block gives the same output on each iteration through\n" +"> > the loop.\n" +"> > Bash expands the wildcard `*.pdb` within the loop body (as well as\n" +"> > before the loop starts) to match all files ending in `.pdb`\n" +"> > and then lists them using `ls`.\n" +"> > The expanded loop would look like this:\n" +"> > ```\n" +"> > for datafile in cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > do\n" +"> >\tls cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > done\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> >\n" +"> > ```\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > ```\n" +"> > {: .output}\n" +"> >\n" +"> > The second code block lists a different file on each loop iteration.\n" +"> > The value of the `datafile` variable is evaluated using `$datafile`,\n" +"> > and then listed using `ls`.\n" +"> >\n" +"> > ```\n" +"> > cubane.pdb\n" +"> > ethane.pdb\n" +"> > methane.pdb\n" +"> > octane.pdb\n" +"> > pentane.pdb\n" +"> > propane.pdb\n" +"> > ```\n" +"> > {: .output}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:189 +msgid "> ## Follow the Prompt" +msgstr "> ## Follow the Prompt" + +#: shell-novice/_episodes/05-loop.md:190 +msgid "" +">\n" +"> The shell prompt changes from `$` to `>` and back again as we were\n" +"> typing in our loop. The second prompt, `>`, is different to remind\n" +"> us that we haven't finished typing a complete command yet. A semicolon, `;`,\n" +"> can be used to separate two commands written on a single line." +msgstr "" +">\n" +"> The shell prompt changes from `$` to `>` and back again as we were\n" +"> typing in our loop. The second prompt, `>`, is different to remind\n" +"> us that we haven't finished typing a complete command yet. A semicolon, `;`,\n" +"> can be used to separate two commands written on a single line." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:197 +msgid "> ## Same Symbols, Different Meanings" +msgstr "> ## Same Symbols, Different Meanings" + +#: shell-novice/_episodes/05-loop.md:198 +msgid "" +">\n" +"> Here we see `>` being used a shell prompt, whereas `>` is also\n" +"> used to redirect output.\n" +"> Similarly, `$` is used as a shell prompt, but, as we saw earlier,\n" +"> it is also used to ask the shell to get the value of a variable.\n" +">\n" +"> If the *shell* prints `>` or `$` then it expects you to type something,\n" +"> and the symbol is a prompt.\n" +">\n" +"> If *you* type `>` or `$` yourself, it is an instruction from you that\n" +"> the shell to redirect output or get the value of a variable." +msgstr "" +">\n" +"> Here we see `>` being used a shell prompt, whereas `>` is also\n" +"> used to redirect output.\n" +"> Similarly, `$` is used as a shell prompt, but, as we saw earlier,\n" +"> it is also used to ask the shell to get the value of a variable.\n" +">\n" +"> If the *shell* prints `>` or `$` then it expects you to type something,\n" +"> and the symbol is a prompt.\n" +">\n" +"> If *you* type `>` or `$` yourself, it is an instruction from you that\n" +"> the shell to redirect output or get the value of a variable." + +#: shell-novice/_episodes/05-loop.md:211 +msgid "" +"Returning to our example in the `data-shell/creatures` directory,\n" +"we have called the variable in this loop `filename`\n" +"in order to make its purpose clearer to human readers.\n" +"The shell itself doesn't care what the variable is called;\n" +"if we wrote this loop as:" +msgstr "" +"Returning to our example in the `data-shell/creatures` directory,\n" +"we have called the variable in this loop `filename`\n" +"in order to make its purpose clearer to human readers.\n" +"The shell itself doesn't care what the variable is called;\n" +"if we wrote this loop as:" + +# code block +#: shell-novice/_episodes/05-loop.md:217 +msgid "" +"~~~\n" +"for x in basilisk.dat unicorn.dat\n" +"do\n" +" head -n 3 $x\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"for x in basilisk.dat unicorn.dat\n" +"do\n" +" head -n 3 $x\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:225 +msgid "or:" +msgstr "or:" + +# code block +#: shell-novice/_episodes/05-loop.md:227 +msgid "" +"~~~\n" +"for temperature in basilisk.dat unicorn.dat\n" +"do\n" +" head -n 3 $temperature\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"for temperature in basilisk.dat unicorn.dat\n" +"do\n" +" head -n 3 $temperature\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:235 +msgid "" +"it would work exactly the same way.\n" +"*Don't do this.*\n" +"Programs are only useful if people can understand them,\n" +"so meaningless names (like `x`) or misleading names (like `temperature`)\n" +"increase the odds that the program won't do what its readers think it does." +msgstr "" +"it would work exactly the same way.\n" +"*Don't do this.*\n" +"Programs are only useful if people can understand them,\n" +"so meaningless names (like `x`) or misleading names (like `temperature`)\n" +"increase the odds that the program won't do what its readers think it does." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:241 +msgid "> ## Limiting Sets of Files" +msgstr "> ## Limiting Sets of Files" + +#: shell-novice/_episodes/05-loop.md:242 +msgid "" +">\n" +"> What would be the output of running the following loop in the `data-shell/molecules` directory?\n" +">\n" +"> ~~~\n" +"> for filename in c*\n" +"> do\n" +"> ls $filename \n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. No files are listed.\n" +"> 2. All files are listed.\n" +"> 3. Only `cubane.pdb`, `octane.pdb` and `pentane.pdb` are listed.\n" +"> 4. Only `cubane.pdb` is listed.\n" +">\n" +"> > ## Solution\n" +"> > 4 is the correct answer. `*` matches zero or more characters, so any file name starting with \n" +"> > the letter c, followed by zero or more other characters will be matched." +msgstr "" +">\n" +"> What would be the output of running the following loop in the `data-shell/molecules` directory?\n" +">\n" +"> ~~~\n" +"> for filename in c*\n" +"> do\n" +"> ls $filename \n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. No files are listed.\n" +"> 2. All files are listed.\n" +"> 3. Only `cubane.pdb`, `octane.pdb` and `pentane.pdb` are listed.\n" +"> 4. Only `cubane.pdb` is listed.\n" +">\n" +"> > ## Solution\n" +"> > 4 is the correct answer. `*` matches zero or more characters, so any file name starting with \n" +"> > the letter c, followed by zero or more other characters will be matched." + +#: shell-novice/_episodes/05-loop.md:262 +msgid "" +">\n" +"> How would the output differ from using this command instead?\n" +">\n" +"> ~~~\n" +"> for filename in *c*\n" +"> do\n" +"> ls $filename \n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. The same files would be listed.\n" +"> 2. All the files are listed this time.\n" +"> 3. No files are listed this time.\n" +"> 4. The files `cubane.pdb` and `octane.pdb` will be listed.\n" +"> 5. Only the file `octane.pdb` will be listed.\n" +">\n" +"> > ## Solution\n" +"> > 4 is the correct answer. `*` matches zero or more characters, so a file name with zero or more\n" +"> > characters before a letter c and zero or more characters after the letter c will be matched." +msgstr "" +">\n" +"> How would the output differ from using this command instead?\n" +">\n" +"> ~~~\n" +"> for filename in *c*\n" +"> do\n" +"> ls $filename \n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. The same files would be listed.\n" +"> 2. All the files are listed this time.\n" +"> 3. No files are listed this time.\n" +"> 4. The files `cubane.pdb` and `octane.pdb` will be listed.\n" +"> 5. Only the file `octane.pdb` will be listed.\n" +">\n" +"> > ## Solution\n" +"> > 4 is the correct answer. `*` matches zero or more characters, so a file name with zero or more\n" +"> > characters before a letter c and zero or more characters after the letter c will be matched." + +#: shell-novice/_episodes/05-loop.md:285 +msgid "" +"Let's continue with our example in the `data-shell/creatures` directory.\n" +"Here's a slightly more complicated loop:" +msgstr "" +"Let's continue with our example in the `data-shell/creatures` directory.\n" +"Here's a slightly more complicated loop:" + +# code block +#: shell-novice/_episodes/05-loop.md:288 +msgid "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" echo $filename\n" +" head -n 100 $filename | tail -n 20\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" echo $filename\n" +" head -n 100 $filename | tail -n 20\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:297 +msgid "" +"The shell starts by expanding `*.dat` to create the list of files it will process.\n" +"The **loop body**\n" +"then executes two commands for each of those files.\n" +"The first, `echo`, just prints its command-line arguments to standard output.\n" +"For example:" +msgstr "" +"The shell starts by expanding `*.dat` to create the list of files it will process.\n" +"The **loop body**\n" +"then executes two commands for each of those files.\n" +"The first, `echo`, just prints its command-line arguments to standard output.\n" +"For example:" + +# code block +#: shell-novice/_episodes/05-loop.md:303 +msgid "" +"~~~\n" +"$ echo hello there\n" +"~~~" +msgstr "" +"~~~\n" +"$ echo hello there\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:308 +msgid "prints:" +msgstr "prints:" + +# code block +#: shell-novice/_episodes/05-loop.md:310 +msgid "" +"~~~\n" +"hello there\n" +"~~~" +msgstr "" +"~~~\n" +"hello there\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:315 +msgid "" +"In this case,\n" +"since the shell expands `$filename` to be the name of a file,\n" +"`echo $filename` just prints the name of the file.\n" +"Note that we can't write this as:" +msgstr "" +"In this case,\n" +"since the shell expands `$filename` to be the name of a file,\n" +"`echo $filename` just prints the name of the file.\n" +"Note that we can't write this as:" + +# code block +#: shell-novice/_episodes/05-loop.md:320 +msgid "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" $filename\n" +" head -n 100 $filename | tail -n 20\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" $filename\n" +" head -n 100 $filename | tail -n 20\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:329 +msgid "" +"because then the first time through the loop,\n" +"when `$filename` expanded to `basilisk.dat`, the shell would try to run `basilisk.dat` as a program.\n" +"Finally,\n" +"the `head` and `tail` combination selects lines 81-100\n" +"from whatever file is being processed\n" +"(assuming the file has at least 100 lines)." +msgstr "" +"because then the first time through the loop,\n" +"when `$filename` expanded to `basilisk.dat`, the shell would try to run `basilisk.dat` as a program.\n" +"Finally,\n" +"the `head` and `tail` combination selects lines 81-100\n" +"from whatever file is being processed\n" +"(assuming the file has at least 100 lines)." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:336 +msgid "> ## Spaces in Names" +msgstr "> ## Spaces in Names" + +#: shell-novice/_episodes/05-loop.md:337 +msgid "" +">\n" +"> Whitespace is used to separate the elements on the list\n" +"> that we are going to loop over. If on the list we have elements\n" +"> with whitespace we need to quote those elements\n" +"> and our variable when using it.\n" +"> Suppose our data files are named:\n" +">\n" +"> ~~~\n" +"> red dragon.dat\n" +"> purple unicorn.dat\n" +"> ~~~" +msgstr "" +">\n" +"> Whitespace is used to separate the elements on the list\n" +"> that we are going to loop over. If on the list we have elements\n" +"> with whitespace we need to quote those elements\n" +"> and our variable when using it.\n" +"> Suppose our data files are named:\n" +">\n" +"> ~~~\n" +"> red dragon.dat\n" +"> purple unicorn.dat\n" +"> ~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:350 +msgid "> We need to use" +msgstr "> We need to use" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:353 +msgid "> for filename in \"red dragon.dat\" \"purple unicorn.dat\"" +msgstr "> for filename in \"red dragon.dat\" \"purple unicorn.dat\"" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:354 +msgid "> do" +msgstr "> do" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:355 +msgid "> head -n 100 \"$filename\" | tail -n 3" +msgstr "> head -n 100 \"$filename\" | tail -n 3" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:356 +msgid "> done" +msgstr "> done" + +#: shell-novice/_episodes/05-loop.md:359 +msgid "" +">\n" +"> It is simpler just to avoid using whitespaces (or other special characters) in filenames.\n" +">\n" +"> The files above don't exist, so if we run the above code, the `head` command will be unable\n" +"> to find them, however the error message returned will show the name of the files it is\n" +"> expecting:\n" +"> ```\n" +"> head: cannot open ‘red dragon.dat’ for reading: No such file or directory\n" +"> head: cannot open ‘purple unicorn.dat’ for reading: No such file or directory\n" +"> ```" +msgstr "" +">\n" +"> It is simpler just to avoid using whitespaces (or other special characters) in filenames.\n" +">\n" +"> The files above don't exist, so if we run the above code, the `head` command will be unable\n" +"> to find them, however the error message returned will show the name of the files it is\n" +"> expecting:\n" +"> ```\n" +"> head: cannot open ‘red dragon.dat’ for reading: No such file or directory\n" +"> head: cannot open ‘purple unicorn.dat’ for reading: No such file or directory\n" +"> ```" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:370 +msgid "> Try removing the quotes around `$filename` in the loop above to see the effect of the quote" +msgstr "> Try removing the quotes around `$filename` in the loop above to see the effect of the quote" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:371 +msgid "> marks on whitespace. Note that we get a result from the loop command for unicorn.dat when we run this code in the `creatures` directory:" +msgstr "> marks on whitespace. Note that we get a result from the loop command for unicorn.dat when we run this code in the `creatures` directory:" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:372 shell-novice/_episodes/05-loop.md:379 +msgid "> ```" +msgstr "> ```" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:373 +msgid "> head: cannot open ‘red’ for reading: No such file or directory" +msgstr "> head: cannot open ‘red’ for reading: No such file or directory" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:374 +msgid "> head: cannot open ‘dragon.dat’ for reading: No such file or directory" +msgstr "> head: cannot open ‘dragon.dat’ for reading: No such file or directory" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:375 +msgid "> head: cannot open ‘purple’ for reading: No such file or directory" +msgstr "> head: cannot open ‘purple’ for reading: No such file or directory" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:376 +msgid "> CGGTACCGAA" +msgstr "> CGGTACCGAA" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:377 +msgid "> AAGGGTCGCG" +msgstr "> AAGGGTCGCG" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:378 +msgid "> CAAGTGTTCC" +msgstr "> CAAGTGTTCC" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:380 +msgid "> {: . output}" +msgstr "> {: . output}" + +#: shell-novice/_episodes/05-loop.md:383 +msgid "" +"Going back to our original file copying problem,\n" +"we can solve it using this loop:" +msgstr "" +"Going back to our original file copying problem,\n" +"we can solve it using this loop:" + +# code block +#: shell-novice/_episodes/05-loop.md:386 +msgid "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" cp $filename original-$filename\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"for filename in *.dat\n" +"do\n" +" cp $filename original-$filename\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:394 +msgid "" +"This loop runs the `cp` command once for each filename.\n" +"The first time,\n" +"when `$filename` expands to `basilisk.dat`,\n" +"the shell executes:" +msgstr "" +"This loop runs the `cp` command once for each filename.\n" +"The first time,\n" +"when `$filename` expands to `basilisk.dat`,\n" +"the shell executes:" + +# code block +#: shell-novice/_episodes/05-loop.md:399 +msgid "" +"~~~\n" +"cp basilisk.dat original-basilisk.dat\n" +"~~~" +msgstr "" +"~~~\n" +"cp basilisk.dat original-basilisk.dat\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:404 +msgid "The second time, the command is:" +msgstr "The second time, the command is:" + +# code block +#: shell-novice/_episodes/05-loop.md:406 +msgid "" +"~~~\n" +"cp unicorn.dat original-unicorn.dat\n" +"~~~" +msgstr "" +"~~~\n" +"cp unicorn.dat original-unicorn.dat\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:411 +msgid "" +"Since the `cp` command does not normally produce any output, it's hard to check \n" +"that the loop is doing the correct thing. By prefixing the command with `echo` \n" +"it is possible to see each command as it _would_ be executed. The following diagram \n" +"shows what happens when the modified script is executed, and demonstrates how the \n" +"judicious use of `echo` is a good debugging technique." +msgstr "" +"Since the `cp` command does not normally produce any output, it's hard to check \n" +"that the loop is doing the correct thing. By prefixing the command with `echo` \n" +"it is possible to see each command as it _would_ be executed. The following diagram \n" +"shows what happens when the modified script is executed, and demonstrates how the \n" +"judicious use of `echo` is a good debugging technique." + +#: shell-novice/_episodes/05-loop.md:417 +msgid "![For Loop in Action](../fig/shell_script_for_loop_flow_chart.svg)" +msgstr "![For Loop in Action](../fig/shell_script_for_loop_flow_chart.svg)" + +# header +#: shell-novice/_episodes/05-loop.md:419 +msgid "## Nelle's Pipeline: Processing Files" +msgstr "## Nelle's Pipeline: Processing Files" + +#: shell-novice/_episodes/05-loop.md:421 +msgid "" +"Nelle is now ready to process her data files using `goostats` --- a shell script written by her supervisor.\n" +"This calculates some statistics from a protein sample file, and takes two arguments:" +msgstr "" +"Nelle is now ready to process her data files using `goostats` --- a shell script written by her supervisor.\n" +"This calculates some statistics from a protein sample file, and takes two arguments:" + +# ordered list +#: shell-novice/_episodes/05-loop.md:424 +msgid "1. an input file (containing the raw data)" +msgstr "1. an input file (containing the raw data)" + +# ordered list +#: shell-novice/_episodes/05-loop.md:425 +msgid "2. an output file (to store the calculated statistics)" +msgstr "2. an output file (to store the calculated statistics)" + +#: shell-novice/_episodes/05-loop.md:427 +msgid "" +"Since she's still learning how to use the shell,\n" +"she decides to build up the required commands in stages.\n" +"Her first step is to make sure that she can select the right input files --- remember,\n" +"these are ones whose names end in 'A' or 'B', rather than 'Z'. Starting from her home directory, Nelle types:" +msgstr "" +"Since she's still learning how to use the shell,\n" +"she decides to build up the required commands in stages.\n" +"Her first step is to make sure that she can select the right input files --- remember,\n" +"these are ones whose names end in 'A' or 'B', rather than 'Z'. Starting from her home directory, Nelle types:" + +# code block +#: shell-novice/_episodes/05-loop.md:432 +msgid "" +"~~~\n" +"$ cd north-pacific-gyre/2012-07-03\n" +"$ for datafile in NENE*[AB].txt\n" +"> do\n" +"> echo $datafile\n" +"> done\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd north-pacific-gyre/2012-07-03\n" +"$ for datafile in NENE*[AB].txt\n" +"> do\n" +"> echo $datafile\n" +"> done\n" +"~~~" + +# code block +#: shell-novice/_episodes/05-loop.md:441 +msgid "" +"~~~\n" +"NENE01729A.txt\n" +"NENE01729B.txt\n" +"NENE01736A.txt\n" +"...\n" +"NENE02043A.txt\n" +"NENE02043B.txt\n" +"~~~" +msgstr "" +"~~~\n" +"NENE01729A.txt\n" +"NENE01729B.txt\n" +"NENE01736A.txt\n" +"...\n" +"NENE02043A.txt\n" +"NENE02043B.txt\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:451 +msgid "" +"Her next step is to decide\n" +"what to call the files that the `goostats` analysis program will create.\n" +"Prefixing each input file's name with \"stats\" seems simple,\n" +"so she modifies her loop to do that:" +msgstr "" +"Her next step is to decide\n" +"what to call the files that the `goostats` analysis program will create.\n" +"Prefixing each input file's name with \"stats\" seems simple,\n" +"so she modifies her loop to do that:" + +# code block +#: shell-novice/_episodes/05-loop.md:456 +msgid "" +"~~~\n" +"$ for datafile in NENE*[AB].txt\n" +"> do\n" +"> echo $datafile stats-$datafile\n" +"> done\n" +"~~~" +msgstr "" +"~~~\n" +"$ for datafile in NENE*[AB].txt\n" +"> do\n" +"> echo $datafile stats-$datafile\n" +"> done\n" +"~~~" + +# code block +#: shell-novice/_episodes/05-loop.md:464 +msgid "" +"~~~\n" +"NENE01729A.txt stats-NENE01729A.txt\n" +"NENE01729B.txt stats-NENE01729B.txt\n" +"NENE01736A.txt stats-NENE01736A.txt\n" +"...\n" +"NENE02043A.txt stats-NENE02043A.txt\n" +"NENE02043B.txt stats-NENE02043B.txt\n" +"~~~" +msgstr "" +"~~~\n" +"NENE01729A.txt stats-NENE01729A.txt\n" +"NENE01729B.txt stats-NENE01729B.txt\n" +"NENE01736A.txt stats-NENE01736A.txt\n" +"...\n" +"NENE02043A.txt stats-NENE02043A.txt\n" +"NENE02043B.txt stats-NENE02043B.txt\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:474 +msgid "" +"She hasn't actually run `goostats` yet,\n" +"but now she's sure she can select the right files and generate the right output filenames." +msgstr "" +"She hasn't actually run `goostats` yet,\n" +"but now she's sure she can select the right files and generate the right output filenames." + +#: shell-novice/_episodes/05-loop.md:477 +msgid "" +"Typing in commands over and over again is becoming tedious,\n" +"though,\n" +"and Nelle is worried about making mistakes,\n" +"so instead of re-entering her loop,\n" +"she presses the up arrow.\n" +"In response,\n" +"the shell redisplays the whole loop on one line\n" +"(using semi-colons to separate the pieces):" +msgstr "" +"Typing in commands over and over again is becoming tedious,\n" +"though,\n" +"and Nelle is worried about making mistakes,\n" +"so instead of re-entering her loop,\n" +"she presses the up arrow.\n" +"In response,\n" +"the shell redisplays the whole loop on one line\n" +"(using semi-colons to separate the pieces):" + +# code block +#: shell-novice/_episodes/05-loop.md:486 +msgid "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do echo $datafile stats-$datafile; done\n" +"~~~" +msgstr "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do echo $datafile stats-$datafile; done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:491 +msgid "" +"Using the left arrow key,\n" +"Nelle backs up and changes the command `echo` to `bash goostats`:" +msgstr "" +"Using the left arrow key,\n" +"Nelle backs up and changes the command `echo` to `bash goostats`:" + +# code block +#: shell-novice/_episodes/05-loop.md:494 +msgid "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do bash goostats $datafile stats-$datafile; done\n" +"~~~" +msgstr "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do bash goostats $datafile stats-$datafile; done\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:499 +msgid "" +"When she presses Enter,\n" +"the shell runs the modified command.\n" +"However, nothing appears to happen --- there is no output.\n" +"After a moment, Nelle realizes that since her script doesn't print anything to the screen any longer,\n" +"she has no idea whether it is running, much less how quickly.\n" +"She kills the running command by typing `Ctrl-C`,\n" +"uses up-arrow to repeat the command,\n" +"and edits it to read:" +msgstr "" +"When she presses Enter,\n" +"the shell runs the modified command.\n" +"However, nothing appears to happen --- there is no output.\n" +"After a moment, Nelle realizes that since her script doesn't print anything to the screen any longer,\n" +"she has no idea whether it is running, much less how quickly.\n" +"She kills the running command by typing `Ctrl-C`,\n" +"uses up-arrow to repeat the command,\n" +"and edits it to read:" + +# code block +#: shell-novice/_episodes/05-loop.md:508 +msgid "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do echo $datafile; bash goostats $datafile stats-$datafile; done\n" +"~~~" +msgstr "" +"~~~\n" +"$ for datafile in NENE*[AB].txt; do echo $datafile; bash goostats $datafile stats-$datafile; done\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:513 +msgid "> ## Beginning and End" +msgstr "> ## Beginning and End" + +#: shell-novice/_episodes/05-loop.md:514 +msgid "" +">\n" +"> We can move to the beginning of a line in the shell by typing `Ctrl-a`\n" +"> and to the end using `Ctrl-e`." +msgstr "" +">\n" +"> We can move to the beginning of a line in the shell by typing `Ctrl-a`\n" +"> and to the end using `Ctrl-e`." + +#: shell-novice/_episodes/05-loop.md:519 +msgid "" +"When she runs her program now,\n" +"it produces one line of output every five seconds or so:" +msgstr "" +"When she runs her program now,\n" +"it produces one line of output every five seconds or so:" + +# code block +#: shell-novice/_episodes/05-loop.md:522 +msgid "" +"~~~\n" +"NENE01729A.txt\n" +"NENE01729B.txt\n" +"NENE01736A.txt\n" +"...\n" +"~~~" +msgstr "" +"~~~\n" +"NENE01729A.txt\n" +"NENE01729B.txt\n" +"NENE01736A.txt\n" +"...\n" +"~~~" + +#: shell-novice/_episodes/05-loop.md:530 +msgid "" +"1518 times 5 seconds,\n" +"divided by 60,\n" +"tells her that her script will take about two hours to run.\n" +"As a final check,\n" +"she opens another terminal window,\n" +"goes into `north-pacific-gyre/2012-07-03`,\n" +"and uses `cat stats-NENE01729B.txt`\n" +"to examine one of the output files.\n" +"It looks good,\n" +"so she decides to get some coffee and catch up on her reading." +msgstr "" +"1518 times 5 seconds,\n" +"divided by 60,\n" +"tells her that her script will take about two hours to run.\n" +"As a final check,\n" +"she opens another terminal window,\n" +"goes into `north-pacific-gyre/2012-07-03`,\n" +"and uses `cat stats-NENE01729B.txt`\n" +"to examine one of the output files.\n" +"It looks good,\n" +"so she decides to get some coffee and catch up on her reading." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:541 +msgid "> ## Those Who Know History Can Choose to Repeat It" +msgstr "> ## Those Who Know History Can Choose to Repeat It" + +#: shell-novice/_episodes/05-loop.md:542 +msgid "" +">\n" +"> Another way to repeat previous work is to use the `history` command to\n" +"> get a list of the last few hundred commands that have been executed, and\n" +"> then to use `!123` (where \"123\" is replaced by the command number) to\n" +"> repeat one of those commands. For example, if Nelle types this:\n" +">\n" +"> ~~~\n" +"> $ history | tail -n 5\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> 456 ls -l NENE0*.txt\n" +"> 457 rm stats-NENE01729B.txt.txt\n" +"> 458 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" +"> 459 ls -l NENE0*.txt\n" +"> 460 history\n" +"> ~~~" +msgstr "" +">\n" +"> Another way to repeat previous work is to use the `history` command to\n" +"> get a list of the last few hundred commands that have been executed, and\n" +"> then to use `!123` (where \"123\" is replaced by the command number) to\n" +"> repeat one of those commands. For example, if Nelle types this:\n" +">\n" +"> ~~~\n" +"> $ history | tail -n 5\n" +"> ~~~\n" +"> {: .language-bash}\n" +"> ~~~\n" +"> 456 ls -l NENE0*.txt\n" +"> 457 rm stats-NENE01729B.txt.txt\n" +"> 458 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" +"> 459 ls -l NENE0*.txt\n" +"> 460 history\n" +"> ~~~" + +#: shell-novice/_episodes/05-loop.md:560 +msgid "" +">\n" +"> then she can re-run `goostats` on `NENE01729B.txt` simply by typing\n" +"> `!458`." +msgstr "" +">\n" +"> then she can re-run `goostats` on `NENE01729B.txt` simply by typing\n" +"> `!458`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:565 +msgid "> ## Other History Commands" +msgstr "> ## Other History Commands" + +#: shell-novice/_episodes/05-loop.md:566 +msgid "" +">\n" +"> There are a number of other shortcut commands for getting at the history.\n" +">\n" +"> - `Ctrl-R` enters a history search mode \"reverse-i-search\" and finds the \n" +"> most recent command in your history that matches the text you enter next.\n" +"> Press `Ctrl-R` one or more additional times to search for earlier matches.\n" +"> - `!!` retrieves the immediately preceding command \n" +"> (you may or may not find this more convenient than using the up-arrow)\n" +"> - `!$` retrieves the last word of the last command.\n" +"> That's useful more often than you might expect: after\n" +"> `bash goostats NENE01729B.txt stats-NENE01729B.txt`, you can type\n" +"> `less !$` to look at the file `stats-NENE01729B.txt`, which is\n" +"> quicker than doing up-arrow and editing the command-line." +msgstr "" +">\n" +"> There are a number of other shortcut commands for getting at the history.\n" +">\n" +"> - `Ctrl-R` enters a history search mode \"reverse-i-search\" and finds the \n" +"> most recent command in your history that matches the text you enter next.\n" +"> Press `Ctrl-R` one or more additional times to search for earlier matches.\n" +"> - `!!` retrieves the immediately preceding command \n" +"> (you may or may not find this more convenient than using the up-arrow)\n" +"> - `!$` retrieves the last word of the last command.\n" +"> That's useful more often than you might expect: after\n" +"> `bash goostats NENE01729B.txt stats-NENE01729B.txt`, you can type\n" +"> `less !$` to look at the file `stats-NENE01729B.txt`, which is\n" +"> quicker than doing up-arrow and editing the command-line." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:581 +msgid "> ## Saving to a File in a Loop - Part One" +msgstr "> ## Saving to a File in a Loop - Part One" + +#: shell-novice/_episodes/05-loop.md:582 +msgid "" +">\n" +"> In the `data-shell/molecules` directory, what is the effect of this loop?\n" +">\n" +"> ~~~\n" +"> for alkanes in *.pdb\n" +"> do\n" +"> echo $alkanes\n" +"> cat $alkanes > alkanes.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb` and `propane.pdb`,\n" +"> and the text from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" +"> 2. Prints `cubane.pdb`, `ethane.pdb`, and `methane.pdb`, and the text from all three files would be\n" +"> concatenated and saved to a file called `alkanes.pdb`.\n" +"> 3. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and `pentane.pdb`, and the text\n" +"> from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" +"> 4. None of the above.\n" +">\n" +"> > ## Solution\n" +"> > 1. The text from each file in turn gets written to the `alkanes.pdb` file.\n" +"> > However, the file gets overwritten on each loop interation, so the final content of `alkanes.pdb`\n" +"> > is the text from the `propane.pdb` file." +msgstr "" +">\n" +"> In the `data-shell/molecules` directory, what is the effect of this loop?\n" +">\n" +"> ~~~\n" +"> for alkanes in *.pdb\n" +"> do\n" +"> echo $alkanes\n" +"> cat $alkanes > alkanes.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb` and `propane.pdb`,\n" +"> and the text from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" +"> 2. Prints `cubane.pdb`, `ethane.pdb`, and `methane.pdb`, and the text from all three files would be\n" +"> concatenated and saved to a file called `alkanes.pdb`.\n" +"> 3. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and `pentane.pdb`, and the text\n" +"> from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" +"> 4. None of the above.\n" +">\n" +"> > ## Solution\n" +"> > 1. The text from each file in turn gets written to the `alkanes.pdb` file.\n" +"> > However, the file gets overwritten on each loop interation, so the final content of `alkanes.pdb`\n" +"> > is the text from the `propane.pdb` file." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:609 +msgid "> ## Saving to a File in a Loop - Part Two" +msgstr "> ## Saving to a File in a Loop - Part Two" + +#: shell-novice/_episodes/05-loop.md:610 +msgid "" +">\n" +"> Also in the `data-shell/molecules` directory, what would be the output of the following loop?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +"> cat $datafile >> all.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and\n" +"> `pentane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" +"> 2. The text from `ethane.pdb` will be saved to a file called `all.pdb`.\n" +"> 3. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" +"> and `propane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" +"> 4. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" +"> and `propane.pdb` would be printed to the screen and saved to a file called `all.pdb`.\n" +">\n" +"> > ## Solution\n" +"> > 3 is the correct answer. `>>` appends to a file, rather than overwriting it with the redirected\n" +"> > output from a command.\n" +"> > Given the output from the `cat` command has been redirected, nothing is printed to the screen." +msgstr "" +">\n" +"> Also in the `data-shell/molecules` directory, what would be the output of the following loop?\n" +">\n" +"> ~~~\n" +"> for datafile in *.pdb\n" +"> do\n" +"> cat $datafile >> all.pdb\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> 1. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and\n" +"> `pentane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" +"> 2. The text from `ethane.pdb` will be saved to a file called `all.pdb`.\n" +"> 3. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" +"> and `propane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" +"> 4. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" +"> and `propane.pdb` would be printed to the screen and saved to a file called `all.pdb`.\n" +">\n" +"> > ## Solution\n" +"> > 3 is the correct answer. `>>` appends to a file, rather than overwriting it with the redirected\n" +"> > output from a command.\n" +"> > Given the output from the `cat` command has been redirected, nothing is printed to the screen." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:636 +msgid "> ## Doing a Dry Run" +msgstr "> ## Doing a Dry Run" + +#: shell-novice/_episodes/05-loop.md:637 +msgid "" +">\n" +"> A loop is a way to do many things at once --- or to make many mistakes at\n" +"> once if it does the wrong thing. One way to check what a loop *would* do\n" +"> is to `echo` the commands it would run instead of actually running them.\n" +"> \n" +"> Suppose we want to preview the commands the following loop will execute\n" +"> without actually running those commands:\n" +">\n" +"> ~~~\n" +"> for file in *.pdb\n" +"> do\n" +"> analyze $file > analyzed-$file\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> What is the difference between the two loops below, and which one would we\n" +"> want to run?\n" +">\n" +"> ~~~\n" +"> # Version 1\n" +"> for file in *.pdb\n" +"> do\n" +"> echo analyze $file > analyzed-$file\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Version 2\n" +"> for file in *.pdb\n" +"> do\n" +"> echo \"analyze $file > analyzed-$file\"\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > The second version is the one we want to run.\n" +"> > This prints to screen everything enclosed in the quote marks, expanding the\n" +"> > loop variable name because we have prefixed it with a dollar sign.\n" +"> >\n" +"> > The first version redirects the output from the command `echo analyze $file` to\n" +"> > a file, `analyzed-$file`. A series of files is generated: `analyzed-cubane.pdb`,\n" +"> > `analyzed-ethane.pdb` etc.\n" +"> > \n" +"> > Try both versions for yourself to see the output! Be sure to open the \n" +"> > `analyzed-*.pdb` files to view their contents." +msgstr "" +">\n" +"> A loop is a way to do many things at once --- or to make many mistakes at\n" +"> once if it does the wrong thing. One way to check what a loop *would* do\n" +"> is to `echo` the commands it would run instead of actually running them.\n" +"> \n" +"> Suppose we want to preview the commands the following loop will execute\n" +"> without actually running those commands:\n" +">\n" +"> ~~~\n" +"> for file in *.pdb\n" +"> do\n" +"> analyze $file > analyzed-$file\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> What is the difference between the two loops below, and which one would we\n" +"> want to run?\n" +">\n" +"> ~~~\n" +"> # Version 1\n" +"> for file in *.pdb\n" +"> do\n" +"> echo analyze $file > analyzed-$file\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Version 2\n" +"> for file in *.pdb\n" +"> do\n" +"> echo \"analyze $file > analyzed-$file\"\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > The second version is the one we want to run.\n" +"> > This prints to screen everything enclosed in the quote marks, expanding the\n" +"> > loop variable name because we have prefixed it with a dollar sign.\n" +"> >\n" +"> > The first version redirects the output from the command `echo analyze $file` to\n" +"> > a file, `analyzed-$file`. A series of files is generated: `analyzed-cubane.pdb`,\n" +"> > `analyzed-ethane.pdb` etc.\n" +"> > \n" +"> > Try both versions for yourself to see the output! Be sure to open the \n" +"> > `analyzed-*.pdb` files to view their contents." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/05-loop.md:688 +msgid "> ## Nested Loops" +msgstr "> ## Nested Loops" + +#: shell-novice/_episodes/05-loop.md:689 +msgid "" +">\n" +"> Suppose we want to set up up a directory structure to organize\n" +"> some experiments measuring reaction rate constants with different compounds\n" +"> *and* different temperatures. What would be the\n" +"> result of the following code:\n" +">\n" +"> ~~~\n" +"> for species in cubane ethane methane\n" +"> do\n" +"> for temperature in 25 30 37 40\n" +"> do\n" +"> mkdir $species-$temperature\n" +"> done\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > We have a nested loop, i.e. contained within another loop, so for each species\n" +"> > in the outer loop, the inner loop (the nested loop) iterates over the list of\n" +"> > temperatures, and creates a new directory for each combination.\n" +"> >\n" +"> > Try running the code for yourself to see which directories are created!" +msgstr "" +">\n" +"> Suppose we want to set up up a directory structure to organize\n" +"> some experiments measuring reaction rate constants with different compounds\n" +"> *and* different temperatures. What would be the\n" +"> result of the following code:\n" +">\n" +"> ~~~\n" +"> for species in cubane ethane methane\n" +"> do\n" +"> for temperature in 25 30 37 40\n" +"> do\n" +"> mkdir $species-$temperature\n" +"> done\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > We have a nested loop, i.e. contained within another loop, so for each species\n" +"> > in the outer loop, the inner loop (the nested loop) iterates over the list of\n" +"> > temperatures, and creates a new directory for each combination.\n" +"> >\n" +"> > Try running the code for yourself to see which directories are created!" + +# Front Matter +#: shell-novice/_episodes/06-script.md:1 +msgid "" +"---\n" +"title: \"Shell Scripts\"\n" +"teaching: 30\n" +"exercises: 15\n" +"questions:\n" +"- \"How can I save and re-use commands?\"\n" +"objectives:\n" +"- \"Write a shell script that runs a command or series of commands for a fixed set of files.\"\n" +"- \"Run a shell script from the command line.\"\n" +"- \"Write a shell script that operates on a set of files defined by the user on the command line.\"\n" +"- \"Create pipelines that include shell scripts you, and others, have written.\"\n" +"keypoints:\n" +"- \"Save commands in files (usually called shell scripts) for re-use.\"\n" +"- \"`bash filename` runs the commands saved in a file.\"\n" +"- \"`$@` refers to all of a shell script's command-line arguments.\"\n" +"- \"`$1`, `$2`, etc., refer to the first command-line argument, the second command-line argument, etc.\"\n" +"- \"Place variables in quotes if the values might have spaces in them.\"\n" +"- \"Letting users decide what files to process is more flexible and more consistent with built-in Unix commands.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Shell Scripts\"\n" +"teaching: 30\n" +"exercises: 15\n" +"questions:\n" +"- \"How can I save and re-use commands?\"\n" +"objectives:\n" +"- \"Write a shell script that runs a command or series of commands for a fixed set of files.\"\n" +"- \"Run a shell script from the command line.\"\n" +"- \"Write a shell script that operates on a set of files defined by the user on the command line.\"\n" +"- \"Create pipelines that include shell scripts you, and others, have written.\"\n" +"keypoints:\n" +"- \"Save commands in files (usually called shell scripts) for re-use.\"\n" +"- \"`bash filename` runs the commands saved in a file.\"\n" +"- \"`$@` refers to all of a shell script's command-line arguments.\"\n" +"- \"`$1`, `$2`, etc., refer to the first command-line argument, the second command-line argument, etc.\"\n" +"- \"Place variables in quotes if the values might have spaces in them.\"\n" +"- \"Letting users decide what files to process is more flexible and more consistent with built-in Unix commands.\"\n" +"---" + +#: shell-novice/_episodes/06-script.md:21 +msgid "" +"We are finally ready to see what makes the shell such a powerful programming environment.\n" +"We are going to take the commands we repeat frequently and save them in files\n" +"so that we can re-run all those operations again later by typing a single command.\n" +"For historical reasons,\n" +"a bunch of commands saved in a file is usually called a **shell script**,\n" +"but make no mistake:\n" +"these are actually small programs." +msgstr "" +"We are finally ready to see what makes the shell such a powerful programming environment.\n" +"We are going to take the commands we repeat frequently and save them in files\n" +"so that we can re-run all those operations again later by typing a single command.\n" +"For historical reasons,\n" +"a bunch of commands saved in a file is usually called a **shell script**,\n" +"but make no mistake:\n" +"these are actually small programs." + +#: shell-novice/_episodes/06-script.md:29 +msgid "" +"Let's start by going back to `molecules/` and creating a new file, `middle.sh` which will\n" +"become our shell script:" +msgstr "" +"Let's start by going back to `molecules/` and creating a new file, `middle.sh` which will\n" +"become our shell script:" + +# code block +#: shell-novice/_episodes/06-script.md:32 +msgid "" +"~~~\n" +"$ cd molecules\n" +"$ nano middle.sh\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd molecules\n" +"$ nano middle.sh\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:38 +msgid "" +"The command `nano middle.sh` opens the file `middle.sh` within the text editor \"nano\"\n" +"(which runs within the shell).\n" +"If the file does not exist, it will be created.\n" +"We can use the text editor to directly edit the file -- we'll simply insert the following line:" +msgstr "" +"The command `nano middle.sh` opens the file `middle.sh` within the text editor \"nano\"\n" +"(which runs within the shell).\n" +"If the file does not exist, it will be created.\n" +"We can use the text editor to directly edit the file -- we'll simply insert the following line:" + +# code block +#: shell-novice/_episodes/06-script.md:43 +msgid "" +"~~~\n" +"head -n 15 octane.pdb | tail -n 5\n" +"~~~" +msgstr "" +"~~~\n" +"head -n 15 octane.pdb | tail -n 5\n" +"~~~" + +# SC/DC Template label +#: shell-novice/_episodes/06-script.md:46 +#: shell-novice/_episodes/06-script.md:362 +msgid "{: .source}" +msgstr "{: .source}" + +#: shell-novice/_episodes/06-script.md:48 +msgid "" +"This is a variation on the pipe we constructed earlier:\n" +"it selects lines 11-15 of the file `octane.pdb`.\n" +"Remember, we are *not* running it as a command just yet:\n" +"we are putting the commands in a file." +msgstr "" +"This is a variation on the pipe we constructed earlier:\n" +"it selects lines 11-15 of the file `octane.pdb`.\n" +"Remember, we are *not* running it as a command just yet:\n" +"we are putting the commands in a file." + +#: shell-novice/_episodes/06-script.md:53 +msgid "" +"Then we save the file (`Ctrl-O` in nano),\n" +" and exit the text editor (`Ctrl-X` in nano).\n" +"Check that the directory `molecules` now contains a file called `middle.sh`." +msgstr "" +"Then we save the file (`Ctrl-O` in nano),\n" +" and exit the text editor (`Ctrl-X` in nano).\n" +"Check that the directory `molecules` now contains a file called `middle.sh`." + +#: shell-novice/_episodes/06-script.md:57 +msgid "" +"Once we have saved the file,\n" +"we can ask the shell to execute the commands it contains.\n" +"Our shell is called `bash`, so we run the following command:" +msgstr "" +"Once we have saved the file,\n" +"we can ask the shell to execute the commands it contains.\n" +"Our shell is called `bash`, so we run the following command:" + +# code block +#: shell-novice/_episodes/06-script.md:61 +msgid "" +"~~~\n" +"$ bash middle.sh\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash middle.sh\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:66 +#: shell-novice/_episodes/06-script.md:117 +msgid "" +"~~~\n" +"ATOM 9 H 1 -4.502 0.681 0.785 1.00 0.00\n" +"ATOM 10 H 1 -5.254 -0.243 -0.537 1.00 0.00\n" +"ATOM 11 H 1 -4.357 1.252 -0.895 1.00 0.00\n" +"ATOM 12 H 1 -3.009 -0.741 -1.467 1.00 0.00\n" +"ATOM 13 H 1 -3.172 -1.337 0.206 1.00 0.00\n" +"~~~" +msgstr "" +"~~~\n" +"ATOM 9 H 1 -4.502 0.681 0.785 1.00 0.00\n" +"ATOM 10 H 1 -5.254 -0.243 -0.537 1.00 0.00\n" +"ATOM 11 H 1 -4.357 1.252 -0.895 1.00 0.00\n" +"ATOM 12 H 1 -3.009 -0.741 -1.467 1.00 0.00\n" +"ATOM 13 H 1 -3.172 -1.337 0.206 1.00 0.00\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:75 +msgid "" +"Sure enough,\n" +"our script's output is exactly what we would get if we ran that pipeline directly." +msgstr "" +"Sure enough,\n" +"our script's output is exactly what we would get if we ran that pipeline directly." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:78 +msgid "> ## Text vs. Whatever" +msgstr "> ## Text vs. Whatever" + +#: shell-novice/_episodes/06-script.md:79 +msgid "" +">\n" +"> We usually call programs like Microsoft Word or LibreOffice Writer \"text\n" +"> editors\", but we need to be a bit more careful when it comes to\n" +"> programming. By default, Microsoft Word uses `.docx` files to store not\n" +"> only text, but also formatting information about fonts, headings, and so\n" +"> on. This extra information isn't stored as characters, and doesn't mean\n" +"> anything to tools like `head`: they expect input files to contain\n" +"> nothing but the letters, digits, and punctuation on a standard computer\n" +"> keyboard. When editing programs, therefore, you must either use a plain\n" +"> text editor, or be careful to save files as plain text." +msgstr "" +">\n" +"> We usually call programs like Microsoft Word or LibreOffice Writer \"text\n" +"> editors\", but we need to be a bit more careful when it comes to\n" +"> programming. By default, Microsoft Word uses `.docx` files to store not\n" +"> only text, but also formatting information about fonts, headings, and so\n" +"> on. This extra information isn't stored as characters, and doesn't mean\n" +"> anything to tools like `head`: they expect input files to contain\n" +"> nothing but the letters, digits, and punctuation on a standard computer\n" +"> keyboard. When editing programs, therefore, you must either use a plain\n" +"> text editor, or be careful to save files as plain text." + +#: shell-novice/_episodes/06-script.md:91 +msgid "" +"What if we want to select lines from an arbitrary file?\n" +"We could edit `middle.sh` each time to change the filename,\n" +"but that would probably take longer than just retyping the command.\n" +"Instead, let's edit `middle.sh` and make it more versatile:" +msgstr "" +"What if we want to select lines from an arbitrary file?\n" +"We could edit `middle.sh` each time to change the filename,\n" +"but that would probably take longer than just retyping the command.\n" +"Instead, let's edit `middle.sh` and make it more versatile:" + +# code block +#: shell-novice/_episodes/06-script.md:96 +#: shell-novice/_episodes/06-script.md:154 +#: shell-novice/_episodes/06-script.md:201 +msgid "" +"~~~\n" +"$ nano middle.sh\n" +"~~~" +msgstr "" +"~~~\n" +"$ nano middle.sh\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:101 +msgid "Now, within \"nano\", replace the text `octane.pdb` with the special variable called `$1`:" +msgstr "Now, within \"nano\", replace the text `octane.pdb` with the special variable called `$1`:" + +# code block +#: shell-novice/_episodes/06-script.md:103 +msgid "" +"~~~\n" +"head -n 15 \"$1\" | tail -n 5\n" +"~~~" +msgstr "" +"~~~\n" +"head -n 15 \"$1\" | tail -n 5\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:108 +msgid "" +"Inside a shell script,\n" +"`$1` means \"the first filename (or other argument) on the command line\".\n" +"We can now run our script like this:" +msgstr "" +"Inside a shell script,\n" +"`$1` means \"the first filename (or other argument) on the command line\".\n" +"We can now run our script like this:" + +# code block +#: shell-novice/_episodes/06-script.md:112 +msgid "" +"~~~\n" +"$ bash middle.sh octane.pdb\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash middle.sh octane.pdb\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:126 +msgid "or on a different file like this:" +msgstr "or on a different file like this:" + +# code block +#: shell-novice/_episodes/06-script.md:128 +msgid "" +"~~~\n" +"$ bash middle.sh pentane.pdb\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash middle.sh pentane.pdb\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:133 +#: shell-novice/_episodes/06-script.md:171 +msgid "" +"~~~\n" +"ATOM 9 H 1 1.324 0.350 -1.332 1.00 0.00\n" +"ATOM 10 H 1 1.271 1.378 0.122 1.00 0.00\n" +"ATOM 11 H 1 -0.074 -0.384 1.288 1.00 0.00\n" +"ATOM 12 H 1 -0.048 -1.362 -0.205 1.00 0.00\n" +"ATOM 13 H 1 -1.183 0.500 -1.412 1.00 0.00\n" +"~~~" +msgstr "" +"~~~\n" +"ATOM 9 H 1 1.324 0.350 -1.332 1.00 0.00\n" +"ATOM 10 H 1 1.271 1.378 0.122 1.00 0.00\n" +"ATOM 11 H 1 -0.074 -0.384 1.288 1.00 0.00\n" +"ATOM 12 H 1 -0.048 -1.362 -0.205 1.00 0.00\n" +"ATOM 13 H 1 -1.183 0.500 -1.412 1.00 0.00\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:142 +msgid "> ## Double-Quotes Around Arguments" +msgstr "> ## Double-Quotes Around Arguments" + +#: shell-novice/_episodes/06-script.md:143 +msgid "" +">\n" +"> For the same reason that we put the loop variable inside double-quotes,\n" +"> in case the filename happens to contain any spaces,\n" +"> we surround `$1` with double-quotes." +msgstr "" +">\n" +"> For the same reason that we put the loop variable inside double-quotes,\n" +"> in case the filename happens to contain any spaces,\n" +"> we surround `$1` with double-quotes." + +#: shell-novice/_episodes/06-script.md:149 +msgid "" +"We still need to edit `middle.sh` each time we want to adjust the range of lines,\n" +"though.\n" +"Let's fix that by using the special variables `$2` and `$3` for the\n" +"number of lines to be passed to `head` and `tail` respectively:" +msgstr "" +"We still need to edit `middle.sh` each time we want to adjust the range of lines,\n" +"though.\n" +"Let's fix that by using the special variables `$2` and `$3` for the\n" +"number of lines to be passed to `head` and `tail` respectively:" + +# code block +#: shell-novice/_episodes/06-script.md:159 +msgid "" +"~~~\n" +"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" +"~~~" +msgstr "" +"~~~\n" +"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:164 +msgid "We can now run:" +msgstr "We can now run:" + +# code block +#: shell-novice/_episodes/06-script.md:166 +msgid "" +"~~~\n" +"$ bash middle.sh pentane.pdb 15 5\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash middle.sh pentane.pdb 15 5\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:180 +msgid "" +"By changing the arguments to our command we can change our script's\n" +"behaviour:" +msgstr "" +"By changing the arguments to our command we can change our script's\n" +"behaviour:" + +# code block +#: shell-novice/_episodes/06-script.md:183 +msgid "" +"~~~\n" +"$ bash middle.sh pentane.pdb 20 5\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash middle.sh pentane.pdb 20 5\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:188 +msgid "" +"~~~\n" +"ATOM 14 H 1 -1.259 1.420 0.112 1.00 0.00\n" +"ATOM 15 H 1 -2.608 -0.407 1.130 1.00 0.00\n" +"ATOM 16 H 1 -2.540 -1.303 -0.404 1.00 0.00\n" +"ATOM 17 H 1 -3.393 0.254 -0.321 1.00 0.00\n" +"TER 18 1\n" +"~~~" +msgstr "" +"~~~\n" +"ATOM 14 H 1 -1.259 1.420 0.112 1.00 0.00\n" +"ATOM 15 H 1 -2.608 -0.407 1.130 1.00 0.00\n" +"ATOM 16 H 1 -2.540 -1.303 -0.404 1.00 0.00\n" +"ATOM 17 H 1 -3.393 0.254 -0.321 1.00 0.00\n" +"TER 18 1\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:197 +msgid "" +"This works,\n" +"but it may take the next person who reads `middle.sh` a moment to figure out what it does.\n" +"We can improve our script by adding some **comments** at the top:" +msgstr "" +"This works,\n" +"but it may take the next person who reads `middle.sh` a moment to figure out what it does.\n" +"We can improve our script by adding some **comments** at the top:" + +# code block +#: shell-novice/_episodes/06-script.md:206 +msgid "" +"~~~\n" +"# Select lines from the middle of a file.\n" +"# Usage: bash middle.sh filename end_line num_lines\n" +"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" +"~~~" +msgstr "" +"~~~\n" +"# Select lines from the middle of a file.\n" +"# Usage: bash middle.sh filename end_line num_lines\n" +"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:213 +msgid "" +"A comment starts with a `#` character and runs to the end of the line.\n" +"The computer ignores comments,\n" +"but they're invaluable for helping people (including your future self) understand and use scripts.\n" +"The only caveat is that each time you modify the script,\n" +"you should check that the comment is still accurate:\n" +"an explanation that sends the reader in the wrong direction is worse than none at all." +msgstr "" +"A comment starts with a `#` character and runs to the end of the line.\n" +"The computer ignores comments,\n" +"but they're invaluable for helping people (including your future self) understand and use scripts.\n" +"The only caveat is that each time you modify the script,\n" +"you should check that the comment is still accurate:\n" +"an explanation that sends the reader in the wrong direction is worse than none at all." + +#: shell-novice/_episodes/06-script.md:220 +msgid "" +"What if we want to process many files in a single pipeline?\n" +"For example, if we want to sort our `.pdb` files by length, we would type:" +msgstr "" +"What if we want to process many files in a single pipeline?\n" +"For example, if we want to sort our `.pdb` files by length, we would type:" + +#: shell-novice/_episodes/06-script.md:228 +msgid "" +"because `wc -l` lists the number of lines in the files\n" +"(recall that `wc` stands for 'word count', adding the `-l` flag means 'count lines' instead)\n" +"and `sort -n` sorts things numerically.\n" +"We could put this in a file,\n" +"but then it would only ever sort a list of `.pdb` files in the current directory.\n" +"If we want to be able to get a sorted list of other kinds of files,\n" +"we need a way to get all those names into the script.\n" +"We can't use `$1`, `$2`, and so on\n" +"because we don't know how many files there are.\n" +"Instead, we use the special variable `$@`,\n" +"which means,\n" +"\"All of the command-line arguments to the shell script.\"\n" +"We also should put `$@` inside double-quotes\n" +"to handle the case of arguments containing spaces\n" +"(`\"$@\"` is equivalent to `\"$1\"` `\"$2\"` ...)\n" +"Here's an example:" +msgstr "" +"because `wc -l` lists the number of lines in the files\n" +"(recall that `wc` stands for 'word count', adding the `-l` flag means 'count lines' instead)\n" +"and `sort -n` sorts things numerically.\n" +"We could put this in a file,\n" +"but then it would only ever sort a list of `.pdb` files in the current directory.\n" +"If we want to be able to get a sorted list of other kinds of files,\n" +"we need a way to get all those names into the script.\n" +"We can't use `$1`, `$2`, and so on\n" +"because we don't know how many files there are.\n" +"Instead, we use the special variable `$@`,\n" +"which means,\n" +"\"All of the command-line arguments to the shell script.\"\n" +"We also should put `$@` inside double-quotes\n" +"to handle the case of arguments containing spaces\n" +"(`\"$@\"` is equivalent to `\"$1\"` `\"$2\"` ...)\n" +"Here's an example:" + +# code block +#: shell-novice/_episodes/06-script.md:245 +msgid "" +"~~~\n" +"$ nano sorted.sh\n" +"~~~" +msgstr "" +"~~~\n" +"$ nano sorted.sh\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:250 +msgid "" +"~~~\n" +"# Sort filenames by their length.\n" +"# Usage: bash sorted.sh one_or_more_filenames\n" +"wc -l \"$@\" | sort -n\n" +"~~~" +msgstr "" +"~~~\n" +"# Sort filenames by their length.\n" +"# Usage: bash sorted.sh one_or_more_filenames\n" +"wc -l \"$@\" | sort -n\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:257 +msgid "" +"~~~\n" +"$ bash sorted.sh *.pdb ../creatures/*.dat\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash sorted.sh *.pdb ../creatures/*.dat\n" +"~~~" + +# code block +#: shell-novice/_episodes/06-script.md:262 +msgid "" +"~~~\n" +"9 methane.pdb\n" +"12 ethane.pdb\n" +"15 propane.pdb\n" +"20 cubane.pdb\n" +"21 pentane.pdb\n" +"30 octane.pdb\n" +"163 ../creatures/basilisk.dat\n" +"163 ../creatures/unicorn.dat\n" +"~~~" +msgstr "" +"~~~\n" +"9 methane.pdb\n" +"12 ethane.pdb\n" +"15 propane.pdb\n" +"20 cubane.pdb\n" +"21 pentane.pdb\n" +"30 octane.pdb\n" +"163 ../creatures/basilisk.dat\n" +"163 ../creatures/unicorn.dat\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:274 +msgid "> ## List Unique Species" +msgstr "> ## List Unique Species" + +#: shell-novice/_episodes/06-script.md:275 +msgid "" +">\n" +"> Leah has several hundred data files, each of which is formatted like this:\n" +">\n" +"> ~~~\n" +"> 2013-11-05,deer,5\n" +"> 2013-11-05,rabbit,22\n" +"> 2013-11-05,raccoon,7\n" +"> 2013-11-06,rabbit,19\n" +"> 2013-11-06,deer,2\n" +"> 2013-11-06,fox,1\n" +"> 2013-11-07,rabbit,18\n" +"> 2013-11-07,bear,1\n" +"> ~~~" +msgstr "" +">\n" +"> Leah has several hundred data files, each of which is formatted like this:\n" +">\n" +"> ~~~\n" +"> 2013-11-05,deer,5\n" +"> 2013-11-05,rabbit,22\n" +"> 2013-11-05,raccoon,7\n" +"> 2013-11-06,rabbit,19\n" +"> 2013-11-06,deer,2\n" +"> 2013-11-06,fox,1\n" +"> 2013-11-07,rabbit,18\n" +"> 2013-11-07,bear,1\n" +"> ~~~" + +#: shell-novice/_episodes/06-script.md:289 +msgid "" +">\n" +"> An example of this type of file is given in `data-shell/data/animal-counts/animals.txt`.\n" +"> \n" +"> Write a shell script called `species.sh` that takes any number of\n" +"> filenames as command-line arguments, and uses `cut`, `sort`, and\n" +"> `uniq` to print a list of the unique species appearing in each of\n" +"> those files separately.\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > # Script to find unique species in csv files where species is the second data field\n" +"> > # This script accepts any number of file names as command line arguments\n" +"> >\n" +"> > # Loop over all files\n" +"> > for file in $@ \n" +"> > do\n" +"> > \techo \"Unique species in $file:\"\n" +"> > \t# Extract species names\n" +"> > \tcut -d , -f 2 $file | sort | uniq\n" +"> > done\n" +"> > ```\n" +"> > {: .source}" +msgstr "" +">\n" +"> An example of this type of file is given in `data-shell/data/animal-counts/animals.txt`.\n" +"> \n" +"> Write a shell script called `species.sh` that takes any number of\n" +"> filenames as command-line arguments, and uses `cut`, `sort`, and\n" +"> `uniq` to print a list of the unique species appearing in each of\n" +"> those files separately.\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > # Script to find unique species in csv files where species is the second data field\n" +"> > # This script accepts any number of file names as command line arguments\n" +"> >\n" +"> > # Loop over all files\n" +"> > for file in $@ \n" +"> > do\n" +"> > \techo \"Unique species in $file:\"\n" +"> > \t# Extract species names\n" +"> > \tcut -d , -f 2 $file | sort | uniq\n" +"> > done\n" +"> > ```\n" +"> > {: .source}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:315 +msgid "> ## Why Isn't It Doing Anything?" +msgstr "> ## Why Isn't It Doing Anything?" + +#: shell-novice/_episodes/06-script.md:316 +msgid "" +">\n" +"> What happens if a script is supposed to process a bunch of files, but we\n" +"> don't give it any filenames? For example, what if we type:\n" +">\n" +"> ~~~\n" +"> $ bash sorted.sh\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> but don't say `*.dat` (or anything else)? In this case, `$@` expands to\n" +"> nothing at all, so the pipeline inside the script is effectively:\n" +">\n" +"> ~~~\n" +"> $ wc -l | sort -n\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Since it doesn't have any filenames, `wc` assumes it is supposed to\n" +"> process standard input, so it just sits there and waits for us to give\n" +"> it some data interactively. From the outside, though, all we see is it\n" +"> sitting there: the script doesn't appear to do anything." +msgstr "" +">\n" +"> What happens if a script is supposed to process a bunch of files, but we\n" +"> don't give it any filenames? For example, what if we type:\n" +">\n" +"> ~~~\n" +"> $ bash sorted.sh\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> but don't say `*.dat` (or anything else)? In this case, `$@` expands to\n" +"> nothing at all, so the pipeline inside the script is effectively:\n" +">\n" +"> ~~~\n" +"> $ wc -l | sort -n\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Since it doesn't have any filenames, `wc` assumes it is supposed to\n" +"> process standard input, so it just sits there and waits for us to give\n" +"> it some data interactively. From the outside, though, all we see is it\n" +"> sitting there: the script doesn't appear to do anything." + +#: shell-novice/_episodes/06-script.md:340 +msgid "" +"Suppose we have just run a series of commands that did something useful --- for example,\n" +"that created a graph we'd like to use in a paper.\n" +"We'd like to be able to re-create the graph later if we need to,\n" +"so we want to save the commands in a file.\n" +"Instead of typing them in again\n" +"(and potentially getting them wrong)\n" +"we can do this:" +msgstr "" +"Suppose we have just run a series of commands that did something useful --- for example,\n" +"that created a graph we'd like to use in a paper.\n" +"We'd like to be able to re-create the graph later if we need to,\n" +"so we want to save the commands in a file.\n" +"Instead of typing them in again\n" +"(and potentially getting them wrong)\n" +"we can do this:" + +# code block +#: shell-novice/_episodes/06-script.md:348 +msgid "" +"~~~\n" +"$ history | tail -n 5 > redo-figure-3.sh\n" +"~~~" +msgstr "" +"~~~\n" +"$ history | tail -n 5 > redo-figure-3.sh\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:353 +msgid "The file `redo-figure-3.sh` now contains:" +msgstr "The file `redo-figure-3.sh` now contains:" + +# code block +#: shell-novice/_episodes/06-script.md:355 +msgid "" +"~~~\n" +"297 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" +"298 bash goodiff stats-NENE01729B.txt /data/validated/01729.txt > 01729-differences.txt\n" +"299 cut -d ',' -f 2-3 01729-differences.txt > 01729-time-series.txt\n" +"300 ygraph --format scatter --color bw --borders none 01729-time-series.txt figure-3.png\n" +"301 history | tail -n 5 > redo-figure-3.sh\n" +"~~~" +msgstr "" +"~~~\n" +"297 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" +"298 bash goodiff stats-NENE01729B.txt /data/validated/01729.txt > 01729-differences.txt\n" +"299 cut -d ',' -f 2-3 01729-differences.txt > 01729-time-series.txt\n" +"300 ygraph --format scatter --color bw --borders none 01729-time-series.txt figure-3.png\n" +"301 history | tail -n 5 > redo-figure-3.sh\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:364 +msgid "" +"After a moment's work in an editor to remove the serial numbers on the commands,\n" +"and to remove the final line where we called the `history` command,\n" +"we have a completely accurate record of how we created that figure." +msgstr "" +"After a moment's work in an editor to remove the serial numbers on the commands,\n" +"and to remove the final line where we called the `history` command,\n" +"we have a completely accurate record of how we created that figure." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:368 +msgid "> ## Why Record Commands in the History Before Running Them?" +msgstr "> ## Why Record Commands in the History Before Running Them?" + +#: shell-novice/_episodes/06-script.md:369 +msgid "" +">\n" +"> If you run the command:\n" +">\n" +"> ~~~\n" +"> $ history | tail -n 5 > recent.sh\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> the last command in the file is the `history` command itself, i.e.,\n" +"> the shell has added `history` to the command log before actually\n" +"> running it. In fact, the shell *always* adds commands to the log\n" +"> before running them. Why do you think it does this?\n" +">\n" +"> > ## Solution\n" +"> > If a command causes something to crash or hang, it might be useful\n" +"> > to know what that command was, in order to investigate the problem.\n" +"> > Were the command only be recorded after running it, we would not\n" +"> > have a record of the last command run in the event of a crash." +msgstr "" +">\n" +"> If you run the command:\n" +">\n" +"> ~~~\n" +"> $ history | tail -n 5 > recent.sh\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> the last command in the file is the `history` command itself, i.e.,\n" +"> the shell has added `history` to the command log before actually\n" +"> running it. In fact, the shell *always* adds commands to the log\n" +"> before running them. Why do you think it does this?\n" +">\n" +"> > ## Solution\n" +"> > If a command causes something to crash or hang, it might be useful\n" +"> > to know what that command was, in order to investigate the problem.\n" +"> > Were the command only be recorded after running it, we would not\n" +"> > have a record of the last command run in the event of a crash." + +#: shell-novice/_episodes/06-script.md:390 +msgid "" +"In practice, most people develop shell scripts by running commands at the shell prompt a few times\n" +"to make sure they're doing the right thing,\n" +"then saving them in a file for re-use.\n" +"This style of work allows people to recycle\n" +"what they discover about their data and their workflow with one call to `history`\n" +"and a bit of editing to clean up the output\n" +"and save it as a shell script." +msgstr "" +"In practice, most people develop shell scripts by running commands at the shell prompt a few times\n" +"to make sure they're doing the right thing,\n" +"then saving them in a file for re-use.\n" +"This style of work allows people to recycle\n" +"what they discover about their data and their workflow with one call to `history`\n" +"and a bit of editing to clean up the output\n" +"and save it as a shell script." + +# header +#: shell-novice/_episodes/06-script.md:398 +msgid "## Nelle's Pipeline: Creating a Script" +msgstr "## Nelle's Pipeline: Creating a Script" + +#: shell-novice/_episodes/06-script.md:400 +msgid "" +"Nelle's supervisor insisted that all her analytics must be reproducible. The easiest way to capture all the steps is in a script.\n" +"She runs the editor and writes the following:" +msgstr "" +"Nelle's supervisor insisted that all her analytics must be reproducible. The easiest way to capture all the steps is in a script.\n" +"She runs the editor and writes the following:" + +# code block +#: shell-novice/_episodes/06-script.md:403 +msgid "" +"~~~\n" +"# Calculate stats for data files.\n" +"for datafile in \"$@\"\n" +"do\n" +" echo $datafile\n" +" bash goostats $datafile stats-$datafile\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"# Calculate stats for data files.\n" +"for datafile in \"$@\"\n" +"do\n" +" echo $datafile\n" +" bash goostats $datafile stats-$datafile\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:413 +msgid "" +"She saves this in a file called `do-stats.sh`\n" +"so that she can now re-do the first stage of her analysis by typing:" +msgstr "" +"She saves this in a file called `do-stats.sh`\n" +"so that she can now re-do the first stage of her analysis by typing:" + +# code block +#: shell-novice/_episodes/06-script.md:416 +msgid "" +"~~~\n" +"$ bash do-stats.sh NENE*[AB].txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash do-stats.sh NENE*[AB].txt\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:421 +msgid "She can also do this:" +msgstr "She can also do this:" + +# code block +#: shell-novice/_episodes/06-script.md:423 +msgid "" +"~~~\n" +"$ bash do-stats.sh NENE*[AB].txt | wc -l\n" +"~~~" +msgstr "" +"~~~\n" +"$ bash do-stats.sh NENE*[AB].txt | wc -l\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:428 +msgid "" +"so that the output is just the number of files processed\n" +"rather than the names of the files that were processed." +msgstr "" +"so that the output is just the number of files processed\n" +"rather than the names of the files that were processed." + +#: shell-novice/_episodes/06-script.md:431 +msgid "" +"One thing to note about Nelle's script is that\n" +"it lets the person running it decide what files to process.\n" +"She could have written it as:" +msgstr "" +"One thing to note about Nelle's script is that\n" +"it lets the person running it decide what files to process.\n" +"She could have written it as:" + +# code block +#: shell-novice/_episodes/06-script.md:435 +msgid "" +"~~~\n" +"# Calculate stats for Site A and Site B data files.\n" +"for datafile in NENE*[AB].txt\n" +"do\n" +" echo $datafile\n" +" bash goostats $datafile stats-$datafile\n" +"done\n" +"~~~" +msgstr "" +"~~~\n" +"# Calculate stats for Site A and Site B data files.\n" +"for datafile in NENE*[AB].txt\n" +"do\n" +" echo $datafile\n" +" bash goostats $datafile stats-$datafile\n" +"done\n" +"~~~" + +#: shell-novice/_episodes/06-script.md:445 +msgid "" +"The advantage is that this always selects the right files:\n" +"she doesn't have to remember to exclude the 'Z' files.\n" +"The disadvantage is that it *always* selects just those files --- she can't run it on all files\n" +"(including the 'Z' files),\n" +"or on the 'G' or 'H' files her colleagues in Antarctica are producing,\n" +"without editing the script.\n" +"If she wanted to be more adventurous,\n" +"she could modify her script to check for command-line arguments,\n" +"and use `NENE*[AB].txt` if none were provided.\n" +"Of course, this introduces another tradeoff between flexibility and complexity." +msgstr "" +"The advantage is that this always selects the right files:\n" +"she doesn't have to remember to exclude the 'Z' files.\n" +"The disadvantage is that it *always* selects just those files --- she can't run it on all files\n" +"(including the 'Z' files),\n" +"or on the 'G' or 'H' files her colleagues in Antarctica are producing,\n" +"without editing the script.\n" +"If she wanted to be more adventurous,\n" +"she could modify her script to check for command-line arguments,\n" +"and use `NENE*[AB].txt` if none were provided.\n" +"Of course, this introduces another tradeoff between flexibility and complexity." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:456 +msgid "> ## Variables in Shell Scripts" +msgstr "> ## Variables in Shell Scripts" + +#: shell-novice/_episodes/06-script.md:457 +msgid "" +">\n" +"> In the `molecules` directory, imagine you have a shell script called `script.sh` containing the\n" +"> following commands:\n" +">\n" +"> ~~~\n" +"> head -n $2 $1\n" +"> tail -n $3 $1\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> While you are in the `molecules` directory, you type the following command:\n" +">\n" +"> ~~~\n" +"> bash script.sh '*.pdb' 1 1\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Which of the following outputs would you expect to see?\n" +">\n" +"> 1. All of the lines between the first and the last lines of each file ending in `.pdb`\n" +"> in the `molecules` directory\n" +"> 2. The first and the last line of each file ending in `.pdb` in the `molecules` directory\n" +"> 3. The first and the last line of each file in the `molecules` directory\n" +"> 4. An error because of the quotes around `*.pdb`\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 2. \n" +"> >\n" +"> > The special variables $1, $2 and $3 represent the command line arguments given to the\n" +"> > script, such that the commands run are:\n" +"> >\n" +"> > ```\n" +"> > $ head -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > $ tail -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > The shell does not expand `'*.pdb'` because it is enclosed by quote marks.\n" +"> > As such, the first argument to the script is `'*.pdb'` which gets expanded within the\n" +"> > script by `head` and `tail`." +msgstr "" +">\n" +"> In the `molecules` directory, imagine you have a shell script called `script.sh` containing the\n" +"> following commands:\n" +">\n" +"> ~~~\n" +"> head -n $2 $1\n" +"> tail -n $3 $1\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> While you are in the `molecules` directory, you type the following command:\n" +">\n" +"> ~~~\n" +"> bash script.sh '*.pdb' 1 1\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Which of the following outputs would you expect to see?\n" +">\n" +"> 1. All of the lines between the first and the last lines of each file ending in `.pdb`\n" +"> in the `molecules` directory\n" +"> 2. The first and the last line of each file ending in `.pdb` in the `molecules` directory\n" +"> 3. The first and the last line of each file in the `molecules` directory\n" +"> 4. An error because of the quotes around `*.pdb`\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 2. \n" +"> >\n" +"> > The special variables $1, $2 and $3 represent the command line arguments given to the\n" +"> > script, such that the commands run are:\n" +"> >\n" +"> > ```\n" +"> > $ head -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > $ tail -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" +"> > ```\n" +"> > {: .language-bash}\n" +"> > The shell does not expand `'*.pdb'` because it is enclosed by quote marks.\n" +"> > As such, the first argument to the script is `'*.pdb'` which gets expanded within the\n" +"> > script by `head` and `tail`." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:499 +msgid "> ## Find the Longest File With a Given Extension" +msgstr "> ## Find the Longest File With a Given Extension" + +#: shell-novice/_episodes/06-script.md:500 +msgid "" +">\n" +"> Write a shell script called `longest.sh` that takes the name of a\n" +"> directory and a filename extension as its arguments, and prints\n" +"> out the name of the file with the most lines in that directory\n" +"> with that extension. For example:\n" +">\n" +"> ~~~\n" +"> $ bash longest.sh /tmp/data pdb\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> would print the name of the `.pdb` file in `/tmp/data` that has\n" +"> the most lines.\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > # Shell script which takes two arguments: \n" +"> > # 1. a directory name\n" +"> > # 2. a file extension\n" +"> > # and prints the name of the file in that directory\n" +"> > # with the most lines which matches the file extension.\n" +"> > \n" +"> > wc -l $1/*.$2 | sort -n | tail -n 2 | head -n 1\n" +"> > ```\n" +"> > {: .source}" +msgstr "" +">\n" +"> Write a shell script called `longest.sh` that takes the name of a\n" +"> directory and a filename extension as its arguments, and prints\n" +"> out the name of the file with the most lines in that directory\n" +"> with that extension. For example:\n" +">\n" +"> ~~~\n" +"> $ bash longest.sh /tmp/data pdb\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> would print the name of the `.pdb` file in `/tmp/data` that has\n" +"> the most lines.\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > # Shell script which takes two arguments: \n" +"> > # 1. a directory name\n" +"> > # 2. a file extension\n" +"> > # and prints the name of the file in that directory\n" +"> > # with the most lines which matches the file extension.\n" +"> > \n" +"> > wc -l $1/*.$2 | sort -n | tail -n 2 | head -n 1\n" +"> > ```\n" +"> > {: .source}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:529 +msgid "> ## Script Reading Comprehension" +msgstr "> ## Script Reading Comprehension" + +#: shell-novice/_episodes/06-script.md:530 +msgid "" +">\n" +"> For this question, consider the `data-shell/molecules` directory once again.\n" +"> This contains a number of `.pdb` files in addition to any other files you\n" +"> may have created.\n" +"> Explain what a script called `example.sh` would do when run as\n" +"> `bash example.sh *.pdb` if it contained the following lines:\n" +">\n" +"> ~~~\n" +"> # Script 1\n" +"> echo *.*\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Script 2\n" +"> for filename in $1 $2 $3\n" +"> do\n" +"> cat $filename\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Script 3\n" +"> echo $@.pdb\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solutions\n" +"> > Script 1 would print out a list of all files containing a dot in their name.\n" +"> >\n" +"> > Script 2 would print the contents of the first 3 files matching the file extension.\n" +"> > The shell expands the wildcard before passing the arguments to the `example.sh` script.\n" +"> > \n" +"> > Script 3 would print all the arguments to the script (i.e. all the `.pdb` files),\n" +"> > followed by `.pdb`.\n" +"> > ```\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb.pdb\n" +"> > ```\n" +"> > {: .output}" +msgstr "" +">\n" +"> For this question, consider the `data-shell/molecules` directory once again.\n" +"> This contains a number of `.pdb` files in addition to any other files you\n" +"> may have created.\n" +"> Explain what a script called `example.sh` would do when run as\n" +"> `bash example.sh *.pdb` if it contained the following lines:\n" +">\n" +"> ~~~\n" +"> # Script 1\n" +"> echo *.*\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Script 2\n" +"> for filename in $1 $2 $3\n" +"> do\n" +"> cat $filename\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> # Script 3\n" +"> echo $@.pdb\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solutions\n" +"> > Script 1 would print out a list of all files containing a dot in their name.\n" +"> >\n" +"> > Script 2 would print the contents of the first 3 files matching the file extension.\n" +"> > The shell expands the wildcard before passing the arguments to the `example.sh` script.\n" +"> > \n" +"> > Script 3 would print all the arguments to the script (i.e. all the `.pdb` files),\n" +"> > followed by `.pdb`.\n" +"> > ```\n" +"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb.pdb\n" +"> > ```\n" +"> > {: .output}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/06-script.md:573 +msgid "> ## Debugging Scripts" +msgstr "> ## Debugging Scripts" + +#: shell-novice/_episodes/06-script.md:574 +msgid "" +">\n" +"> Suppose you have saved the following script in a file called `do-errors.sh`\n" +"> in Nelle's `north-pacific-gyre/2012-07-03` directory:\n" +">\n" +"> ~~~\n" +"> # Calculate stats for data files.\n" +"> for datafile in \"$@\"\n" +"> do\n" +"> echo $datfile\n" +"> bash goostats $datafile stats-$datafile\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> When you run it:\n" +">\n" +"> ~~~\n" +"> $ bash do-errors.sh NENE*[AB].txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> the output is blank.\n" +"> To figure out why, re-run the script using the `-x` option:\n" +">\n" +"> ~~~\n" +"> bash -x do-errors.sh NENE*[AB].txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> What is the output showing you?\n" +"> Which line is responsible for the error?\n" +">\n" +"> > ## Solution\n" +"> > The `-x` flag causes `bash` to run in debug mode.\n" +"> > This prints out each command as it is run, which will help you to locate errors.\n" +"> > In this example, we can see that `echo` isn't printing anything. We have made a typo\n" +"> > in the loop variable name, and the variable `datfile` doesn't exist, hence returning\n" +"> > an empty string." +msgstr "" +">\n" +"> Suppose you have saved the following script in a file called `do-errors.sh`\n" +"> in Nelle's `north-pacific-gyre/2012-07-03` directory:\n" +">\n" +"> ~~~\n" +"> # Calculate stats for data files.\n" +"> for datafile in \"$@\"\n" +"> do\n" +"> echo $datfile\n" +"> bash goostats $datafile stats-$datafile\n" +"> done\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> When you run it:\n" +">\n" +"> ~~~\n" +"> $ bash do-errors.sh NENE*[AB].txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> the output is blank.\n" +"> To figure out why, re-run the script using the `-x` option:\n" +">\n" +"> ~~~\n" +"> bash -x do-errors.sh NENE*[AB].txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> What is the output showing you?\n" +"> Which line is responsible for the error?\n" +">\n" +"> > ## Solution\n" +"> > The `-x` flag causes `bash` to run in debug mode.\n" +"> > This prints out each command as it is run, which will help you to locate errors.\n" +"> > In this example, we can see that `echo` isn't printing anything. We have made a typo\n" +"> > in the loop variable name, and the variable `datfile` doesn't exist, hence returning\n" +"> > an empty string." + +# Front Matter +#: shell-novice/_episodes/07-find.md:1 +msgid "" +"---\n" +"title: \"Finding Things\"\n" +"teaching: 25\n" +"exercises: 20\n" +"questions:\n" +"- \"How can I find files?\"\n" +"- \"How can I find things in files?\"\n" +"objectives:\n" +"- \"Use `grep` to select lines from text files that match simple patterns.\"\n" +"- \"Use `find` to find files whose names match simple patterns.\"\n" +"- \"Use the output of one command as the command-line argument(s) to another command.\"\n" +"- \"Explain what is meant by 'text' and 'binary' files, and why many common tools don't handle the latter well.\"\n" +"keypoints:\n" +"- \"`find` finds files with specific properties that match patterns.\"\n" +"- \"`grep` selects lines in files that match patterns.\"\n" +"- \"`--help` is a flag supported by many bash commands, and programs that can be run from within Bash, to display more information on how to use these commands or programs.\"\n" +"- \"`man command` displays the manual page for a given command.\"\n" +"- \"`$(command)` inserts a command's output in place.\"\n" +"---" +msgstr "" +"---\n" +"title: \"Finding Things\"\n" +"teaching: 25\n" +"exercises: 20\n" +"questions:\n" +"- \"How can I find files?\"\n" +"- \"How can I find things in files?\"\n" +"objectives:\n" +"- \"Use `grep` to select lines from text files that match simple patterns.\"\n" +"- \"Use `find` to find files whose names match simple patterns.\"\n" +"- \"Use the output of one command as the command-line argument(s) to another command.\"\n" +"- \"Explain what is meant by 'text' and 'binary' files, and why many common tools don't handle the latter well.\"\n" +"keypoints:\n" +"- \"`find` finds files with specific properties that match patterns.\"\n" +"- \"`grep` selects lines in files that match patterns.\"\n" +"- \"`--help` is a flag supported by many bash commands, and programs that can be run from within Bash, to display more information on how to use these commands or programs.\"\n" +"- \"`man command` displays the manual page for a given command.\"\n" +"- \"`$(command)` inserts a command's output in place.\"\n" +"---" + +#: shell-novice/_episodes/07-find.md:21 +msgid "" +"In the same way that many of us now use \"Google\" as a \n" +"verb meaning \"to find\", Unix programmers often use the \n" +"word \"grep\".\n" +"\"grep\" is a contraction of \"global/regular expression/print\",\n" +"a common sequence of operations in early Unix text editors.\n" +"It is also the name of a very useful command-line program." +msgstr "" +"In the same way that many of us now use \"Google\" as a \n" +"verb meaning \"to find\", Unix programmers often use the \n" +"word \"grep\".\n" +"\"grep\" is a contraction of \"global/regular expression/print\",\n" +"a common sequence of operations in early Unix text editors.\n" +"It is also the name of a very useful command-line program." + +#: shell-novice/_episodes/07-find.md:28 +msgid "" +"`grep` finds and prints lines in files that match a pattern.\n" +"For our examples,\n" +"we will use a file that contains three haikus taken from a\n" +"1998 competition in *Salon* magazine. For this set of examples,\n" +"we're going to be working in the writing subdirectory:" +msgstr "" +"`grep` finds and prints lines in files that match a pattern.\n" +"For our examples,\n" +"we will use a file that contains three haikus taken from a\n" +"1998 competition in *Salon* magazine. For this set of examples,\n" +"we're going to be working in the writing subdirectory:" + +# code block +#: shell-novice/_episodes/07-find.md:34 +msgid "" +"~~~\n" +"$ cd\n" +"$ cd Desktop/data-shell/writing\n" +"$ cat haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ cd\n" +"$ cd Desktop/data-shell/writing\n" +"$ cat haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:41 +msgid "" +"~~~\n" +"The Tao that is seen\n" +"Is not the true Tao, until\n" +"You bring fresh toner.\n" +"\n" +"With searching comes loss\n" +"and the presence of absence:\n" +"\"My Thesis\" not found.\n" +"\n" +"Yesterday it worked\n" +"Today it is not working\n" +"Software is like that.\n" +"~~~" +msgstr "" +"~~~\n" +"The Tao that is seen\n" +"Is not the true Tao, until\n" +"You bring fresh toner.\n" +"\n" +"With searching comes loss\n" +"and the presence of absence:\n" +"\"My Thesis\" not found.\n" +"\n" +"Yesterday it worked\n" +"Today it is not working\n" +"Software is like that.\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:56 +msgid "> ## Forever, or Five Years" +msgstr "> ## Forever, or Five Years" + +#: shell-novice/_episodes/07-find.md:57 +msgid "" +">\n" +"> We haven't linked to the original haikus because they don't appear to be on *Salon*'s site any longer.\n" +"> As [Jeff Rothenberg said](http://www.clir.org/pubs/archives/ensuring.pdf),\n" +"> \"Digital information lasts forever --- or five years, whichever comes first.\"\n" +"> Luckily, popular content often [has backups](http://wiki.c2.com/?ComputerErrorHaiku)." +msgstr "" +">\n" +"> We haven't linked to the original haikus because they don't appear to be on *Salon*'s site any longer.\n" +"> As [Jeff Rothenberg said](http://www.clir.org/pubs/archives/ensuring.pdf),\n" +"> \"Digital information lasts forever --- or five years, whichever comes first.\"\n" +"> Luckily, popular content often [has backups](http://wiki.c2.com/?ComputerErrorHaiku)." + +#: shell-novice/_episodes/07-find.md:64 +msgid "Let's find lines that contain the word \"not\":" +msgstr "Let's find lines that contain the word \"not\":" + +# code block +#: shell-novice/_episodes/07-find.md:66 +msgid "" +"~~~\n" +"$ grep not haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep not haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:71 +msgid "" +"~~~\n" +"Is not the true Tao, until\n" +"\"My Thesis\" not found\n" +"Today it is not working\n" +"~~~" +msgstr "" +"~~~\n" +"Is not the true Tao, until\n" +"\"My Thesis\" not found\n" +"Today it is not working\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:78 +msgid "Here, `not` is the pattern we're searching for. The grep command searches through the file, looking for matches to the pattern specified. To use it type `grep`, then the pattern we're searching for and finally the name of the file (or files) we're searching in." +msgstr "Here, `not` is the pattern we're searching for. The grep command searches through the file, looking for matches to the pattern specified. To use it type `grep`, then the pattern we're searching for and finally the name of the file (or files) we're searching in." + +#: shell-novice/_episodes/07-find.md:80 +msgid "The output is the three lines in the file that contain the letters \"not\"." +msgstr "The output is the three lines in the file that contain the letters \"not\"." + +#: shell-novice/_episodes/07-find.md:82 +msgid "Let's try a different pattern: \"The\"." +msgstr "Let's try a different pattern: \"The\"." + +# code block +#: shell-novice/_episodes/07-find.md:84 +msgid "" +"~~~\n" +"$ grep The haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep The haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:89 +msgid "" +"~~~\n" +"The Tao that is seen\n" +"\"My Thesis\" not found.\n" +"~~~" +msgstr "" +"~~~\n" +"The Tao that is seen\n" +"\"My Thesis\" not found.\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:95 +msgid "" +"This time,\n" +"two lines that include the letters \"The\" are outputted.\n" +"However, one instance of those letters is contained within a larger word,\n" +"\"Thesis\"." +msgstr "" +"This time,\n" +"two lines that include the letters \"The\" are outputted.\n" +"However, one instance of those letters is contained within a larger word,\n" +"\"Thesis\"." + +#: shell-novice/_episodes/07-find.md:100 +msgid "" +"To restrict matches to lines containing the word \"The\" on its own,\n" +"we can give `grep` with the `-w` flag.\n" +"This will limit matches to word boundaries." +msgstr "" +"To restrict matches to lines containing the word \"The\" on its own,\n" +"we can give `grep` with the `-w` flag.\n" +"This will limit matches to word boundaries." + +# code block +#: shell-novice/_episodes/07-find.md:104 +msgid "" +"~~~\n" +"$ grep -w The haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -w The haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:109 +msgid "" +"~~~\n" +"The Tao that is seen\n" +"~~~" +msgstr "" +"~~~\n" +"The Tao that is seen\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:114 +msgid "" +"Note that a \"word boundary\" includes the start and end of a line, so not\n" +"just letters surrounded by spaces. \n" +"Sometimes we don't\n" +"want to search for a single word, but a phrase. This is also easy to do with\n" +"`grep` by putting the phrase in quotes." +msgstr "" +"Note that a \"word boundary\" includes the start and end of a line, so not\n" +"just letters surrounded by spaces. \n" +"Sometimes we don't\n" +"want to search for a single word, but a phrase. This is also easy to do with\n" +"`grep` by putting the phrase in quotes." + +# code block +#: shell-novice/_episodes/07-find.md:120 +msgid "" +"~~~\n" +"$ grep -w \"is not\" haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -w \"is not\" haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:125 +msgid "" +"~~~\n" +"Today it is not working\n" +"~~~" +msgstr "" +"~~~\n" +"Today it is not working\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:130 +msgid "" +"We've now seen that you don't have to have quotes around single words,\n" +"but it is useful to use quotes when searching for multiple words.\n" +"It also helps to make it easier to distinguish between the search term or phrase\n" +"and the file being searched.\n" +"We will use quotes in the remaining examples." +msgstr "" +"We've now seen that you don't have to have quotes around single words,\n" +"but it is useful to use quotes when searching for multiple words.\n" +"It also helps to make it easier to distinguish between the search term or phrase\n" +"and the file being searched.\n" +"We will use quotes in the remaining examples." + +#: shell-novice/_episodes/07-find.md:136 +msgid "Another useful option is `-n`, which numbers the lines that match:" +msgstr "Another useful option is `-n`, which numbers the lines that match:" + +# code block +#: shell-novice/_episodes/07-find.md:138 +msgid "" +"~~~\n" +"$ grep -n \"it\" haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -n \"it\" haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:143 +msgid "" +"~~~\n" +"5:With searching comes loss\n" +"9:Yesterday it worked\n" +"10:Today it is not working\n" +"~~~" +msgstr "" +"~~~\n" +"5:With searching comes loss\n" +"9:Yesterday it worked\n" +"10:Today it is not working\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:150 +msgid "Here, we can see that lines 5, 9, and 10 contain the letters \"it\"." +msgstr "Here, we can see that lines 5, 9, and 10 contain the letters \"it\"." + +#: shell-novice/_episodes/07-find.md:152 +msgid "" +"We can combine options (i.e. flags) as we do with other Unix commands.\n" +"For example, let's find the lines that contain the word \"the\". We can combine\n" +"the option `-w` to find the lines that contain the word \"the\" and `-n` to number the lines that match:" +msgstr "" +"We can combine options (i.e. flags) as we do with other Unix commands.\n" +"For example, let's find the lines that contain the word \"the\". We can combine\n" +"the option `-w` to find the lines that contain the word \"the\" and `-n` to number the lines that match:" + +# code block +#: shell-novice/_episodes/07-find.md:156 +msgid "" +"~~~\n" +"$ grep -n -w \"the\" haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -n -w \"the\" haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:161 +msgid "" +"~~~\n" +"2:Is not the true Tao, until\n" +"6:and the presence of absence:\n" +"~~~" +msgstr "" +"~~~\n" +"2:Is not the true Tao, until\n" +"6:and the presence of absence:\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:167 +msgid "Now we want to use the option `-i` to make our search case-insensitive:" +msgstr "Now we want to use the option `-i` to make our search case-insensitive:" + +# code block +#: shell-novice/_episodes/07-find.md:169 +msgid "" +"~~~\n" +"$ grep -n -w -i \"the\" haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -n -w -i \"the\" haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:174 +msgid "" +"~~~\n" +"1:The Tao that is seen\n" +"2:Is not the true Tao, until\n" +"6:and the presence of absence:\n" +"~~~" +msgstr "" +"~~~\n" +"1:The Tao that is seen\n" +"2:Is not the true Tao, until\n" +"6:and the presence of absence:\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:181 +msgid "" +"Now, we want to use the option `-v` to invert our search, i.e., we want to output\n" +"the lines that do not contain the word \"the\"." +msgstr "" +"Now, we want to use the option `-v` to invert our search, i.e., we want to output\n" +"the lines that do not contain the word \"the\"." + +# code block +#: shell-novice/_episodes/07-find.md:184 +msgid "" +"~~~\n" +"$ grep -n -w -v \"the\" haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep -n -w -v \"the\" haiku.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:189 +msgid "" +"~~~\n" +"1:The Tao that is seen\n" +"3:You bring fresh toner.\n" +"4:\n" +"5:With searching comes loss\n" +"7:\"My Thesis\" not found.\n" +"8:\n" +"9:Yesterday it worked\n" +"10:Today it is not working\n" +"11:Software is like that.\n" +"~~~" +msgstr "" +"~~~\n" +"1:The Tao that is seen\n" +"3:You bring fresh toner.\n" +"4:\n" +"5:With searching comes loss\n" +"7:\"My Thesis\" not found.\n" +"8:\n" +"9:Yesterday it worked\n" +"10:Today it is not working\n" +"11:Software is like that.\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:202 +msgid "`grep` has lots of other options. To find out what they are, we can type:" +msgstr "`grep` has lots of other options. To find out what they are, we can type:" + +# code block +#: shell-novice/_episodes/07-find.md:204 +msgid "" +"~~~\n" +"$ grep --help\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep --help\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:209 +msgid "" +"~~~\n" +"Usage: grep [OPTION]... PATTERN [FILE]...\n" +"Search for PATTERN in each FILE or standard input.\n" +"PATTERN is, by default, a basic regular expression (BRE).\n" +"Example: grep -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +" -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n" +" -F, --fixed-strings PATTERN is a set of newline-separated fixed strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +" -e, --regexp=PATTERN use PATTERN for matching\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +"\n" +"Miscellaneous:\n" +"... ... ...\n" +"~~~" +msgstr "" +"~~~\n" +"Usage: grep [OPTION]... PATTERN [FILE]...\n" +"Search for PATTERN in each FILE or standard input.\n" +"PATTERN is, by default, a basic regular expression (BRE).\n" +"Example: grep -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +" -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n" +" -F, --fixed-strings PATTERN is a set of newline-separated fixed strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +" -e, --regexp=PATTERN use PATTERN for matching\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +"\n" +"Miscellaneous:\n" +"... ... ...\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:232 +msgid "> ## Using `grep`" +msgstr "> ## Using `grep`" + +#: shell-novice/_episodes/07-find.md:233 +msgid "" +">\n" +"> Which command would result in the following output:\n" +">\n" +"> ~~~\n" +"> and the presence of absence:\n" +"> ~~~" +msgstr "" +">\n" +"> Which command would result in the following output:\n" +">\n" +"> ~~~\n" +"> and the presence of absence:\n" +"> ~~~" + +#: shell-novice/_episodes/07-find.md:240 +msgid "" +">\n" +"> 1. `grep \"of\" haiku.txt`\n" +"> 2. `grep -E \"of\" haiku.txt`\n" +"> 3. `grep -w \"of\" haiku.txt`\n" +"> 4. `grep -i \"of\" haiku.txt`\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 3, because the `-w` flag looks only for whole-word matches.\n" +"> > The other options will all match \"of\" when part of another word." +msgstr "" +">\n" +"> 1. `grep \"of\" haiku.txt`\n" +"> 2. `grep -E \"of\" haiku.txt`\n" +"> 3. `grep -w \"of\" haiku.txt`\n" +"> 4. `grep -i \"of\" haiku.txt`\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 3, because the `-w` flag looks only for whole-word matches.\n" +"> > The other options will all match \"of\" when part of another word." + +#: shell-novice/_episodes/07-find.md:253 +msgid "" +">\n" +"> `grep`'s real power doesn't come from its options, though; it comes from\n" +"> the fact that patterns can include wildcards. (The technical name for\n" +"> these is **regular expressions**, which\n" +"> is what the \"re\" in \"grep\" stands for.) Regular expressions are both complex\n" +"> and powerful; if you want to do complex searches, please look at the lesson\n" +"> on [our website](http://v4.software-carpentry.org/regexp/index.html). As a taster, we can\n" +"> find lines that have an 'o' in the second position like this:\n" +">\n" +"> ~~~\n" +"> $ grep -E '^.o' haiku.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> You bring fresh toner.\n" +"> Today it is not working\n" +"> Software is like that.\n" +"> ~~~" +msgstr "" +">\n" +"> `grep`'s real power doesn't come from its options, though; it comes from\n" +"> the fact that patterns can include wildcards. (The technical name for\n" +"> these is **regular expressions**, which\n" +"> is what the \"re\" in \"grep\" stands for.) Regular expressions are both complex\n" +"> and powerful; if you want to do complex searches, please look at the lesson\n" +"> on [our website](http://v4.software-carpentry.org/regexp/index.html). As a taster, we can\n" +"> find lines that have an 'o' in the second position like this:\n" +">\n" +"> ~~~\n" +"> $ grep -E '^.o' haiku.txt\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> ~~~\n" +"> You bring fresh toner.\n" +"> Today it is not working\n" +"> Software is like that.\n" +"> ~~~" + +#: shell-novice/_episodes/07-find.md:273 +msgid "" +">\n" +"> We use the `-E` flag and put the pattern in quotes to prevent the shell\n" +"> from trying to interpret it. (If the pattern contained a `*`, for\n" +"> example, the shell would try to expand it before running `grep`.) The\n" +"> `^` in the pattern anchors the match to the start of the line. The `.`\n" +"> matches a single character (just like `?` in the shell), while the `o`\n" +"> matches an actual 'o'." +msgstr "" +">\n" +"> We use the `-E` flag and put the pattern in quotes to prevent the shell\n" +"> from trying to interpret it. (If the pattern contained a `*`, for\n" +"> example, the shell would try to expand it before running `grep`.) The\n" +"> `^` in the pattern anchors the match to the start of the line. The `.`\n" +"> matches a single character (just like `?` in the shell), while the `o`\n" +"> matches an actual 'o'." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:282 +msgid "> ## Tracking a Species" +msgstr "> ## Tracking a Species" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:284 +msgid "> Leah has several hundred " +msgstr "> Leah has several hundred " + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:285 +msgid "> data files saved in one directory, each of which is formatted like this:" +msgstr "> data files saved in one directory, each of which is formatted like this:" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:288 +msgid "> 2013-11-05,deer,5" +msgstr "> 2013-11-05,deer,5" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:289 +msgid "> 2013-11-05,rabbit,22" +msgstr "> 2013-11-05,rabbit,22" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:290 +msgid "> 2013-11-05,raccoon,7" +msgstr "> 2013-11-05,raccoon,7" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:291 +msgid "> 2013-11-06,rabbit,19" +msgstr "> 2013-11-06,rabbit,19" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:292 +msgid "> 2013-11-06,deer,2" +msgstr "> 2013-11-06,deer,2" + +#: shell-novice/_episodes/07-find.md:295 +msgid "" +">\n" +"> She wants to write a shell script that takes a species as the first command-line argument \n" +"> and a directory as the second argument. The script should return one file called `species.txt` \n" +"> containing a list of dates and the number of that species seen on each date.\n" +"> For example using the data shown above, `rabbits.txt` would contain:\n" +"> \n" +"> ~~~\n" +"> 2013-11-05,22\n" +"> 2013-11-06,19\n" +"> ~~~" +msgstr "" +">\n" +"> She wants to write a shell script that takes a species as the first command-line argument \n" +"> and a directory as the second argument. The script should return one file called `species.txt` \n" +"> containing a list of dates and the number of that species seen on each date.\n" +"> For example using the data shown above, `rabbits.txt` would contain:\n" +"> \n" +"> ~~~\n" +"> 2013-11-05,22\n" +"> 2013-11-06,19\n" +"> ~~~" + +#: shell-novice/_episodes/07-find.md:306 +msgid "" +">\n" +"> Put these commands and pipes in the right order to achieve this:\n" +"> \n" +"> ~~~\n" +"> cut -d : -f 2 \n" +"> > \n" +"> | \n" +"> grep -w $1 -r $2 \n" +"> | \n" +"> $1.txt \n" +"> cut -d , -f 1,3 \n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Hint: use `man grep` to look for how to grep text recursively in a directory\n" +"> and `man cut` to select more than one field in a line.\n" +">\n" +"> An example of such a file is provided in `data-shell/data/animal-counts/animals.txt`\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > You would call the script above like this:\n" +"> >\n" +"> > ```\n" +"> > $ bash count-species.sh bear .\n" +"> > ```\n" +"> > {: .language-bash}" +msgstr "" +">\n" +"> Put these commands and pipes in the right order to achieve this:\n" +"> \n" +"> ~~~\n" +"> cut -d : -f 2 \n" +"> > \n" +"> | \n" +"> grep -w $1 -r $2 \n" +"> | \n" +"> $1.txt \n" +"> cut -d , -f 1,3 \n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> Hint: use `man grep` to look for how to grep text recursively in a directory\n" +"> and `man cut` to select more than one field in a line.\n" +">\n" +"> An example of such a file is provided in `data-shell/data/animal-counts/animals.txt`\n" +">\n" +"> > ## Solution\n" +"> >\n" +"> > ```\n" +"> > grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > You would call the script above like this:\n" +"> >\n" +"> > ```\n" +"> > $ bash count-species.sh bear .\n" +"> > ```\n" +"> > {: .language-bash}" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:341 +msgid "> ## Little Women" +msgstr "> ## Little Women" + +#: shell-novice/_episodes/07-find.md:342 +msgid "" +">\n" +"> You and your friend, having just finished reading *Little Women* by\n" +"> Louisa May Alcott, are in an argument. Of the four sisters in the\n" +"> book, Jo, Meg, Beth, and Amy, your friend thinks that Jo was the\n" +"> most mentioned. You, however, are certain it was Amy. Luckily, you\n" +"> have a file `LittleWomen.txt` containing the full text of the novel\n" +"> (`data-shell/writing/data/LittleWomen.txt`).\n" +"> Using a `for` loop, how would you tabulate the number of times each\n" +"> of the four sisters is mentioned?\n" +">\n" +"> Hint: one solution might employ\n" +"> the commands `grep` and `wc` and a `|`, while another might utilize\n" +"> `grep` options.\n" +"> There is often more than one way to solve a programming task, so a\n" +"> particular solution is usually chosen based on a combination of\n" +"> yielding the correct result, elegance, readability, and speed.\n" +">\n" +"> > ## Solutions\n" +"> > ```\n" +"> > for sis in Jo Meg Beth Amy\n" +"> > do\n" +"> > \techo $sis:\n" +"> >\tgrep -ow $sis LittleWomen.txt | wc -l\n" +"> > done\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > Alternative, slightly inferior solution:\n" +"> > ```\n" +"> > for sis in Jo Meg Beth Amy\n" +"> > do\n" +"> > \techo $sis:\n" +"> >\tgrep -ocw $sis LittleWomen.txt\n" +"> > done\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > This solution is inferior because `grep -c` only reports the number of lines matched.\n" +"> > The total number of matches reported by this method will be lower if there is more\n" +"> > than one match per line." +msgstr "" +">\n" +"> You and your friend, having just finished reading *Little Women* by\n" +"> Louisa May Alcott, are in an argument. Of the four sisters in the\n" +"> book, Jo, Meg, Beth, and Amy, your friend thinks that Jo was the\n" +"> most mentioned. You, however, are certain it was Amy. Luckily, you\n" +"> have a file `LittleWomen.txt` containing the full text of the novel\n" +"> (`data-shell/writing/data/LittleWomen.txt`).\n" +"> Using a `for` loop, how would you tabulate the number of times each\n" +"> of the four sisters is mentioned?\n" +">\n" +"> Hint: one solution might employ\n" +"> the commands `grep` and `wc` and a `|`, while another might utilize\n" +"> `grep` options.\n" +"> There is often more than one way to solve a programming task, so a\n" +"> particular solution is usually chosen based on a combination of\n" +"> yielding the correct result, elegance, readability, and speed.\n" +">\n" +"> > ## Solutions\n" +"> > ```\n" +"> > for sis in Jo Meg Beth Amy\n" +"> > do\n" +"> > \techo $sis:\n" +"> >\tgrep -ow $sis LittleWomen.txt | wc -l\n" +"> > done\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > Alternative, slightly inferior solution:\n" +"> > ```\n" +"> > for sis in Jo Meg Beth Amy\n" +"> > do\n" +"> > \techo $sis:\n" +"> >\tgrep -ocw $sis LittleWomen.txt\n" +"> > done\n" +"> > ```\n" +"> > {: .source}\n" +"> >\n" +"> > This solution is inferior because `grep -c` only reports the number of lines matched.\n" +"> > The total number of matches reported by this method will be lower if there is more\n" +"> > than one match per line." + +#: shell-novice/_episodes/07-find.md:385 +msgid "" +"While `grep` finds lines in files,\n" +"the `find` command finds files themselves.\n" +"Again,\n" +"it has a lot of options;\n" +"to show how the simplest ones work, we'll use the directory tree shown below." +msgstr "" +"While `grep` finds lines in files,\n" +"the `find` command finds files themselves.\n" +"Again,\n" +"it has a lot of options;\n" +"to show how the simplest ones work, we'll use the directory tree shown below." + +#: shell-novice/_episodes/07-find.md:391 +msgid "![File Tree for Find Example](../fig/find-file-tree.svg)" +msgstr "![File Tree for Find Example](../fig/find-file-tree.svg)" + +#: shell-novice/_episodes/07-find.md:393 +msgid "" +"Nelle's `writing` directory contains one file called `haiku.txt` and three subdirectories:\n" +"`thesis` (which contains a sadly empty file, `empty-draft.md`);\n" +"`data` (which contains three files `LittleWomen.txt`, `one.txt` and `two.txt`);\n" +"and a `tools` directory that contains the programs `format` and `stats`,\n" +"and a subdirectory called `old`, with a file `oldtool`." +msgstr "" +"Nelle's `writing` directory contains one file called `haiku.txt` and three subdirectories:\n" +"`thesis` (which contains a sadly empty file, `empty-draft.md`);\n" +"`data` (which contains three files `LittleWomen.txt`, `one.txt` and `two.txt`);\n" +"and a `tools` directory that contains the programs `format` and `stats`,\n" +"and a subdirectory called `old`, with a file `oldtool`." + +#: shell-novice/_episodes/07-find.md:399 +msgid "" +"For our first command,\n" +"let's run `find .`." +msgstr "" +"For our first command,\n" +"let's run `find .`." + +# code block +#: shell-novice/_episodes/07-find.md:402 +msgid "" +"~~~\n" +"$ find .\n" +"~~~" +msgstr "" +"~~~\n" +"$ find .\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:407 +msgid "" +"~~~\n" +".\n" +"./data\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"./tools\n" +"./tools/format\n" +"./tools/old\n" +"./tools/old/oldtool\n" +"./tools/stats\n" +"./haiku.txt\n" +"./thesis\n" +"./thesis/empty-draft.md\n" +"~~~" +msgstr "" +"~~~\n" +".\n" +"./data\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"./tools\n" +"./tools/format\n" +"./tools/old\n" +"./tools/old/oldtool\n" +"./tools/stats\n" +"./haiku.txt\n" +"./thesis\n" +"./thesis/empty-draft.md\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:424 +msgid "" +"As always,\n" +"the `.` on its own means the current working directory,\n" +"which is where we want our search to start.\n" +"`find`'s output is the names of every file **and** directory\n" +"under the current working directory.\n" +"This can seem useless at first but `find` has many options\n" +"to filter the output and in this lesson we will discover some \n" +"of them." +msgstr "" +"As always,\n" +"the `.` on its own means the current working directory,\n" +"which is where we want our search to start.\n" +"`find`'s output is the names of every file **and** directory\n" +"under the current working directory.\n" +"This can seem useless at first but `find` has many options\n" +"to filter the output and in this lesson we will discover some \n" +"of them." + +#: shell-novice/_episodes/07-find.md:433 +msgid "" +"The first option in our list is\n" +"`-type d` that means \"things that are directories\".\n" +"Sure enough,\n" +"`find`'s output is the names of the six directories in our little tree\n" +"(including `.`):" +msgstr "" +"The first option in our list is\n" +"`-type d` that means \"things that are directories\".\n" +"Sure enough,\n" +"`find`'s output is the names of the six directories in our little tree\n" +"(including `.`):" + +# code block +#: shell-novice/_episodes/07-find.md:439 +msgid "" +"~~~\n" +"$ find . -type d\n" +"~~~" +msgstr "" +"~~~\n" +"$ find . -type d\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:444 +msgid "" +"~~~\n" +"./\n" +"./data\n" +"./thesis\n" +"./tools\n" +"./tools/old\n" +"~~~" +msgstr "" +"~~~\n" +"./\n" +"./data\n" +"./thesis\n" +"./tools\n" +"./tools/old\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:453 +msgid "" +"Notice that the objects `find` finds are not listed in any particular order.\n" +"If we change `-type d` to `-type f`,\n" +"we get a listing of all the files instead:" +msgstr "" +"Notice that the objects `find` finds are not listed in any particular order.\n" +"If we change `-type d` to `-type f`,\n" +"we get a listing of all the files instead:" + +# code block +#: shell-novice/_episodes/07-find.md:457 +msgid "" +"~~~\n" +"$ find . -type f\n" +"~~~" +msgstr "" +"~~~\n" +"$ find . -type f\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:462 +msgid "" +"~~~\n" +"./haiku.txt\n" +"./tools/stats\n" +"./tools/old/oldtool\n" +"./tools/format\n" +"./thesis/empty-draft.md\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"~~~" +msgstr "" +"~~~\n" +"./haiku.txt\n" +"./tools/stats\n" +"./tools/old/oldtool\n" +"./tools/format\n" +"./thesis/empty-draft.md\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:474 +msgid "Now let's try matching by name:" +msgstr "Now let's try matching by name:" + +# code block +#: shell-novice/_episodes/07-find.md:476 +msgid "" +"~~~\n" +"$ find . -name *.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ find . -name *.txt\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:481 +msgid "" +"~~~\n" +"./haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"./haiku.txt\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:486 +msgid "" +"We expected it to find all the text files,\n" +"but it only prints out `./haiku.txt`.\n" +"The problem is that the shell expands wildcard characters like `*` *before* commands run.\n" +"Since `*.txt` in the current directory expands to `haiku.txt`,\n" +"the command we actually ran was:" +msgstr "" +"We expected it to find all the text files,\n" +"but it only prints out `./haiku.txt`.\n" +"The problem is that the shell expands wildcard characters like `*` *before* commands run.\n" +"Since `*.txt` in the current directory expands to `haiku.txt`,\n" +"the command we actually ran was:" + +# code block +#: shell-novice/_episodes/07-find.md:492 +msgid "" +"~~~\n" +"$ find . -name haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ find . -name haiku.txt\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:497 +msgid "`find` did what we asked; we just asked for the wrong thing." +msgstr "`find` did what we asked; we just asked for the wrong thing." + +#: shell-novice/_episodes/07-find.md:499 +msgid "" +"To get what we want,\n" +"let's do what we did with `grep`:\n" +"put `*.txt` in single quotes to prevent the shell from expanding the `*` wildcard.\n" +"This way,\n" +"`find` actually gets the pattern `*.txt`, not the expanded filename `haiku.txt`:" +msgstr "" +"To get what we want,\n" +"let's do what we did with `grep`:\n" +"put `*.txt` in single quotes to prevent the shell from expanding the `*` wildcard.\n" +"This way,\n" +"`find` actually gets the pattern `*.txt`, not the expanded filename `haiku.txt`:" + +# code block +#: shell-novice/_episodes/07-find.md:505 +msgid "" +"~~~\n" +"$ find . -name '*.txt'\n" +"~~~" +msgstr "" +"~~~\n" +"$ find . -name '*.txt'\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:510 +msgid "" +"~~~\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"./haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"./data/one.txt\n" +"./data/LittleWomen.txt\n" +"./data/two.txt\n" +"./haiku.txt\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:518 +msgid "> ## Listing vs. Finding" +msgstr "> ## Listing vs. Finding" + +#: shell-novice/_episodes/07-find.md:519 +msgid "" +">\n" +"> `ls` and `find` can be made to do similar things given the right options,\n" +"> but under normal circumstances,\n" +"> `ls` lists everything it can,\n" +"> while `find` searches for things with certain properties and shows them." +msgstr "" +">\n" +"> `ls` and `find` can be made to do similar things given the right options,\n" +"> but under normal circumstances,\n" +"> `ls` lists everything it can,\n" +"> while `find` searches for things with certain properties and shows them." + +#: shell-novice/_episodes/07-find.md:526 +msgid "" +"As we said earlier,\n" +"the command line's power lies in combining tools.\n" +"We've seen how to do that with pipes;\n" +"let's look at another technique.\n" +"As we just saw,\n" +"`find . -name '*.txt'` gives us a list of all text files in or below the current directory.\n" +"How can we combine that with `wc -l` to count the lines in all those files?" +msgstr "" +"As we said earlier,\n" +"the command line's power lies in combining tools.\n" +"We've seen how to do that with pipes;\n" +"let's look at another technique.\n" +"As we just saw,\n" +"`find . -name '*.txt'` gives us a list of all text files in or below the current directory.\n" +"How can we combine that with `wc -l` to count the lines in all those files?" + +#: shell-novice/_episodes/07-find.md:534 +msgid "The simplest way is to put the `find` command inside `$()`:" +msgstr "The simplest way is to put the `find` command inside `$()`:" + +# code block +#: shell-novice/_episodes/07-find.md:536 +msgid "" +"~~~\n" +"$ wc -l $(find . -name '*.txt')\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l $(find . -name '*.txt')\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:541 +msgid "" +"~~~\n" +"11 ./haiku.txt\n" +"300 ./data/two.txt\n" +"21022 ./data/LittleWomen.txt\n" +"70 ./data/one.txt\n" +"21403 total\n" +"~~~" +msgstr "" +"~~~\n" +"11 ./haiku.txt\n" +"300 ./data/two.txt\n" +"21022 ./data/LittleWomen.txt\n" +"70 ./data/one.txt\n" +"21403 total\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:550 +msgid "" +"When the shell executes this command,\n" +"the first thing it does is run whatever is inside the `$()`.\n" +"It then replaces the `$()` expression with that command's output.\n" +"Since the output of `find` is the four filenames `./data/one.txt`, `./data/LittleWomen.txt`, `./data/two.txt`, and `./haiku.txt`,\n" +"the shell constructs the command:" +msgstr "" +"When the shell executes this command,\n" +"the first thing it does is run whatever is inside the `$()`.\n" +"It then replaces the `$()` expression with that command's output.\n" +"Since the output of `find` is the four filenames `./data/one.txt`, `./data/LittleWomen.txt`, `./data/two.txt`, and `./haiku.txt`,\n" +"the shell constructs the command:" + +# code block +#: shell-novice/_episodes/07-find.md:556 +msgid "" +"~~~\n" +"$ wc -l ./data/one.txt ./data/LittleWomen.txt ./data/two.txt ./haiku.txt\n" +"~~~" +msgstr "" +"~~~\n" +"$ wc -l ./data/one.txt ./data/LittleWomen.txt ./data/two.txt ./haiku.txt\n" +"~~~" + +#: shell-novice/_episodes/07-find.md:561 +msgid "" +"which is what we wanted.\n" +"This expansion is exactly what the shell does when it expands wildcards like `*` and `?`,\n" +"but lets us use any command we want as our own \"wildcard\"." +msgstr "" +"which is what we wanted.\n" +"This expansion is exactly what the shell does when it expands wildcards like `*` and `?`,\n" +"but lets us use any command we want as our own \"wildcard\"." + +#: shell-novice/_episodes/07-find.md:565 +msgid "" +"It's very common to use `find` and `grep` together.\n" +"The first finds files that match a pattern;\n" +"the second looks for lines inside those files that match another pattern.\n" +"Here, for example, we can find PDB files that contain iron atoms\n" +"by looking for the string \"FE\" in all the `.pdb` files above the current directory:" +msgstr "" +"It's very common to use `find` and `grep` together.\n" +"The first finds files that match a pattern;\n" +"the second looks for lines inside those files that match another pattern.\n" +"Here, for example, we can find PDB files that contain iron atoms\n" +"by looking for the string \"FE\" in all the `.pdb` files above the current directory:" + +# code block +#: shell-novice/_episodes/07-find.md:571 +msgid "" +"~~~\n" +"$ grep \"FE\" $(find .. -name '*.pdb')\n" +"~~~" +msgstr "" +"~~~\n" +"$ grep \"FE\" $(find .. -name '*.pdb')\n" +"~~~" + +# code block +#: shell-novice/_episodes/07-find.md:576 +msgid "" +"~~~\n" +"../data/pdb/heme.pdb:ATOM 25 FE 1 -0.924 0.535 -0.518\n" +"~~~" +msgstr "" +"~~~\n" +"../data/pdb/heme.pdb:ATOM 25 FE 1 -0.924 0.535 -0.518\n" +"~~~" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:581 +msgid "> ## Matching and Subtracting" +msgstr "> ## Matching and Subtracting" + +#: shell-novice/_episodes/07-find.md:582 +msgid "" +">\n" +"> The `-v` flag to `grep` inverts pattern matching, so that only lines\n" +"> which do *not* match the pattern are printed. Given that, which of\n" +"> the following commands will find all files in `/data` whose names\n" +"> end in `s.txt` (e.g., `animals.txt` or `planets.txt`), but do\n" +"> *not* contain the word `net`?\n" +"> Once you have thought about your answer, you can test the commands in the `data-shell`\n" +"> directory.\n" +">\n" +"> 1. `find data -name '*s.txt' | grep -v net`\n" +"> 2. `find data -name *s.txt | grep -v net`\n" +"> 3. `grep -v \"temp\" $(find data -name '*s.txt')`\n" +"> 4. None of the above.\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 1. Putting the match expression in quotes prevents the shell\n" +"> > expanding it, so it gets passed to the `find` command.\n" +"> >\n" +"> > Option 2 is incorrect because the shell expands `*s.txt` instead of passing the wildcard\n" +"> > expression to `find`.\n" +"> >\n" +"> > Option 3 is incorrect because it searches the contents of the files for lines which\n" +"> > do not match \"temp\", rather than searching the file names." +msgstr "" +">\n" +"> The `-v` flag to `grep` inverts pattern matching, so that only lines\n" +"> which do *not* match the pattern are printed. Given that, which of\n" +"> the following commands will find all files in `/data` whose names\n" +"> end in `s.txt` (e.g., `animals.txt` or `planets.txt`), but do\n" +"> *not* contain the word `net`?\n" +"> Once you have thought about your answer, you can test the commands in the `data-shell`\n" +"> directory.\n" +">\n" +"> 1. `find data -name '*s.txt' | grep -v net`\n" +"> 2. `find data -name *s.txt | grep -v net`\n" +"> 3. `grep -v \"temp\" $(find data -name '*s.txt')`\n" +"> 4. None of the above.\n" +">\n" +"> > ## Solution\n" +"> > The correct answer is 1. Putting the match expression in quotes prevents the shell\n" +"> > expanding it, so it gets passed to the `find` command.\n" +"> >\n" +"> > Option 2 is incorrect because the shell expands `*s.txt` instead of passing the wildcard\n" +"> > expression to `find`.\n" +"> >\n" +"> > Option 3 is incorrect because it searches the contents of the files for lines which\n" +"> > do not match \"temp\", rather than searching the file names." + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:608 +msgid "> ## Binary Files" +msgstr "> ## Binary Files" + +#: shell-novice/_episodes/07-find.md:609 +msgid "" +">\n" +"> We have focused exclusively on finding things in text files. What if\n" +"> your data is stored as images, in databases, or in some other format?\n" +"> One option would be to extend tools like `grep` to handle those formats.\n" +"> This hasn't happened, and probably won't, because there are too many\n" +"> formats to support.\n" +">\n" +"> The second option is to convert the data to text, or extract the\n" +"> text-ish bits from the data. This is probably the most common approach,\n" +"> since it only requires people to build one tool per data format (to\n" +"> extract information). On the one hand, it makes simple things easy to\n" +"> do. On the negative side, complex things are usually impossible. For\n" +"> example, it's easy enough to write a program that will extract X and Y\n" +"> dimensions from image files for `grep` to play with, but how would you\n" +"> write something to find values in a spreadsheet whose cells contained\n" +"> formulas?\n" +">\n" +"> The third choice is to recognize that the shell and text processing have\n" +"> their limits, and to use another programming language.\n" +"> When the time comes to do this, don't be too hard on the shell: many\n" +"> modern programming languages have borrowed a lot of\n" +"> ideas from it, and imitation is also the sincerest form of praise." +msgstr "" +">\n" +"> We have focused exclusively on finding things in text files. What if\n" +"> your data is stored as images, in databases, or in some other format?\n" +"> One option would be to extend tools like `grep` to handle those formats.\n" +"> This hasn't happened, and probably won't, because there are too many\n" +"> formats to support.\n" +">\n" +"> The second option is to convert the data to text, or extract the\n" +"> text-ish bits from the data. This is probably the most common approach,\n" +"> since it only requires people to build one tool per data format (to\n" +"> extract information). On the one hand, it makes simple things easy to\n" +"> do. On the negative side, complex things are usually impossible. For\n" +"> example, it's easy enough to write a program that will extract X and Y\n" +"> dimensions from image files for `grep` to play with, but how would you\n" +"> write something to find values in a spreadsheet whose cells contained\n" +"> formulas?\n" +">\n" +"> The third choice is to recognize that the shell and text processing have\n" +"> their limits, and to use another programming language.\n" +"> When the time comes to do this, don't be too hard on the shell: many\n" +"> modern programming languages have borrowed a lot of\n" +"> ideas from it, and imitation is also the sincerest form of praise." + +#: shell-novice/_episodes/07-find.md:633 +msgid "" +"The Unix shell is older than most of the people who use it. It has\n" +"survived so long because it is one of the most productive programming\n" +"environments ever created --- maybe even *the* most productive. Its syntax\n" +"may be cryptic, but people who have mastered it can experiment with\n" +"different commands interactively, then use what they have learned to\n" +"automate their work. Graphical user interfaces may be better at the\n" +"first, but the shell is still unbeaten at the second. And as Alfred\n" +"North Whitehead wrote in 1911, \"Civilization advances by extending the\n" +"number of important operations which we can perform without thinking\n" +"about them.\"" +msgstr "" +"The Unix shell is older than most of the people who use it. It has\n" +"survived so long because it is one of the most productive programming\n" +"environments ever created --- maybe even *the* most productive. Its syntax\n" +"may be cryptic, but people who have mastered it can experiment with\n" +"different commands interactively, then use what they have learned to\n" +"automate their work. Graphical user interfaces may be better at the\n" +"first, but the shell is still unbeaten at the second. And as Alfred\n" +"North Whitehead wrote in 1911, \"Civilization advances by extending the\n" +"number of important operations which we can perform without thinking\n" +"about them.\"" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:644 +msgid "> ## `find` Pipeline Reading Comprehension" +msgstr "> ## `find` Pipeline Reading Comprehension" + +#: shell-novice/_episodes/07-find.md:645 +msgid "" +">\n" +"> Write a short explanatory comment for the following shell script:\n" +">\n" +"> ~~~\n" +"> wc -l $(find . -name '*.dat') | sort -n\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > 1. Find all files with a `.dat` extension in the current directory\n" +"> > 2. Count the number of lines each of these files contains\n" +"> > 3. Sort the output from step 2. numerically" +msgstr "" +">\n" +"> Write a short explanatory comment for the following shell script:\n" +">\n" +"> ~~~\n" +"> wc -l $(find . -name '*.dat') | sort -n\n" +"> ~~~\n" +"> {: .language-bash}\n" +">\n" +"> > ## Solution\n" +"> > 1. Find all files with a `.dat` extension in the current directory\n" +"> > 2. Count the number of lines each of these files contains\n" +"> > 3. Sort the output from step 2. numerically" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:660 +msgid "> ## Finding Files With Different Properties" +msgstr "> ## Finding Files With Different Properties" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:662 +msgid "> The `find` command can be given several other criteria known as \"tests\"" +msgstr "> The `find` command can be given several other criteria known as \"tests\"" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:663 +msgid "> to locate files with specific attributes, such as creation time, size," +msgstr "> to locate files with specific attributes, such as creation time, size," + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:664 +msgid "> permissions, or ownership. Use `man find` to explore these, and then" +msgstr "> permissions, or ownership. Use `man find` to explore these, and then" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:665 +msgid "> write a single command to find all files in or below the current directory" +msgstr "> write a single command to find all files in or below the current directory" + +# blockquote, which can be cascaded +#: shell-novice/_episodes/07-find.md:666 +msgid "> that were modified by the user `ahmed` in the last 24 hours." +msgstr "> that were modified by the user `ahmed` in the last 24 hours." + +#: shell-novice/_episodes/07-find.md:667 +msgid "" +">\n" +"> Hint 1: you will need to use three tests: `-type`, `-mtime`, and `-user`.\n" +">\n" +"> Hint 2: The value for `-mtime` will need to be negative---why?\n" +">\n" +"> > ## Solution\n" +"> > Assuming that Nelle’s home is our working directory we type:\n" +"> >\n" +"> > ~~~\n" +"> > $ find ./ -type f -mtime -1 -user ahmed\n" +"> > ~~~\n" +"> > {: .language-bash}" +msgstr "" +">\n" +"> Hint 1: you will need to use three tests: `-type`, `-mtime`, and `-user`.\n" +">\n" +"> Hint 2: The value for `-mtime` will need to be negative---why?\n" +">\n" +"> > ## Solution\n" +"> > Assuming that Nelle’s home is our working directory we type:\n" +"> >\n" +"> > ~~~\n" +"> > $ find ./ -type f -mtime -1 -user ahmed\n" +"> > ~~~\n" +"> > {: .language-bash}" + +# Front Matter +#: shell-novice/_extras/about.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: About\n" +"permalink: /about/\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: About\n" +"permalink: /about/\n" +"---" + +#: shell-novice/_extras/about.md:6 +msgid "{% include carpentries.html %}" +msgstr "{% include carpentries.html %}" + +# Front Matter +#: shell-novice/_extras/discuss.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: \"Discussion\"\n" +"permalink: /discuss/\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: \"Discussion\"\n" +"permalink: /discuss/\n" +"---" + +# header +#: shell-novice/_extras/discuss.md:6 +msgid "## Alphabet Soup" +msgstr "## Alphabet Soup" + +#: shell-novice/_extras/discuss.md:8 +msgid "" +"If the command to find out who we are is `whoami`, the command to find\n" +"out where we are ought to be called `whereami`, so why is it `pwd`\n" +"instead? The usual answer is that in the early 1970s, when Unix was\n" +"first being developed, every keystroke counted: the devices of the day\n" +"were slow, and backspacing on a teletype was so painful that cutting the\n" +"number of keystrokes in order to cut the number of typing mistakes was\n" +"actually a win for usability. The reality is that commands were added to\n" +"Unix one by one, without any master plan, by people who were immersed in\n" +"its jargon. The result is as inconsistent as the roolz uv Inglish\n" +"speling, but we're stuck with it now." +msgstr "" +"If the command to find out who we are is `whoami`, the command to find\n" +"out where we are ought to be called `whereami`, so why is it `pwd`\n" +"instead? The usual answer is that in the early 1970s, when Unix was\n" +"first being developed, every keystroke counted: the devices of the day\n" +"were slow, and backspacing on a teletype was so painful that cutting the\n" +"number of keystrokes in order to cut the number of typing mistakes was\n" +"actually a win for usability. The reality is that commands were added to\n" +"Unix one by one, without any master plan, by people who were immersed in\n" +"its jargon. The result is as inconsistent as the roolz uv Inglish\n" +"speling, but we're stuck with it now." + +# header +#: shell-novice/_extras/discuss.md:19 +msgid "## Job Control Codes" +msgstr "## Job Control Codes" + +#: shell-novice/_extras/discuss.md:21 +msgid "" +"The shell accepts a few special commands that allow users to interact\n" +"with running processes or programs. You can enter each of these\n" +"\"control codes\" by holding down the `Ctrl` key and then pressing one\n" +"of the control characters. In other tutorials, you may see the term\n" +"`Control` or the `^` used to represent the `Ctrl` key (e.g. the\n" +"following are all equivalent `Ctrl-C`, `Ctrl+C`, `Control-C`, `Control+C`, `^C`)." +msgstr "" +"The shell accepts a few special commands that allow users to interact\n" +"with running processes or programs. You can enter each of these\n" +"\"control codes\" by holding down the `Ctrl` key and then pressing one\n" +"of the control characters. In other tutorials, you may see the term\n" +"`Control` or the `^` used to represent the `Ctrl` key (e.g. the\n" +"following are all equivalent `Ctrl-C`, `Ctrl+C`, `Control-C`, `Control+C`, `^C`)." + +# unordered list +#: shell-novice/_extras/discuss.md:28 +msgid "* `Ctrl-C`:" +msgstr "* `Ctrl-C`:" + +#: shell-novice/_extras/discuss.md:29 +msgid "" +" interrupts and cancels a running program.\n" +" This is useful if you want to cancel a command that is taking too long to execute." +msgstr "" +" interrupts and cancels a running program.\n" +" This is useful if you want to cancel a command that is taking too long to execute." + +# unordered list +#: shell-novice/_extras/discuss.md:32 +msgid "* `Ctrl-D`:" +msgstr "* `Ctrl-D`:" + +#: shell-novice/_extras/discuss.md:33 +msgid "" +" indicates the end of a file or stream of characters that you are entering on the command line.\n" +" For example, we saw earlier that the `wc` command counts lines, words, and characters in a file.\n" +" If we just type `wc` and hit the Enter key without providing a file name,\n" +" then `wc` will assume we want it to analyze all the stuff we type next.\n" +" After typing our magnum opus directly into the shell prompt,\n" +" we can then type Ctrl-D to tell `wc` that we're done and we'd like to see the results of the word count." +msgstr "" +" indicates the end of a file or stream of characters that you are entering on the command line.\n" +" For example, we saw earlier that the `wc` command counts lines, words, and characters in a file.\n" +" If we just type `wc` and hit the Enter key without providing a file name,\n" +" then `wc` will assume we want it to analyze all the stuff we type next.\n" +" After typing our magnum opus directly into the shell prompt,\n" +" we can then type Ctrl-D to tell `wc` that we're done and we'd like to see the results of the word count." + +# unordered list +#: shell-novice/_extras/discuss.md:40 +msgid "* `Ctrl-Z`:" +msgstr "* `Ctrl-Z`:" + +#: shell-novice/_extras/discuss.md:41 +msgid "" +" Suspends a process but does not terminate it.\n" +" You can then use the command `fg` to restart the job in the foreground." +msgstr "" +" Suspends a process but does not terminate it.\n" +" You can then use the command `fg` to restart the job in the foreground." + +#: shell-novice/_extras/discuss.md:44 +msgid "" +"For new shell users, these control codes can all appear to have\n" +"the same effect: they make things \"go away.\" But it is helpful to\n" +"understand the differences. In general, if something went wrong and\n" +"you just want to get your shell prompt back, it is better to use\n" +"`Ctrl-C`." +msgstr "" +"For new shell users, these control codes can all appear to have\n" +"the same effect: they make things \"go away.\" But it is helpful to\n" +"understand the differences. In general, if something went wrong and\n" +"you just want to get your shell prompt back, it is better to use\n" +"`Ctrl-C`." + +# header +#: shell-novice/_extras/discuss.md:50 +msgid "## Other Shells" +msgstr "## Other Shells" + +#: shell-novice/_extras/discuss.md:52 +msgid "" +"Before Bash became popular in the end of nineties, scientists widely\n" +"used (and some still use) another shell, C-shell, or Csh. Bash and Csh\n" +"have similar feature sets, but their syntax rules are different and\n" +"this makes them incompatible with each other. A few other shells have\n" +"appeared since, including ksh, zsh, and a number of others; they are\n" +"mostly compatible with Bash, and Bash is the default shell on most\n" +"modern implementations of Unix (including most packages that provide\n" +"Unix-like tools for Windows) but if you get strange errors in shell\n" +"scripts written by colleagues, check to see which shell they were\n" +"written for." +msgstr "" +"Before Bash became popular in the end of nineties, scientists widely\n" +"used (and some still use) another shell, C-shell, or Csh. Bash and Csh\n" +"have similar feature sets, but their syntax rules are different and\n" +"this makes them incompatible with each other. A few other shells have\n" +"appeared since, including ksh, zsh, and a number of others; they are\n" +"mostly compatible with Bash, and Bash is the default shell on most\n" +"modern implementations of Unix (including most packages that provide\n" +"Unix-like tools for Windows) but if you get strange errors in shell\n" +"scripts written by colleagues, check to see which shell they were\n" +"written for." + +# header +#: shell-novice/_extras/discuss.md:63 +msgid "## Bash Configurations" +msgstr "## Bash Configurations" + +#: shell-novice/_extras/discuss.md:65 +msgid "" +"Want to customize paths, environment variables, aliases,\n" +"and other behaviors of your shell?\n" +"This excellent blog post \"[Bash Configurations Demystified][bash-demystified]\"\n" +"from Dalton Hubble\n" +"covers tips, tricks, and how to avoid dangers." +msgstr "" +"Want to customize paths, environment variables, aliases,\n" +"and other behaviors of your shell?\n" +"This excellent blog post \"[Bash Configurations Demystified][bash-demystified]\"\n" +"from Dalton Hubble\n" +"covers tips, tricks, and how to avoid dangers." + +#: shell-novice/_extras/discuss.md:71 +msgid "[bash-demystified]: https://blog.dghubble.io/post/.bashprofile-.profile-and-.bashrc-conventions/" +msgstr "[bash-demystified]: https://blog.dghubble.io/post/.bashprofile-.profile-and-.bashrc-conventions/" + +# Front Matter +#: shell-novice/_extras/figures.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: Figures\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: Figures\n" +"---" + +# inline html +#: shell-novice/_extras/figures.md:5 +msgid "" +"" +msgstr "" +"" + +#: shell-novice/_extras/figures.md:34 shell-novice/aio.md:31 +msgid "" +"{% comment %}\n" +"Create anchor for each one of the episodes.\n" +"{% endcomment %}\n" +"{% for episode in site.episodes %}\n" +"
\n" +"{% endfor %}" +msgstr "" +"{% comment %}\n" +"Create anchor for each one of the episodes.\n" +"{% endcomment %}\n" +"{% for episode in site.episodes %}\n" +"
\n" +"{% endfor %}" + +# Front Matter +#: shell-novice/_extras/guide.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: \"Instructor Notes\"\n" +"permalink: /guide/\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: \"Instructor Notes\"\n" +"permalink: /guide/\n" +"---" + +# unordered list +#: shell-novice/_extras/guide.md:6 +msgid "* Why do we learn to use the shell?" +msgstr "* Why do we learn to use the shell?" + +# unordered list +#: shell-novice/_extras/guide.md:7 +msgid " * Allows users to automate repetitive tasks" +msgstr " * Allows users to automate repetitive tasks" + +# unordered list +#: shell-novice/_extras/guide.md:8 +msgid " * And capture small data manipulation steps that are normally not recorded" +msgstr " * And capture small data manipulation steps that are normally not recorded" + +#: shell-novice/_extras/guide.md:9 +msgid "" +" to make research reproducible\n" +"* The Problem\n" +" * Running the same workflow on several samples can be unnecessarily labour intensive\n" +" * Manual manipulation of data files:\n" +" * is often not captured in documentation\n" +" * is hard to reproduce\n" +" * is hard to troubleshoot, review, or improve\n" +"* The Shell\n" +" * Workflows can be automated through the use of shell scripts\n" +" * Built-in commands allow for easy data manipulation (e.g. sort, grep, etc.)\n" +" * Every step can be captured in the shell script and allow reproducibility and easy troubleshooting" +msgstr "" +" to make research reproducible\n" +"* The Problem\n" +" * Running the same workflow on several samples can be unnecessarily labour intensive\n" +" * Manual manipulation of data files:\n" +" * is often not captured in documentation\n" +" * is hard to reproduce\n" +" * is hard to troubleshoot, review, or improve\n" +"* The Shell\n" +" * Workflows can be automated through the use of shell scripts\n" +" * Built-in commands allow for easy data manipulation (e.g. sort, grep, etc.)\n" +" * Every step can be captured in the shell script and allow reproducibility and easy troubleshooting" + +# header +#: shell-novice/_extras/guide.md:21 +msgid "## Overall" +msgstr "## Overall" + +#: shell-novice/_extras/guide.md:23 +msgid "" +"Many people have questioned whether we should still teach the shell.\n" +"After all,\n" +"anyone who wants to rename several thousand data files\n" +"can easily do so interactively in the Python interpreter,\n" +"and anyone who's doing serious data analysis\n" +"is probably going to do most of their work inside the IPython Notebook or R Studio.\n" +"So why teach the shell?" +msgstr "" +"Many people have questioned whether we should still teach the shell.\n" +"After all,\n" +"anyone who wants to rename several thousand data files\n" +"can easily do so interactively in the Python interpreter,\n" +"and anyone who's doing serious data analysis\n" +"is probably going to do most of their work inside the IPython Notebook or R Studio.\n" +"So why teach the shell?" + +#: shell-novice/_extras/guide.md:31 +msgid "" +"The first answer is,\n" +"\"Because so much else depends on it.\"\n" +"Installing software,\n" +"configuring your default editor,\n" +"and controlling remote machines frequently assume a basic familiarity with the shell,\n" +"and with related ideas like standard input and output.\n" +"Many tools also use its terminology\n" +"(for example, the `%ls` and `%cd` magic commands in IPython)." +msgstr "" +"The first answer is,\n" +"\"Because so much else depends on it.\"\n" +"Installing software,\n" +"configuring your default editor,\n" +"and controlling remote machines frequently assume a basic familiarity with the shell,\n" +"and with related ideas like standard input and output.\n" +"Many tools also use its terminology\n" +"(for example, the `%ls` and `%cd` magic commands in IPython)." + +#: shell-novice/_extras/guide.md:40 +msgid "" +"The second answer is,\n" +"\"Because it's an easy way to introduce some fundamental ideas about how to use computers.\"\n" +"As we teach people how to use the Unix shell,\n" +"we teach them that they should get the computer to repeat things\n" +"(via tab completion,\n" +"`!` followed by a command number,\n" +"and `for` loops)\n" +"rather than repeating things themselves.\n" +"We also teach them to take things they've discovered they do frequently\n" +"and save them for later re-use\n" +"(via shell scripts),\n" +"to give things sensible names,\n" +"and to write a little bit of documentation\n" +"(like comment at the top of shell scripts)\n" +"to make their future selves' lives better." +msgstr "" +"The second answer is,\n" +"\"Because it's an easy way to introduce some fundamental ideas about how to use computers.\"\n" +"As we teach people how to use the Unix shell,\n" +"we teach them that they should get the computer to repeat things\n" +"(via tab completion,\n" +"`!` followed by a command number,\n" +"and `for` loops)\n" +"rather than repeating things themselves.\n" +"We also teach them to take things they've discovered they do frequently\n" +"and save them for later re-use\n" +"(via shell scripts),\n" +"to give things sensible names,\n" +"and to write a little bit of documentation\n" +"(like comment at the top of shell scripts)\n" +"to make their future selves' lives better." + +#: shell-novice/_extras/guide.md:56 +msgid "" +"The third answer is,\n" +"\"Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.\"\n" +"Familiarity with the shell is very useful for remote accessing machines,\n" +"using high-performance computing infrastructure,\n" +"and running new specialist tools in many disciplines.\n" +"We do not teach HPC or domain-specific skills here\n" +"but lay the groundwork for further development of these skills.\n" +"In particular,\n" +"understanding the syntax of commands, flags, and help systems is useful for domain specific tools\n" +"and understanding the file system (and how to navigate it) is useful for remote access." +msgstr "" +"The third answer is,\n" +"\"Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.\"\n" +"Familiarity with the shell is very useful for remote accessing machines,\n" +"using high-performance computing infrastructure,\n" +"and running new specialist tools in many disciplines.\n" +"We do not teach HPC or domain-specific skills here\n" +"but lay the groundwork for further development of these skills.\n" +"In particular,\n" +"understanding the syntax of commands, flags, and help systems is useful for domain specific tools\n" +"and understanding the file system (and how to navigate it) is useful for remote access." + +#: shell-novice/_extras/guide.md:67 +msgid "" +"Finally,\n" +"and perhaps most importantly,\n" +"teaching people the shell lets us teach them\n" +"to think about programming in terms of function composition.\n" +"In the case of the shell,\n" +"this takes the form of pipelines rather than nested function calls,\n" +"but the core idea of \"small pieces, loosely joined\" is the same." +msgstr "" +"Finally,\n" +"and perhaps most importantly,\n" +"teaching people the shell lets us teach them\n" +"to think about programming in terms of function composition.\n" +"In the case of the shell,\n" +"this takes the form of pipelines rather than nested function calls,\n" +"but the core idea of \"small pieces, loosely joined\" is the same." + +#: shell-novice/_extras/guide.md:75 +msgid "" +"All of this material can be covered in three hours\n" +"as long as learners using Windows do not run into roadblocks such as:" +msgstr "" +"All of this material can be covered in three hours\n" +"as long as learners using Windows do not run into roadblocks such as:" + +# unordered list +#: shell-novice/_extras/guide.md:78 +msgid "* not being able to figure out where their home directory is" +msgstr "* not being able to figure out where their home directory is" + +#: shell-novice/_extras/guide.md:79 +msgid "" +" (particularly if they're using Cygwin);\n" +"* not being able to run a plain text editor;\n" +" and\n" +"* the shell refusing to run scripts that include DOS line endings." +msgstr "" +" (particularly if they're using Cygwin);\n" +"* not being able to run a plain text editor;\n" +" and\n" +"* the shell refusing to run scripts that include DOS line endings." + +# header +#: shell-novice/_extras/guide.md:84 +msgid "## Preparing to Teach" +msgstr "## Preparing to Teach" + +# unordered list +#: shell-novice/_extras/guide.md:86 +msgid "* Use the `data` directory for in-workshop exercises and live coding examples." +msgstr "* Use the `data` directory for in-workshop exercises and live coding examples." + +#: shell-novice/_extras/guide.md:87 +msgid "" +" You can clone the shell-novice directory or use the `Download ZIP`\n" +" button on the right to get the entire [repository](https://github.com/swcarpentry/shell-novice). We also now provide\n" +" a zip file of the `data` directory that can be downloaded on its own\n" +" from the repository by right-click + save or see the [\"setup\"]({{ page.root }}/setup/) page on the lesson website for more details. " +msgstr "" +" You can clone the shell-novice directory or use the `Download ZIP`\n" +" button on the right to get the entire [repository](https://github.com/swcarpentry/shell-novice). We also now provide\n" +" a zip file of the `data` directory that can be downloaded on its own\n" +" from the repository by right-click + save or see the [\"setup\"]({{ page.root }}/setup/) page on the lesson website for more details. " + +# unordered list +#: shell-novice/_extras/guide.md:92 +msgid "* Website: various practices have been used." +msgstr "* Website: various practices have been used." + +# unordered list +#: shell-novice/_extras/guide.md:93 +msgid " * Option 1: Can give links to learners before the lesson so they can follow along," +msgstr " * Option 1: Can give links to learners before the lesson so they can follow along," + +#: shell-novice/_extras/guide.md:94 +msgid "" +" catch up,\n" +"\tand see exercises (particularly if you're following the lesson content without many changes).\n" +" * Option 2: Don't show the website to the learners during the lesson, as it can be distracting:\n" +" students may read instead of listen, and having another window open is an additional cognitive load.\n" +"\t* In any case, make sure to point to website as a post-workshop reference." +msgstr "" +" catch up,\n" +"\tand see exercises (particularly if you're following the lesson content without many changes).\n" +" * Option 2: Don't show the website to the learners during the lesson, as it can be distracting:\n" +" students may read instead of listen, and having another window open is an additional cognitive load.\n" +"\t* In any case, make sure to point to website as a post-workshop reference." + +# unordered list +#: shell-novice/_extras/guide.md:100 +msgid "* Content:" +msgstr "* Content:" + +#: shell-novice/_extras/guide.md:101 +msgid "" +" Unless you have a truly generous amount of time (4+ hours),\n" +" it is likely that you will not cover ALL the material in this lesson in a single half-day session.\n" +" Plan ahead on what you might skip, what you really want to emphasize, etc." +msgstr "" +" Unless you have a truly generous amount of time (4+ hours),\n" +" it is likely that you will not cover ALL the material in this lesson in a single half-day session.\n" +" Plan ahead on what you might skip, what you really want to emphasize, etc." + +# unordered list +#: shell-novice/_extras/guide.md:105 +msgid "* Exercises:" +msgstr "* Exercises:" + +#: shell-novice/_extras/guide.md:106 +msgid "" +" Think in advance about how you might want to handle exercises during the lesson.\n" +" How are you assigning them (website, slide, handout)?\n" +" Do you want everyone to try it and then you show the solution?\n" +" Have a learner show the solution?\n" +" Have groups each do a different exercise and present their solutions?" +msgstr "" +" Think in advance about how you might want to handle exercises during the lesson.\n" +" How are you assigning them (website, slide, handout)?\n" +" Do you want everyone to try it and then you show the solution?\n" +" Have a learner show the solution?\n" +" Have groups each do a different exercise and present their solutions?" + +# unordered list +#: shell-novice/_extras/guide.md:112 +msgid "* `reference.md` can be printed out and given to students as a reference, your choice." +msgstr "* `reference.md` can be printed out and given to students as a reference, your choice." + +# unordered list +#: shell-novice/_extras/guide.md:114 +msgid "* Other preparation:" +msgstr "* Other preparation:" + +#: shell-novice/_extras/guide.md:115 +msgid "" +" Feel free to add your own examples or side comments,\n" +" but know that it shouldn't be necessary:\n" +" the topics and commands can be taught as given on the lesson pages.\n" +" If you think there is a place where the lesson is lacking,\n" +" feel free to file an issue or submit a pull request." +msgstr "" +" Feel free to add your own examples or side comments,\n" +" but know that it shouldn't be necessary:\n" +" the topics and commands can be taught as given on the lesson pages.\n" +" If you think there is a place where the lesson is lacking,\n" +" feel free to file an issue or submit a pull request." + +# header +#: shell-novice/_extras/guide.md:121 +msgid "## Teaching Notes" +msgstr "## Teaching Notes" + +# unordered list +#: shell-novice/_extras/guide.md:123 +msgid "* Super cool online resource!" +msgstr "* Super cool online resource!" + +#: shell-novice/_extras/guide.md:124 +msgid "" +" will dissect any shell command you type in\n" +" and display help text for each piece. Additional nice manual tool could be with short very descriptive manuals for shell commands, useful especially on Windows while using Git BASH where `man` could not work." +msgstr "" +" will dissect any shell command you type in\n" +" and display help text for each piece. Additional nice manual tool could be with short very descriptive manuals for shell commands, useful especially on Windows while using Git BASH where `man` could not work." + +# unordered list +#: shell-novice/_extras/guide.md:127 +msgid "* Another super cool online resource is ," +msgstr "* Another super cool online resource is ," + +#: shell-novice/_extras/guide.md:128 +msgid " which will check shell scripts (both uploaded and typed in) for common errors." +msgstr " which will check shell scripts (both uploaded and typed in) for common errors." + +# unordered list +#: shell-novice/_extras/guide.md:130 +msgid "* Resources for \"splitting\" your shell so that recent commands" +msgstr "* Resources for \"splitting\" your shell so that recent commands" + +#: shell-novice/_extras/guide.md:131 +msgid " remain in view: ." +msgstr " remain in view: ." + +# unordered list +#: shell-novice/_extras/guide.md:133 +msgid "* Running a text editor from the command line can be" +msgstr "* Running a text editor from the command line can be" + +#: shell-novice/_extras/guide.md:134 +msgid "" +" the biggest stumbling block during the entire lesson:\n" +" many will try to run the same editor as the instructor\n" +" (which may leave them trapped in the awful nether hell that is Vim),\n" +" or will not know how to navigate to the right directory\n" +" to save their file,\n" +" or will run a word processor rather than a plain text editor.\n" +" The quickest way past these problems is to have more knowledgeable learners\n" +" help those who need it." +msgstr "" +" the biggest stumbling block during the entire lesson:\n" +" many will try to run the same editor as the instructor\n" +" (which may leave them trapped in the awful nether hell that is Vim),\n" +" or will not know how to navigate to the right directory\n" +" to save their file,\n" +" or will run a word processor rather than a plain text editor.\n" +" The quickest way past these problems is to have more knowledgeable learners\n" +" help those who need it." + +# unordered list +#: shell-novice/_extras/guide.md:143 +msgid "* Introducing and navigating the filesystem in the shell (covered in" +msgstr "* Introducing and navigating the filesystem in the shell (covered in" + +#: shell-novice/_extras/guide.md:144 +msgid " [Navigating Files and Directories]({{ page.root }}/02-filedir/) section) can be confusing. You may have both terminal and GUI file explorer open side by side so learners can see the content and file structure while they're using terminal to navigate the system." +msgstr " [Navigating Files and Directories]({{ page.root }}/02-filedir/) section) can be confusing. You may have both terminal and GUI file explorer open side by side so learners can see the content and file structure while they're using terminal to navigate the system." + +# unordered list +#: shell-novice/_extras/guide.md:146 +msgid "* Tab completion sounds like a small thing: it isn't." +msgstr "* Tab completion sounds like a small thing: it isn't." + +#: shell-novice/_extras/guide.md:147 +msgid "" +" Re-running old commands using `!123` or `!wc`\n" +" isn't a small thing either,\n" +" and neither are wildcard expansion and `for` loops.\n" +" Each one is an opportunity to repeat one of the big ideas of Software Carpentry:\n" +" if the computer *can* repeat it,\n" +" some programmer somewhere will almost certainly have built\n" +" some way for the computer *to* repeat it." +msgstr "" +" Re-running old commands using `!123` or `!wc`\n" +" isn't a small thing either,\n" +" and neither are wildcard expansion and `for` loops.\n" +" Each one is an opportunity to repeat one of the big ideas of Software Carpentry:\n" +" if the computer *can* repeat it,\n" +" some programmer somewhere will almost certainly have built\n" +" some way for the computer *to* repeat it." + +# unordered list +#: shell-novice/_extras/guide.md:155 +msgid "* Building up a pipeline with four or five stages," +msgstr "* Building up a pipeline with four or five stages," + +#: shell-novice/_extras/guide.md:156 +msgid "" +" then putting it in a shell script for re-use\n" +" and calling that script inside a `for` loop,\n" +" is a great opportunity to show how\n" +" \"seven plus or minus two\"\n" +" connects to programming.\n" +" Once we have figured out how to do something moderately complicated,\n" +" we make it re-usable and give it a name\n" +" so that it only takes up one slot in working memory\n" +" rather than several.\n" +" It is also a good opportunity to talk about exploratory programming:\n" +" rather than designing a program up front,\n" +" we can do a few useful things\n" +" and then retroactively decide which are worth encapsulating\n" +" for future re-use." +msgstr "" +" then putting it in a shell script for re-use\n" +" and calling that script inside a `for` loop,\n" +" is a great opportunity to show how\n" +" \"seven plus or minus two\"\n" +" connects to programming.\n" +" Once we have figured out how to do something moderately complicated,\n" +" we make it re-usable and give it a name\n" +" so that it only takes up one slot in working memory\n" +" rather than several.\n" +" It is also a good opportunity to talk about exploratory programming:\n" +" rather than designing a program up front,\n" +" we can do a few useful things\n" +" and then retroactively decide which are worth encapsulating\n" +" for future re-use." + +# unordered list +#: shell-novice/_extras/guide.md:171 +msgid "* If everything is going well, you can drive home the point that file" +msgstr "* If everything is going well, you can drive home the point that file" + +#: shell-novice/_extras/guide.md:172 +msgid "" +" extensions are essentially there to help computers (and human\n" +" readers) understand file content and are not a requirement of files\n" +" (covered briefly in [Navigating Files and Directories]({{ page.root }}/02-filedir/)).\n" +" This can be done in the [Pipes and Filters]({{ page.root }}/04-pipefilter/) section by showing that you\n" +" can redirect standard output to a file without the .txt extension\n" +" (e.g., lengths), and that the resulting file is still a perfectly usable text file.\n" +" Make the point that if double-clicked in the GUI, the computer will\n" +" probably ask you what you want to do." +msgstr "" +" extensions are essentially there to help computers (and human\n" +" readers) understand file content and are not a requirement of files\n" +" (covered briefly in [Navigating Files and Directories]({{ page.root }}/02-filedir/)).\n" +" This can be done in the [Pipes and Filters]({{ page.root }}/04-pipefilter/) section by showing that you\n" +" can redirect standard output to a file without the .txt extension\n" +" (e.g., lengths), and that the resulting file is still a perfectly usable text file.\n" +" Make the point that if double-clicked in the GUI, the computer will\n" +" probably ask you what you want to do." + +# unordered list +#: shell-novice/_extras/guide.md:181 +msgid "* We have to leave out many important things because of time constraints," +msgstr "* We have to leave out many important things because of time constraints," + +#: shell-novice/_extras/guide.md:182 +msgid "" +" including file permissions, job control, and SSH.\n" +" If learners already understand the basic material,\n" +" this can be covered instead using the online lessons as guidelines.\n" +" These limitations also have follow-on consequences:" +msgstr "" +" including file permissions, job control, and SSH.\n" +" If learners already understand the basic material,\n" +" this can be covered instead using the online lessons as guidelines.\n" +" These limitations also have follow-on consequences:" + +# unordered list +#: shell-novice/_extras/guide.md:187 +msgid "* It's hard to discuss `#!` (shebang) without first discussing" +msgstr "* It's hard to discuss `#!` (shebang) without first discussing" + +#: shell-novice/_extras/guide.md:188 +msgid "" +" permissions, which we don't do. `#!` is also [pretty\n" +" complicated][shebang], so even if we did discuss permissions, we\n" +" probably still wouldn't want to discuss `#!`." +msgstr "" +" permissions, which we don't do. `#!` is also [pretty\n" +" complicated][shebang], so even if we did discuss permissions, we\n" +" probably still wouldn't want to discuss `#!`." + +# unordered list +#: shell-novice/_extras/guide.md:192 +msgid "* Installing Bash and a reasonable set of Unix commands on Windows" +msgstr "* Installing Bash and a reasonable set of Unix commands on Windows" + +#: shell-novice/_extras/guide.md:193 +msgid "" +" always involves some fiddling and frustration.\n" +" Please see the latest set of installation guidelines for advice,\n" +" and try it out yourself *before* teaching a class." +msgstr "" +" always involves some fiddling and frustration.\n" +" Please see the latest set of installation guidelines for advice,\n" +" and try it out yourself *before* teaching a class." + +# unordered list +#: shell-novice/_extras/guide.md:197 +msgid "* On Windows machines" +msgstr "* On Windows machines" + +#: shell-novice/_extras/guide.md:198 +msgid "" +" if `nano` hasn't been properly installed with the\n" +" [Software Carpentry Windows Installer][windows-installer]\n" +" it is possible to use `notepad` as an alternative. There will be a GUI\n" +" interface and line endings are treated differently, but otherwise, for\n" +" the purposes of this lesson, `notepad` and `nano` can be used almost interchangeably." +msgstr "" +" if `nano` hasn't been properly installed with the\n" +" [Software Carpentry Windows Installer][windows-installer]\n" +" it is possible to use `notepad` as an alternative. There will be a GUI\n" +" interface and line endings are treated differently, but otherwise, for\n" +" the purposes of this lesson, `notepad` and `nano` can be used almost interchangeably." + +# unordered list +#: shell-novice/_extras/guide.md:204 +msgid "* On Windows, it appears that:" +msgstr "* On Windows, it appears that:" + +#: shell-novice/_extras/guide.md:206 +msgid "" +" ~~~\n" +" $ cd\n" +" $ cd Desktop\n" +" ~~~" +msgstr "" +" ~~~\n" +" $ cd\n" +" $ cd Desktop\n" +" ~~~" + +#: shell-novice/_extras/guide.md:212 +msgid "" +" will always put someone on their desktop.\n" +" Have them create the example directory for the shell exercises there\n" +" so that they can find it easily\n" +" and watch it evolve." +msgstr "" +" will always put someone on their desktop.\n" +" Have them create the example directory for the shell exercises there\n" +" so that they can find it easily\n" +" and watch it evolve." + +# unordered list +#: shell-novice/_extras/guide.md:217 +msgid "* Stay within POSIX-compliant commands, as all the teaching materials do." +msgstr "* Stay within POSIX-compliant commands, as all the teaching materials do." + +#: shell-novice/_extras/guide.md:218 +msgid "" +" Your particular shell may have extensions beyond POSIX that are not available\n" +" on other machines, especially the default OSX bash and Windows bash emulators.\n" +" For example, POSIX `ls` does not have an `--ignore=` or `-I` option, and POSIX\n" +" `head` takes `-n 10` or `-10`, but not the long form of `--lines=10`." +msgstr "" +" Your particular shell may have extensions beyond POSIX that are not available\n" +" on other machines, especially the default OSX bash and Windows bash emulators.\n" +" For example, POSIX `ls` does not have an `--ignore=` or `-I` option, and POSIX\n" +" `head` takes `-n 10` or `-10`, but not the long form of `--lines=10`." + +# header +#: shell-novice/_extras/guide.md:223 +msgid "## Windows" +msgstr "## Windows" + +#: shell-novice/_extras/guide.md:225 +msgid "" +"Installing Bash and a reasonable set of Unix commands on Windows\n" +"always involves some fiddling and frustration.\n" +"Please see the latest set of installation guidelines for advice,\n" +"and try it out yourself *before* teaching a class.\n" +"Options we have explored include:" +msgstr "" +"Installing Bash and a reasonable set of Unix commands on Windows\n" +"always involves some fiddling and frustration.\n" +"Please see the latest set of installation guidelines for advice,\n" +"and try it out yourself *before* teaching a class.\n" +"Options we have explored include:" + +# ordered list +#: shell-novice/_extras/guide.md:231 +msgid "1. [msysGit](http://msysgit.github.io/) (also called \"Git Bash\")," +msgstr "1. [msysGit](http://msysgit.github.io/) (also called \"Git Bash\")," + +# ordered list +#: shell-novice/_extras/guide.md:232 +msgid "2. [Cygwin](http://www.cygwin.com/)," +msgstr "2. [Cygwin](http://www.cygwin.com/)," + +# ordered list +#: shell-novice/_extras/guide.md:233 +msgid "3. using a desktop virtual machine, and" +msgstr "3. using a desktop virtual machine, and" + +# ordered list +#: shell-novice/_extras/guide.md:234 +msgid "4. having learners connect to a remote Unix machine (typically a VM in the cloud)." +msgstr "4. having learners connect to a remote Unix machine (typically a VM in the cloud)." + +#: shell-novice/_extras/guide.md:236 +msgid "" +"Cygwin was the preferred option until mid-2013,\n" +"but once we started teaching Git,\n" +"msysGit proved to work better.\n" +"Desktop virtual machines and cloud-based VMs work well for technically sophisticated learners,\n" +"and can reduce installation and configuration at the start of the workshop,\n" +"but:" +msgstr "" +"Cygwin was the preferred option until mid-2013,\n" +"but once we started teaching Git,\n" +"msysGit proved to work better.\n" +"Desktop virtual machines and cloud-based VMs work well for technically sophisticated learners,\n" +"and can reduce installation and configuration at the start of the workshop,\n" +"but:" + +# ordered list +#: shell-novice/_extras/guide.md:243 +msgid "1. they don't work well on underpowered machines," +msgstr "1. they don't work well on underpowered machines," + +# ordered list +#: shell-novice/_extras/guide.md:244 +msgid "2. they're confusing for novices (because simple things like copy and paste work differently)," +msgstr "2. they're confusing for novices (because simple things like copy and paste work differently)," + +# ordered list +#: shell-novice/_extras/guide.md:245 +msgid "3. learners leave the workshop without a working environment on their operating system of choice, and" +msgstr "3. learners leave the workshop without a working environment on their operating system of choice, and" + +# ordered list +#: shell-novice/_extras/guide.md:246 +msgid "4. learners may show up without having downloaded the VM or the wireless will go down (or become congested) during the lesson." +msgstr "4. learners may show up without having downloaded the VM or the wireless will go down (or become congested) during the lesson." + +#: shell-novice/_extras/guide.md:248 +msgid "" +"Whatever you use,\n" +"please *test it yourself* on a Windows machine *before* your workshop:\n" +"things may always have changed behind your back since your last workshop.\n" +"And please also make use of our\n" +"[Software Carpentry Windows Installer][windows-installer]." +msgstr "" +"Whatever you use,\n" +"please *test it yourself* on a Windows machine *before* your workshop:\n" +"things may always have changed behind your back since your last workshop.\n" +"And please also make use of our\n" +"[Software Carpentry Windows Installer][windows-installer]." + +#: shell-novice/_extras/guide.md:254 +msgid "" +"[shebang]: http://www.in-ulm.de/~mascheck/various/shebang/\n" +"[windows-installer]: {{ site.swc_github }}/windows-installer" +msgstr "" +"[shebang]: http://www.in-ulm.de/~mascheck/various/shebang/\n" +"[windows-installer]: {{ site.swc_github }}/windows-installer" + +#: shell-novice/_includes/links.md:1 +msgid "" +"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" +"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" +"[concept-maps]: http://carpentries.github.io/instructor-training/05-memory/\n" +"[email]: mailto:lessons@software-carpentry.org\n" +"[contrib-covenant]: http://contributor-covenant.org/\n" +"[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md\n" +"[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html\n" +"[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html\n" +"[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html\n" +"[github-importer]: https://import.github.com/\n" +"[importer]: https://github.com/new/import\n" +"[jekyll-collection]: https://jekyllrb.com/docs/collections/\n" +"[jekyll-install]: https://jekyllrb.com/docs/installation/\n" +"[jekyll-windows]: http://jekyll-windows.juthilo.com/\n" +"[jekyll]: https://jekyllrb.com/\n" +"[jupyter]: https://jupyter.org/\n" +"[mit-license]: http://opensource.org/licenses/mit-license.html\n" +"[morea]: https://morea-framework.github.io/\n" +"[numfocus]: http://numfocus.org/\n" +"[osi]: http://opensource.org\n" +"[pandoc]: https://pandoc.org/\n" +"[paper-now]: https://github.com/PeerJ/paper-now\n" +"[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/\n" +"[pyyaml]: https://pypi.python.org/pypi/PyYAML\n" +"[r-markdown]: http://rmarkdown.rstudio.com/\n" +"[rstudio]: https://www.rstudio.com/\n" +"[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/\n" +"[ruby-installer]: http://rubyinstaller.org/\n" +"[rubygems]: https://rubygems.org/pages/download/\n" +"[styles]: https://github.com/swcarpentry/styles/\n" +"[training]: http://swcarpentry.github.io/instructor-training/\n" +"[workshop-repo]: {{ site.workshop_repo }}\n" +"[yaml]: http://yaml.org/\n" +"[coc]: https://software-carpentry.org/conduct/\n" +"[coc-reporting]: https://software-carpentry.org/CoC-reporting/" +msgstr "" +"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" +"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" +"[concept-maps]: http://carpentries.github.io/instructor-training/05-memory/\n" +"[email]: mailto:lessons@software-carpentry.org\n" +"[contrib-covenant]: http://contributor-covenant.org/\n" +"[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md\n" +"[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html\n" +"[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html\n" +"[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html\n" +"[github-importer]: https://import.github.com/\n" +"[importer]: https://github.com/new/import\n" +"[jekyll-collection]: https://jekyllrb.com/docs/collections/\n" +"[jekyll-install]: https://jekyllrb.com/docs/installation/\n" +"[jekyll-windows]: http://jekyll-windows.juthilo.com/\n" +"[jekyll]: https://jekyllrb.com/\n" +"[jupyter]: https://jupyter.org/\n" +"[mit-license]: http://opensource.org/licenses/mit-license.html\n" +"[morea]: https://morea-framework.github.io/\n" +"[numfocus]: http://numfocus.org/\n" +"[osi]: http://opensource.org\n" +"[pandoc]: https://pandoc.org/\n" +"[paper-now]: https://github.com/PeerJ/paper-now\n" +"[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/\n" +"[pyyaml]: https://pypi.python.org/pypi/PyYAML\n" +"[r-markdown]: http://rmarkdown.rstudio.com/\n" +"[rstudio]: https://www.rstudio.com/\n" +"[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/\n" +"[ruby-installer]: http://rubyinstaller.org/\n" +"[rubygems]: https://rubygems.org/pages/download/\n" +"[styles]: https://github.com/swcarpentry/styles/\n" +"[training]: http://swcarpentry.github.io/instructor-training/\n" +"[workshop-repo]: {{ site.workshop_repo }}\n" +"[yaml]: http://yaml.org/\n" +"[coc]: https://software-carpentry.org/conduct/\n" +"[coc-reporting]: https://software-carpentry.org/CoC-reporting/" + +# Front Matter +#: shell-novice/aio.md:1 +msgid "" +"---\n" +"layout: page \n" +"root: .\n" +"---" +msgstr "" +"---\n" +"layout: page \n" +"root: .\n" +"---" + +# inline html +#: shell-novice/aio.md:5 +msgid "" +"" +msgstr "" +"" + +# Front Matter +#: shell-novice/index.md:1 +msgid "" +"---\n" +"layout: lesson\n" +"root: .\n" +"---" +msgstr "" +"---\n" +"layout: lesson\n" +"root: .\n" +"---" + +#: shell-novice/index.md:6 +msgid "" +"The Unix shell has been around longer than most of its users have been alive.\n" +"It has survived so long because it's a power tool\n" +"that allows people to do complex things with just a few keystrokes.\n" +"More importantly,\n" +"it helps them combine existing programs in new ways\n" +"and automate repetitive tasks\n" +"so they aren't typing the same things over and over again.\n" +"Use of the shell is fundamental to using a wide range of other powerful tools \n" +"and computing resources (including \"high-performance computing\" supercomputers).\n" +"These lessons will start you on a path towards using these resources effectively." +msgstr "" +"Unixシェルは、ほとんどのユーザーが生きていたよりもずっと長くなっています。 \n" +"それは人々がちょうど少数のキーストロークで複雑なことをすることを可能にする電動工具であるので、\n" +"ずっと生き延びてきました。 さらに重要なことは、既存のプログラムを新しい方法で組み合わせ、\n" +"繰り返しの作業を自動化して、同じことを何度も繰り返し入力しないようにすることです。 \n" +"シェルの使用は、他の強力なツールやコンピューティングリソース\n" +"(「高性能コンピューティング」スーパーコンピュータを含む)を幅広く使用する上で基本的です。 \n" +"これらのレッスンは、これらのリソースを効果的に使用するための道を歩み始めます。" + +# blockquote, which can be cascaded +#: shell-novice/index.md:17 +msgid "> ## Prerequisites" +msgstr "> ## Prerequisites" + +#: shell-novice/index.md:18 +msgid "" +">\n" +"> This lesson guides you through the basics of file systems and the\n" +"> shell. If you have stored files on a computer at all and recognize\n" +"> the word “file” and either “directory” or “folder” (two common words\n" +"> for the same thing), you're ready for this lesson.\n" +">\n" +"> If you're already comfortable manipulating files and directories,\n" +"> searching for files with `grep` and `find`, and writing simple loops\n" +"> and scripts, you probably want to explore the next lesson: [shell-extras](swcarpentry.github.io/shell-extras)." +msgstr "" +"> このレッスンでは、ファイルシステムとシェルの基本について説明します。 \n" +"> コンピュータにファイルを保存して、「ファイル」という単語と「ディレクトリ」\n" +"> または「フォルダ」(同じことの2つの一般的な単語)を認識している場合は、\n" +"> このレッスンの準備が整いました。\n" +"> \n" +">ファイルやディレクトリを操作したり、grepとfindでファイルを検索したり、\n" +"> 単純なループやスクリプトを書いたりするのが快適であれば、\n" +"> おそらく次のレッスンを探そうと思っています:\n" +"> [shell-extras](swcarpentry.github.io/shell-extras)を実行します。" + +# SC/DC Template label +#: shell-novice/index.md:27 +msgid "{: .prereq}" +msgstr "{: .prereq}" + +# Front Matter +#: shell-novice/reference.md:1 +msgid "" +"---\n" +"layout: reference\n" +"permalink: /reference/\n" +"---" +msgstr "" +"---\n" +"layout: reference\n" +"permalink: /reference/\n" +"---" + +# header +#: shell-novice/reference.md:6 +msgid "## Summary of Basic Commands" +msgstr "## 基本コマンドのまとめ" + +#: shell-novice/reference.md:8 +msgid "" +"| Action | Files | Folders |\n" +"|-------------|-------|--------------|\n" +"| Inspect | ls | ls |\n" +"| View content| cat | ls |\n" +"| Navigate to | | cd |\n" +"| Move | mv | mv |\n" +"| Copy | cp | cp -r |\n" +"| Create | nano | mkdir |\n" +"| Delete | rm | rmdir, rm -r |" +msgstr "" +"| アクション | ファイル | フォルダ |\n" +"|-------------|-------|--------------|\n" +"| 検査 | ls | ls |\n" +"| コンテンツを表示| cat | ls |\n" +"| 移動 | | cd |\n" +"| 移動 | mv | mv |\n" +"| コピー | cp | cp -r |\n" +"| 作成 | nano | mkdir |\n" +"| 削除 | rm | rmdir, rm -r |" + +# header +#: shell-novice/reference.md:18 +msgid "## Filesystem hierarchy" +msgstr "## Filesystem hierarchy" + +#: shell-novice/reference.md:20 +msgid "" +"The following is an overview of a standard Unix filesystem.\n" +"The exact hierarchy depends on the platform,\n" +"so you may not see exactly the same files/directories on your computer:" +msgstr "" +"The following is an overview of a standard Unix filesystem.\n" +"The exact hierarchy depends on the platform,\n" +"so you may not see exactly the same files/directories on your computer:" + +#: shell-novice/reference.md:24 +msgid "![Linux filesystem hierarchy](../fig/standard-filesystem-hierarchy.svg)" +msgstr "![Linux filesystem hierarchy](../fig/standard-filesystem-hierarchy.svg)" + +# header +#: shell-novice/reference.md:26 +msgid "## Glossary" +msgstr "## Glossary" + +#: shell-novice/reference.md:28 +msgid "" +"{:auto_ids}\n" +"absolute path\n" +": A [path](#path) that refers to a particular location in a file system.\n" +" Absolute paths are usually written with respect to the file system's\n" +" [root directory](#root-directory),\n" +" and begin with either \"/\" (on Unix) or \"\\\\\" (on Microsoft Windows).\n" +" See also: [relative path](#relative-path)." +msgstr "" +"{:auto_ids}\n" +"absolute path\n" +": A [path](#path) that refers to a particular location in a file system.\n" +" Absolute paths are usually written with respect to the file system's\n" +" [root directory](#root-directory),\n" +" and begin with either \"/\" (on Unix) or \"\\\\\" (on Microsoft Windows).\n" +" See also: [relative path](#relative-path)." + +#: shell-novice/reference.md:36 +msgid "" +"argument\n" +": A value given to a function or program when it runs.\n" +" The term is often used interchangeably (and inconsistently) with [parameter](#parameter)." +msgstr "" +"argument\n" +": A value given to a function or program when it runs.\n" +" The term is often used interchangeably (and inconsistently) with [parameter](#parameter)." + +#: shell-novice/reference.md:40 +msgid "" +"command shell\n" +": See [shell](#shell)" +msgstr "" +"command shell\n" +": See [shell](#shell)" + +#: shell-novice/reference.md:43 +msgid "" +"command-line interface\n" +": A user interface based on typing commands,\n" +" usually at a [REPL](#read-evaluate-print-loop).\n" +" See also: [graphical user interface](#graphical-user-interface)." +msgstr "" +"command-line interface\n" +": A user interface based on typing commands,\n" +" usually at a [REPL](#read-evaluate-print-loop).\n" +" See also: [graphical user interface](#graphical-user-interface)." + +#: shell-novice/reference.md:48 +msgid "" +"comment\n" +": A remark in a program that is intended to help human readers understand what is going on,\n" +" but is ignored by the computer.\n" +" Comments in Python, R, and the Unix shell start with a `#` character and run to the end of the line;\n" +" comments in SQL start with `--`,\n" +" and other languages have other conventions." +msgstr "" +"comment\n" +": A remark in a program that is intended to help human readers understand what is going on,\n" +" but is ignored by the computer.\n" +" Comments in Python, R, and the Unix shell start with a `#` character and run to the end of the line;\n" +" comments in SQL start with `--`,\n" +" and other languages have other conventions." + +#: shell-novice/reference.md:56 +msgid "" +"current working directory\n" +": The directory that [relative paths](#relative-path) are calculated from;\n" +" equivalently,\n" +" the place where files referenced by name only are searched for.\n" +" Every [process](#process) has a current working directory.\n" +" The current working directory is usually referred to using the shorthand notation `.` (pronounced \"dot\")." +msgstr "" +"current working directory\n" +": The directory that [relative paths](#relative-path) are calculated from;\n" +" equivalently,\n" +" the place where files referenced by name only are searched for.\n" +" Every [process](#process) has a current working directory.\n" +" The current working directory is usually referred to using the shorthand notation `.` (pronounced \"dot\")." + +#: shell-novice/reference.md:63 +msgid "" +"file system\n" +": A set of files, directories, and I/O devices (such as keyboards and screens).\n" +" A file system may be spread across many physical devices,\n" +" or many file systems may be stored on a single physical device;\n" +" the [operating system](#operating-system) manages access." +msgstr "" +"file system\n" +": A set of files, directories, and I/O devices (such as keyboards and screens).\n" +" A file system may be spread across many physical devices,\n" +" or many file systems may be stored on a single physical device;\n" +" the [operating system](#operating-system) manages access." + +#: shell-novice/reference.md:69 +msgid "" +"filename extension\n" +": The portion of a file's name that comes after the final \".\" character.\n" +" By convention this identifies the file's type:\n" +" `.txt` means \"text file\", `.png` means \"Portable Network Graphics file\",\n" +" and so on. These conventions are not enforced by most operating systems:\n" +" it is perfectly possible (but confusing!) to name an MP3 sound file `homepage.html`.\n" +" Since many applications use filename extensions to identify the [MIME type](#mime-type) of the file,\n" +" misnaming files may cause those applications to fail." +msgstr "" +"filename extension\n" +": The portion of a file's name that comes after the final \".\" character.\n" +" By convention this identifies the file's type:\n" +" `.txt` means \"text file\", `.png` means \"Portable Network Graphics file\",\n" +" and so on. These conventions are not enforced by most operating systems:\n" +" it is perfectly possible (but confusing!) to name an MP3 sound file `homepage.html`.\n" +" Since many applications use filename extensions to identify the [MIME type](#mime-type) of the file,\n" +" misnaming files may cause those applications to fail." + +#: shell-novice/reference.md:78 +msgid "" +"filter\n" +": A program that transforms a stream of data.\n" +" Many Unix command-line tools are written as filters:\n" +" they read data from [standard input](#standard-input),\n" +" process it, and write the result to [standard output](#standard-output)." +msgstr "" +"filter\n" +": A program that transforms a stream of data.\n" +" Many Unix command-line tools are written as filters:\n" +" they read data from [standard input](#standard-input),\n" +" process it, and write the result to [standard output](#standard-output)." + +#: shell-novice/reference.md:84 +msgid "" +"flag\n" +": A terse way to specify an option or setting to a command-line program.\n" +" By convention Unix applications use a dash followed by a single letter,\n" +" such as `-v`, or two dashes followed by a word, such as `--verbose`,\n" +" while DOS applications use a slash, such as `/V`.\n" +" Depending on the application, a flag may be followed by a single argument, as in `-o /tmp/output.txt`." +msgstr "" +"flag\n" +": A terse way to specify an option or setting to a command-line program.\n" +" By convention Unix applications use a dash followed by a single letter,\n" +" such as `-v`, or two dashes followed by a word, such as `--verbose`,\n" +" while DOS applications use a slash, such as `/V`.\n" +" Depending on the application, a flag may be followed by a single argument, as in `-o /tmp/output.txt`." + +#: shell-novice/reference.md:91 +msgid "" +"for loop\n" +": A loop that is executed once for each value in some kind of set, list, or range.\n" +" See also: [while loop](#while-loop)." +msgstr "" +"for loop\n" +": A loop that is executed once for each value in some kind of set, list, or range.\n" +" See also: [while loop](#while-loop)." + +#: shell-novice/reference.md:95 +msgid "" +"graphical user interface\n" +": A user interface based on selecting items and actions from a graphical display,\n" +" usually controlled by using a mouse.\n" +" See also: [command-line interface](#command-line-interface)." +msgstr "" +"graphical user interface\n" +": A user interface based on selecting items and actions from a graphical display,\n" +" usually controlled by using a mouse.\n" +" See also: [command-line interface](#command-line-interface)." + +#: shell-novice/reference.md:100 +msgid "" +"home directory\n" +": The default directory associated with an account on a computer system.\n" +" By convention, all of a user's files are stored in or below her home directory." +msgstr "" +"home directory\n" +": The default directory associated with an account on a computer system.\n" +" By convention, all of a user's files are stored in or below her home directory." + +#: shell-novice/reference.md:104 +msgid "" +"loop\n" +": A set of instructions to be executed multiple times. Consists of a [loop body](#loop-body) and (usually) a\n" +" condition for exiting the loop. See also [for loop](#for-loop) and [while loop](#while-loop)." +msgstr "" +"loop\n" +": A set of instructions to be executed multiple times. Consists of a [loop body](#loop-body) and (usually) a\n" +" condition for exiting the loop. See also [for loop](#for-loop) and [while loop](#while-loop)." + +#: shell-novice/reference.md:108 +msgid "" +"loop body\n" +": The set of statements or commands that are repeated inside a [for loop](#for-loop)\n" +" or [while loop](#while-loop)." +msgstr "" +"loop body\n" +": The set of statements or commands that are repeated inside a [for loop](#for-loop)\n" +" or [while loop](#while-loop)." + +#: shell-novice/reference.md:112 +msgid "" +"MIME type\n" +": MIME (Multi-Purpose Internet Mail Extensions) types describe different file types for exchange on the Internet,\n" +" for example images, audio, and documents." +msgstr "" +"MIME type\n" +": MIME (Multi-Purpose Internet Mail Extensions) types describe different file types for exchange on the Internet,\n" +" for example images, audio, and documents." + +#: shell-novice/reference.md:116 +msgid "" +"operating system\n" +": Software that manages interactions between users, hardware, and software [processes](#process). Common\n" +" examples are Linux, OS X, and Windows." +msgstr "" +"operating system\n" +": Software that manages interactions between users, hardware, and software [processes](#process). Common\n" +" examples are Linux, OS X, and Windows." + +#: shell-novice/reference.md:120 +msgid "" +"orthogonal\n" +": To have meanings or behaviors that are independent of each other.\n" +" If a set of concepts or tools are orthogonal,\n" +" they can be combined in any way." +msgstr "" +"orthogonal\n" +": To have meanings or behaviors that are independent of each other.\n" +" If a set of concepts or tools are orthogonal,\n" +" they can be combined in any way." + +#: shell-novice/reference.md:125 +msgid "" +"parameter\n" +": A variable named in a function's declaration that is used to hold a value passed into the call.\n" +" The term is often used interchangeably (and inconsistently) with [argument](#argument)." +msgstr "" +"parameter\n" +": A variable named in a function's declaration that is used to hold a value passed into the call.\n" +" The term is often used interchangeably (and inconsistently) with [argument](#argument)." + +#: shell-novice/reference.md:129 +msgid "" +"parent directory\n" +": The directory that \"contains\" the one in question.\n" +" Every directory in a file system except the [root directory](#root-directory) has a parent.\n" +" A directory's parent is usually referred to using the shorthand notation `..` (pronounced \"dot dot\")." +msgstr "" +"parent directory\n" +": The directory that \"contains\" the one in question.\n" +" Every directory in a file system except the [root directory](#root-directory) has a parent.\n" +" A directory's parent is usually referred to using the shorthand notation `..` (pronounced \"dot dot\")." + +#: shell-novice/reference.md:134 +msgid "" +"path\n" +": A description that specifies the location of a file or directory within a [file system](#file-system).\n" +" See also: [absolute path](#absolute-path), [relative path](#relative-path)." +msgstr "" +"path\n" +": A description that specifies the location of a file or directory within a [file system](#file-system).\n" +" See also: [absolute path](#absolute-path), [relative path](#relative-path)." + +#: shell-novice/reference.md:139 +msgid "" +"pipe\n" +": A connection from the output of one program to the input of another.\n" +" When two or more programs are connected in this way, they are called a \"pipeline\"." +msgstr "" +"pipe\n" +": A connection from the output of one program to the input of another.\n" +" When two or more programs are connected in this way, they are called a \"pipeline\"." + +#: shell-novice/reference.md:143 +msgid "" +"process\n" +": A running instance of a program, containing code, variable values,\n" +" open files and network connections, and so on.\n" +" Processes are the \"actors\" that the [operating system](#operating-system) manages;\n" +" it typically runs each process for a few milliseconds at a time\n" +" to give the impression that they are executing simultaneously." +msgstr "" +"process\n" +": A running instance of a program, containing code, variable values,\n" +" open files and network connections, and so on.\n" +" Processes are the \"actors\" that the [operating system](#operating-system) manages;\n" +" it typically runs each process for a few milliseconds at a time\n" +" to give the impression that they are executing simultaneously." + +#: shell-novice/reference.md:151 +msgid "" +"prompt\n" +": A character or characters display by a [REPL](#read-evaluate-print-loop) to show that\n" +" it is waiting for its next command." +msgstr "" +"prompt\n" +": A character or characters display by a [REPL](#read-evaluate-print-loop) to show that\n" +" it is waiting for its next command." + +#: shell-novice/reference.md:155 +msgid "" +"quoting\n" +": (in the shell):\n" +" Using quotation marks of various kinds to prevent the shell from interpreting special characters.\n" +" For example, to pass the string `*.txt` to a program,\n" +" it is usually necessary to write it as `'*.txt'` (with single quotes)\n" +" so that the shell will not try to expand the `*` wildcard." +msgstr "" +"quoting\n" +": (in the shell):\n" +" Using quotation marks of various kinds to prevent the shell from interpreting special characters.\n" +" For example, to pass the string `*.txt` to a program,\n" +" it is usually necessary to write it as `'*.txt'` (with single quotes)\n" +" so that the shell will not try to expand the `*` wildcard." + +#: shell-novice/reference.md:162 +msgid "" +"read-evaluate-print loop\n" +": (REPL): A [command-line interface](#command-line-interface) that reads a command from the user,\n" +" executes it, prints the result, and waits for another command." +msgstr "" +"read-evaluate-print loop\n" +": (REPL): A [command-line interface](#command-line-interface) that reads a command from the user,\n" +" executes it, prints the result, and waits for another command." + +#: shell-novice/reference.md:166 +msgid "" +"redirect\n" +": To send a command's output to a file rather than to the screen or another command,\n" +" or equivalently to read a command's input from a file." +msgstr "" +"redirect\n" +": To send a command's output to a file rather than to the screen or another command,\n" +" or equivalently to read a command's input from a file." + +#: shell-novice/reference.md:170 +msgid "" +"regular expression\n" +": A pattern that specifies a set of character strings.\n" +" REs are most often used to find sequences of characters in strings." +msgstr "" +"regular expression\n" +": A pattern that specifies a set of character strings.\n" +" REs are most often used to find sequences of characters in strings." + +#: shell-novice/reference.md:174 +msgid "" +"relative path\n" +": A [path](#path) that specifies the location of a file or directory\n" +" with respect to the [current working directory](#current-working-directory).\n" +" Any path that does not begin with a separator character (\"/\" or \"\\\\\") is a relative path.\n" +" See also: [absolute path](#absolute-path)." +msgstr "" +"relative path\n" +": A [path](#path) that specifies the location of a file or directory\n" +" with respect to the [current working directory](#current-working-directory).\n" +" Any path that does not begin with a separator character (\"/\" or \"\\\\\") is a relative path.\n" +" See also: [absolute path](#absolute-path)." + +#: shell-novice/reference.md:180 +msgid "" +"root directory\n" +": The top-most directory in a [file system](#file-system).\n" +" Its name is \"/\" on Unix (including Linux and Mac OS X) and \"\\\\\" on Microsoft Windows." +msgstr "" +"root directory\n" +": The top-most directory in a [file system](#file-system).\n" +" Its name is \"/\" on Unix (including Linux and Mac OS X) and \"\\\\\" on Microsoft Windows." + +#: shell-novice/reference.md:184 +msgid "" +"shell\n" +": A [command-line interface](#cli) such as Bash (the Bourne-Again Shell)\n" +" or the Microsoft Windows DOS shell\n" +" that allows a user to interact with the [operating system](#operating-system)." +msgstr "" +"shell\n" +": A [command-line interface](#cli) such as Bash (the Bourne-Again Shell)\n" +" or the Microsoft Windows DOS shell\n" +" that allows a user to interact with the [operating system](#operating-system)." + +#: shell-novice/reference.md:189 +msgid "" +"shell script\n" +": A set of [shell](#shell) commands stored in a file for re-use.\n" +" A shell script is a program executed by the shell;\n" +" the name \"script\" is used for historical reasons." +msgstr "" +"shell script\n" +": A set of [shell](#shell) commands stored in a file for re-use.\n" +" A shell script is a program executed by the shell;\n" +" the name \"script\" is used for historical reasons." + +#: shell-novice/reference.md:195 +msgid "" +"standard input\n" +": A process's default input stream.\n" +" In interactive command-line applications,\n" +" it is typically connected to the keyboard;\n" +" in a [pipe](#pipe),\n" +" it receives data from the [standard output](#standard-output) of the preceding process." +msgstr "" +"standard input\n" +": A process's default input stream.\n" +" In interactive command-line applications,\n" +" it is typically connected to the keyboard;\n" +" in a [pipe](#pipe),\n" +" it receives data from the [standard output](#standard-output) of the preceding process." + +#: shell-novice/reference.md:203 +msgid "" +"standard output\n" +": A process's default output stream.\n" +" In interactive command-line applications,\n" +" data sent to standard output is displayed on the screen;\n" +" in a [pipe](#pipe),\n" +" it is passed to the [standard input](#standard-input) of the next process." +msgstr "" +"standard output\n" +": A process's default output stream.\n" +" In interactive command-line applications,\n" +" data sent to standard output is displayed on the screen;\n" +" in a [pipe](#pipe),\n" +" it is passed to the [standard input](#standard-input) of the next process." + +#: shell-novice/reference.md:211 +msgid "" +"sub-directory\n" +": A directory contained within another directory." +msgstr "" +"sub-directory\n" +": A directory contained within another directory." + +#: shell-novice/reference.md:214 +msgid "" +"tab completion\n" +": A feature provided by many interactive systems in which\n" +" pressing the Tab key triggers automatic completion of the current word or command." +msgstr "" +"tab completion\n" +": A feature provided by many interactive systems in which\n" +" pressing the Tab key triggers automatic completion of the current word or command." + +#: shell-novice/reference.md:218 +msgid "" +"variable\n" +": A name in a program that is associated with a value or a collection of values." +msgstr "" +"variable\n" +": A name in a program that is associated with a value or a collection of values." + +#: shell-novice/reference.md:221 +msgid "" +"while loop\n" +": A loop that keeps executing as long as some condition is true.\n" +" See also: [for loop](#for-loop)." +msgstr "" +"while loop\n" +": A loop that keeps executing as long as some condition is true.\n" +" See also: [for loop](#for-loop)." + +#: shell-novice/reference.md:225 +msgid "" +"wildcard\n" +": A character used in pattern matching.\n" +" In the Unix shell,\n" +" the wildcard `*` matches zero or more characters,\n" +" so that `*.txt` matches all files whose names end in `.txt`." +msgstr "" +"wildcard\n" +": A character used in pattern matching.\n" +" In the Unix shell,\n" +" the wildcard `*` matches zero or more characters,\n" +" so that `*.txt` matches all files whose names end in `.txt`." + +# header +#: shell-novice/reference.md:231 +msgid "## External references" +msgstr "## External references" + +# header +#: shell-novice/reference.md:233 +msgid "### Opening a terminal" +msgstr "### Opening a terminal" + +# unordered list +#: shell-novice/reference.md:234 +msgid "* [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)" +msgstr "* [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)" + +# unordered list +#: shell-novice/reference.md:235 +msgid "* [Git for Windows](https://git-for-windows.github.io/)" +msgstr "* [Git for Windows](https://git-for-windows.github.io/)" + +# unordered list +#: shell-novice/reference.md:236 +msgid "* [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)" +msgstr "* [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)" + +# unordered list +#: shell-novice/reference.md:237 +msgid "* [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)" +msgstr "* [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)" + +# unordered list +#: shell-novice/reference.md:238 +msgid "* [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)" +msgstr "* [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)" + +# unordered list +#: shell-novice/reference.md:239 +msgid "* [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" +msgstr "* [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" + +# header +#: shell-novice/reference.md:241 +msgid "### Manuals" +msgstr "### Manuals" + +# unordered list +#: shell-novice/reference.md:242 +msgid "* [GNU manuals](http://www.gnu.org/manual/manual.html)" +msgstr "* [GNU manuals](http://www.gnu.org/manual/manual.html)" + +# unordered list +#: shell-novice/reference.md:243 +msgid "* [Core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html)" +msgstr "* [Core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html)" + +# header +#: shell-novice/reference.md:245 +msgid "### Miscellaneous" +msgstr "### Miscellaneous" + +# unordered list +#: shell-novice/reference.md:246 +msgid "* [North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre)" +msgstr "* [North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre)" + +# unordered list +#: shell-novice/reference.md:247 +msgid "* [Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch)" +msgstr "* [Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch)" + +# unordered list +#: shell-novice/reference.md:248 +msgid "* ['Ensuring the longevity of digital information' by Jeff Rothenberg](http://www.clir.org/pubs/archives/ensuring.pdf)" +msgstr "* ['Ensuring the longevity of digital information' by Jeff Rothenberg](http://www.clir.org/pubs/archives/ensuring.pdf)" + +# unordered list +#: shell-novice/reference.md:249 +msgid "* [Computer error haikus](http://wiki.c2.com/?ComputerErrorHaiku)" +msgstr "* [Computer error haikus](http://wiki.c2.com/?ComputerErrorHaiku)" + +# Front Matter +#: shell-novice/setup.md:1 +msgid "" +"---\n" +"layout: page\n" +"title: Setup\n" +"root: .\n" +"---" +msgstr "" +"---\n" +"layout: page\n" +"title: Setup\n" +"root: .\n" +"---" + +#: shell-novice/setup.md:7 +msgid "You need to download some files to follow this lesson:" +msgstr "You need to download some files to follow this lesson:" + +# ordered list +#: shell-novice/setup.md:9 +msgid "1. Download [data-shell.zip]({{ page.root }}/data/data-shell.zip) and move the file to your Desktop." +msgstr "1. Download [data-shell.zip]({{ page.root }}/data/data-shell.zip) and move the file to your Desktop." + +# ordered list +#: shell-novice/setup.md:10 +msgid "2. Unzip/extract the file (ask your instructor if you need help with this step). You should end up with a new folder called **data-shell** on your Desktop." +msgstr "2. Unzip/extract the file (ask your instructor if you need help with this step). You should end up with a new folder called **data-shell** on your Desktop." + +# ordered list +#: shell-novice/setup.md:11 +msgid "3. Open a terminal and type `cd`, then press the Enter key. That last step will make sure you start with your home folder as your working directory." +msgstr "3. Open a terminal and type `cd`, then press the Enter key. That last step will make sure you start with your home folder as your working directory." + +#: shell-novice/setup.md:13 +msgid "In the lesson, you will find out how to access the data in this folder. " +msgstr "In the lesson, you will find out how to access the data in this folder. " + +# blockquote, which can be cascaded +#: shell-novice/setup.md:15 +msgid "> ## Where to type commands: How to open a new shell" +msgstr "> ## Where to type commands: How to open a new shell" + +# blockquote, which can be cascaded +#: shell-novice/setup.md:16 +msgid "> The `shell` is a program that enables us to send commands to the computer and receive output. It is also referred to as the `terminal` or `command line`." +msgstr "> The `shell` is a program that enables us to send commands to the computer and receive output. It is also referred to as the `terminal` or `command line`." + +#: shell-novice/setup.md:17 +msgid "" +">\n" +"> Some computers include a default Unix Shell program. \n" +"> The steps below describe some methods for identifying and opening a Unix Shell program if you already have one installed. \n" +"> There are also options for identifying and downloading a Unix Shell program, a Linux/UNIX emulator, or a program to access a UNIX server. \n" +">\n" +"> If none of the options below address your circumstances, try an online search for: UNIX shell [your computer model] [your operating system].\n" +">\n" +"> ### Linux\n" +"> The default shell for Linux operating systems is usually Bash.\n" +"> On most versions of Linux, it is accessible by running the Terminal program,\n" +"> which can be found via the applications menu or the search bar. \n" +"> If your machine is set up to use something other than bash, you can run it by opening a terminal and typing `bash`.\n" +">\n" +"> ### Mac OS\n" +"> For a Mac computer, the default Unix Shell is Bash,\n" +"> and it is available via the Terminal Utilities program within your Applications folder.\n" +">\n" +"> To open Terminal, try one or both of the following:\n" +"> * Go to your Applications. Within Applications, open the Utilities folder. Locate Terminal in the Utilities folder and open it.\n" +"> * Use the Mac ‘Spotlight’ computer search function. Search for: Terminal and press [Enter] - this will open Terminal.\n" +">\n" +"> #### Reference \n" +"> [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)\n" +">\n" +"> ### Windows\n" +"> Computers with Windows operating systems do not automatically have a Unix Shell program installed.\n" +"> In this lesson, we encourage you to use an emulator included in Git for Windows, \n" +"> which gives you access to both Bash shell commands and Git. \n" +"> If you are attending a SWC session, it is likely you have already received instructions on how to install Git for Windows.\n" +">\n" +"> Once installed, you can open a terminal by running the program Git Bash from the Windows start menu.\n" +">\n" +"> Other solutions are available for running Bash commands on Windows systems. \n" +"> There is now a Bash shell command-line tool available for Windows 10. \n" +"> Additionally, you can run Bash commands on a remote UNIX computer or server from your Windows machine. \n" +"> This can be done through a Secure Shell (SSH) client. \n" +"> One such client available for free for Windows computers is PuTTY. \n" +"> See the reference below for information on installing and using PuTTY, \n" +"> using the Windows 10 command-line tool, or installing and using a UNIX/Linux emulator.\n" +">\n" +"> #### Reference\n" +"> * [Git for Windows](https://git-for-windows.github.io/)\n" +"> * [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)\n" +"> * [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)\n" +"> * [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)\n" +"> * [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" +msgstr "" +">\n" +"> Some computers include a default Unix Shell program. \n" +"> The steps below describe some methods for identifying and opening a Unix Shell program if you already have one installed. \n" +"> There are also options for identifying and downloading a Unix Shell program, a Linux/UNIX emulator, or a program to access a UNIX server. \n" +">\n" +"> If none of the options below address your circumstances, try an online search for: UNIX shell [your computer model] [your operating system].\n" +">\n" +"> ### Linux\n" +"> The default shell for Linux operating systems is usually Bash.\n" +"> On most versions of Linux, it is accessible by running the Terminal program,\n" +"> which can be found via the applications menu or the search bar. \n" +"> If your machine is set up to use something other than bash, you can run it by opening a terminal and typing `bash`.\n" +">\n" +"> ### Mac OS\n" +"> For a Mac computer, the default Unix Shell is Bash,\n" +"> and it is available via the Terminal Utilities program within your Applications folder.\n" +">\n" +"> To open Terminal, try one or both of the following:\n" +"> * Go to your Applications. Within Applications, open the Utilities folder. Locate Terminal in the Utilities folder and open it.\n" +"> * Use the Mac ‘Spotlight’ computer search function. Search for: Terminal and press [Enter] - this will open Terminal.\n" +">\n" +"> #### Reference \n" +"> [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)\n" +">\n" +"> ### Windows\n" +"> Computers with Windows operating systems do not automatically have a Unix Shell program installed.\n" +"> In this lesson, we encourage you to use an emulator included in Git for Windows, \n" +"> which gives you access to both Bash shell commands and Git. \n" +"> If you are attending a SWC session, it is likely you have already received instructions on how to install Git for Windows.\n" +">\n" +"> Once installed, you can open a terminal by running the program Git Bash from the Windows start menu.\n" +">\n" +"> Other solutions are available for running Bash commands on Windows systems. \n" +"> There is now a Bash shell command-line tool available for Windows 10. \n" +"> Additionally, you can run Bash commands on a remote UNIX computer or server from your Windows machine. \n" +"> This can be done through a Secure Shell (SSH) client. \n" +"> One such client available for free for Windows computers is PuTTY. \n" +"> See the reference below for information on installing and using PuTTY, \n" +"> using the Windows 10 command-line tool, or installing and using a UNIX/Linux emulator.\n" +">\n" +"> #### Reference\n" +"> * [Git for Windows](https://git-for-windows.github.io/)\n" +"> * [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)\n" +"> * [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)\n" +"> * [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)\n" +"> * [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" From a30aa6829d1e0226ece21c78114227850ab3351b Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Wed, 29 Jul 2020 16:49:41 +0900 Subject: [PATCH 40/59] Delete shell-novice.ja.po This appears to have been copied inadvertently --- shell-novice.ja.po | 12988 ------------------------------------------- 1 file changed, 12988 deletions(-) delete mode 100644 shell-novice.ja.po diff --git a/shell-novice.ja.po b/shell-novice.ja.po deleted file mode 100644 index da45a990..00000000 --- a/shell-novice.ja.po +++ /dev/null @@ -1,12988 +0,0 @@ -# Japanese translation of the Software Carpentry Unix Shell Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team -# This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2019, 2020. -# -msgid "" -msgstr "" -"Project-Id-Version: i18n\n" -"Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" -"POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2020-07-08 13:28+0900\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: Satoshi Yokota \n" -"Language-Team: Japanese \n" -"Language: ja\n" -"X-Generator: Poedit 2.3.1\n" - -# Front Matter -#: shell-novice/CONDUCT.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: \"Contributor Code of Conduct\"\n" -"permalink: /conduct/\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: \"Contributor Code of Conduct\"\n" -"permalink: /conduct/\n" -"---" - -#: shell-novice/CONDUCT.md:6 -msgid "" -"As contributors and maintainers of this project,\n" -"we pledge to respect all people who contribute through reporting issues,\n" -"posting feature requests,\n" -"updating documentation,\n" -"submitting pull requests or patches,\n" -"and other activities." -msgstr "" -"As contributors and maintainers of this project,\n" -"we pledge to respect all people who contribute through reporting issues,\n" -"posting feature requests,\n" -"updating documentation,\n" -"submitting pull requests or patches,\n" -"and other activities." - -#: shell-novice/CONDUCT.md:13 -msgid "" -"We are committed to making participation in this project a harassment-free experience for everyone,\n" -"regardless of level of experience,\n" -"gender,\n" -"gender identity and expression,\n" -"sexual orientation,\n" -"disability,\n" -"personal appearance,\n" -"body size,\n" -"race,\n" -"ethnicity,\n" -"age,\n" -"or religion." -msgstr "" -"We are committed to making participation in this project a harassment-free experience for everyone,\n" -"regardless of level of experience,\n" -"gender,\n" -"gender identity and expression,\n" -"sexual orientation,\n" -"disability,\n" -"personal appearance,\n" -"body size,\n" -"race,\n" -"ethnicity,\n" -"age,\n" -"or religion." - -#: shell-novice/CONDUCT.md:26 -msgid "" -"Examples of unacceptable behavior by participants include the use of sexual language or imagery,\n" -"derogatory comments or personal attacks,\n" -"trolling,\n" -"public or private harassment,\n" -"insults,\n" -"or other unprofessional conduct." -msgstr "" -"Examples of unacceptable behavior by participants include the use of sexual language or imagery,\n" -"derogatory comments or personal attacks,\n" -"trolling,\n" -"public or private harassment,\n" -"insults,\n" -"or other unprofessional conduct." - -#: shell-novice/CONDUCT.md:33 -msgid "" -"Project maintainers have the right and responsibility to remove, edit, or reject\n" -"comments, commits, code, wiki edits, issues, and other contributions\n" -"that are not aligned to our [Code of Conduct][coc].\n" -"Project maintainers who do not follow the Code of Conduct may be removed from the project team." -msgstr "" -"Project maintainers have the right and responsibility to remove, edit, or reject\n" -"comments, commits, code, wiki edits, issues, and other contributions\n" -"that are not aligned to our [Code of Conduct][coc].\n" -"Project maintainers who do not follow the Code of Conduct may be removed from the project team." - -#: shell-novice/CONDUCT.md:38 -msgid "" -"Instances of abusive, harassing, or otherwise unacceptable behavior\n" -"may be reported by following our [reporting guidelines][coc-reporting]." -msgstr "" -"Instances of abusive, harassing, or otherwise unacceptable behavior\n" -"may be reported by following our [reporting guidelines][coc-reporting]." - -# unordered list -#: shell-novice/CONDUCT.md:42 -msgid "- [Software and Data Carpentry Code of Conduct][coc]" -msgstr "- [Software and Data Carpentry Code of Conduct][coc]" - -# unordered list -#: shell-novice/CONDUCT.md:43 -msgid "- [Code of Conduct Reporting Guide][coc-reporting]" -msgstr "- [Code of Conduct Reporting Guide][coc-reporting]" - -#: shell-novice/CONDUCT.md:45 -msgid "{% include links.md %}" -msgstr "{% include links.md %}" - -# header -#: shell-novice/CONTRIBUTING.md:1 -msgid "# Contributing" -msgstr "# Contributing" - -#: shell-novice/CONTRIBUTING.md:3 -msgid "" -"[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,\n" -"and we welcome contributions of all kinds:\n" -"new lessons,\n" -"fixes to existing material,\n" -"bug reports,\n" -"and reviews of proposed changes are all welcome." -msgstr "" -"[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,\n" -"and we welcome contributions of all kinds:\n" -"new lessons,\n" -"fixes to existing material,\n" -"bug reports,\n" -"and reviews of proposed changes are all welcome." - -# header -#: shell-novice/CONTRIBUTING.md:10 -msgid "## Contributor Agreement" -msgstr "## Contributor Agreement" - -#: shell-novice/CONTRIBUTING.md:12 -msgid "" -"By contributing,\n" -"you agree that we may redistribute your work under [our license](LICENSE.md).\n" -"In exchange,\n" -"we will address your issues and/or assess your change proposal as promptly as we can,\n" -"and help you become a member of our community.\n" -"Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" -"agrees to abide by our [code of conduct](CONDUCT.md)." -msgstr "" -"By contributing,\n" -"you agree that we may redistribute your work under [our license](LICENSE.md).\n" -"In exchange,\n" -"we will address your issues and/or assess your change proposal as promptly as we can,\n" -"and help you become a member of our community.\n" -"Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" -"agrees to abide by our [code of conduct](CONDUCT.md)." - -# header -#: shell-novice/CONTRIBUTING.md:20 -msgid "## How to Contribute" -msgstr "## How to Contribute" - -#: shell-novice/CONTRIBUTING.md:22 -msgid "" -"The easiest way to get started is to file an issue\n" -"to tell us about a spelling mistake,\n" -"some awkward wording,\n" -"or a factual error.\n" -"This is a good way to introduce yourself\n" -"and to meet some of our community members." -msgstr "" -"The easiest way to get started is to file an issue\n" -"to tell us about a spelling mistake,\n" -"some awkward wording,\n" -"or a factual error.\n" -"This is a good way to introduce yourself\n" -"and to meet some of our community members." - -# ordered list -#: shell-novice/CONTRIBUTING.md:29 -msgid "1. If you do not have a [GitHub][github] account," -msgstr "1. If you do not have a [GitHub][github] account," - -#: shell-novice/CONTRIBUTING.md:30 -msgid "" -" you can [send us comments by email][contact].\n" -" However,\n" -" we will be able to respond more quickly if you use one of the other methods described below." -msgstr "" -" you can [send us comments by email][contact].\n" -" However,\n" -" we will be able to respond more quickly if you use one of the other methods described below." - -# ordered list -#: shell-novice/CONTRIBUTING.md:34 -msgid "2. If you have a [GitHub][github] account," -msgstr "2. If you have a [GitHub][github] account," - -#: shell-novice/CONTRIBUTING.md:35 -msgid "" -" or are willing to [create one][github-join],\n" -" but do not know how to use Git,\n" -" you can report problems or suggest improvements by [creating an issue][issues].\n" -" This allows us to assign the item to someone\n" -" and to respond to it in a threaded discussion." -msgstr "" -" or are willing to [create one][github-join],\n" -" but do not know how to use Git,\n" -" you can report problems or suggest improvements by [creating an issue][issues].\n" -" This allows us to assign the item to someone\n" -" and to respond to it in a threaded discussion." - -# ordered list -#: shell-novice/CONTRIBUTING.md:41 -msgid "3. If you are comfortable with Git," -msgstr "3. If you are comfortable with Git," - -#: shell-novice/CONTRIBUTING.md:42 -msgid "" -" and would like to add or change material,\n" -" you can submit a pull request (PR).\n" -" Instructions for doing this are [included below](#using-github)." -msgstr "" -" and would like to add or change material,\n" -" you can submit a pull request (PR).\n" -" Instructions for doing this are [included below](#using-github)." - -# header -#: shell-novice/CONTRIBUTING.md:46 -msgid "## Where to Contribute" -msgstr "## Where to Contribute" - -# ordered list -#: shell-novice/CONTRIBUTING.md:48 -msgid "1. If you wish to change this lesson," -msgstr "1. If you wish to change this lesson," - -#: shell-novice/CONTRIBUTING.md:49 -msgid "" -" please work in ,\n" -" which can be viewed at ." -msgstr "" -" please work in ,\n" -" which can be viewed at ." - -# ordered list -#: shell-novice/CONTRIBUTING.md:52 -msgid "2. If you wish to change the example lesson," -msgstr "2. If you wish to change the example lesson," - -#: shell-novice/CONTRIBUTING.md:53 -msgid "" -" please work in ,\n" -" which documents the format of our lessons\n" -" and can be viewed at ." -msgstr "" -" please work in ,\n" -" which documents the format of our lessons\n" -" and can be viewed at ." - -# ordered list -#: shell-novice/CONTRIBUTING.md:57 -msgid "3. If you wish to change the template used for workshop websites," -msgstr "3. If you wish to change the template used for workshop websites," - -#: shell-novice/CONTRIBUTING.md:58 -msgid "" -" please work in .\n" -" The home page of that repository explains how to set up workshop websites,\n" -" while the extra pages in \n" -" provide more background on our design choices." -msgstr "" -" please work in .\n" -" The home page of that repository explains how to set up workshop websites,\n" -" while the extra pages in \n" -" provide more background on our design choices." - -# ordered list -#: shell-novice/CONTRIBUTING.md:63 -msgid "4. If you wish to change CSS style files, tools," -msgstr "4. If you wish to change CSS style files, tools," - -#: shell-novice/CONTRIBUTING.md:64 -msgid "" -" or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,\n" -" please work in ." -msgstr "" -" or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,\n" -" please work in ." - -# header -#: shell-novice/CONTRIBUTING.md:67 -msgid "## What to Contribute" -msgstr "## What to Contribute" - -#: shell-novice/CONTRIBUTING.md:69 -msgid "" -"There are many ways to contribute,\n" -"from writing new exercises and improving existing ones\n" -"to updating or filling in the documentation\n" -"and submitting [bug reports][issues]\n" -"about things that don't work, aren't clear, or are missing.\n" -"If you are looking for ideas,\n" -"please see [the list of issues for this repository][issues],\n" -"or the issues for [Data Carpentry][dc-issues]\n" -"and [Software Carpentry][swc-issues] projects." -msgstr "" -"There are many ways to contribute,\n" -"from writing new exercises and improving existing ones\n" -"to updating or filling in the documentation\n" -"and submitting [bug reports][issues]\n" -"about things that don't work, aren't clear, or are missing.\n" -"If you are looking for ideas,\n" -"please see [the list of issues for this repository][issues],\n" -"or the issues for [Data Carpentry][dc-issues]\n" -"and [Software Carpentry][swc-issues] projects." - -#: shell-novice/CONTRIBUTING.md:79 -msgid "" -"Comments on issues and reviews of pull requests are just as welcome:\n" -"we are smarter together than we are on our own.\n" -"Reviews from novices and newcomers are particularly valuable:\n" -"it's easy for people who have been using these lessons for a while\n" -"to forget how impenetrable some of this material can be,\n" -"so fresh eyes are always welcome." -msgstr "" -"Comments on issues and reviews of pull requests are just as welcome:\n" -"we are smarter together than we are on our own.\n" -"Reviews from novices and newcomers are particularly valuable:\n" -"it's easy for people who have been using these lessons for a while\n" -"to forget how impenetrable some of this material can be,\n" -"so fresh eyes are always welcome." - -# header -#: shell-novice/CONTRIBUTING.md:86 -msgid "## What *Not* to Contribute" -msgstr "## What *Not* to Contribute" - -#: shell-novice/CONTRIBUTING.md:88 -msgid "" -"Our lessons already contain more material than we can cover in a typical workshop,\n" -"so we are usually *not* looking for more concepts or tools to add to them.\n" -"As a rule,\n" -"if you want to introduce a new idea,\n" -"you must (a) estimate how long it will take to teach\n" -"and (b) explain what you would take out to make room for it.\n" -"The first encourages contributors to be honest about requirements;\n" -"the second, to think hard about priorities." -msgstr "" -"Our lessons already contain more material than we can cover in a typical workshop,\n" -"so we are usually *not* looking for more concepts or tools to add to them.\n" -"As a rule,\n" -"if you want to introduce a new idea,\n" -"you must (a) estimate how long it will take to teach\n" -"and (b) explain what you would take out to make room for it.\n" -"The first encourages contributors to be honest about requirements;\n" -"the second, to think hard about priorities." - -#: shell-novice/CONTRIBUTING.md:97 -msgid "" -"We are also not looking for exercises or other material that only run on one platform.\n" -"Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;\n" -"in order to be usable,\n" -"our lessons must run equally well on all three." -msgstr "" -"We are also not looking for exercises or other material that only run on one platform.\n" -"Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;\n" -"in order to be usable,\n" -"our lessons must run equally well on all three." - -# header -#: shell-novice/CONTRIBUTING.md:102 -msgid "## Using GitHub" -msgstr "## Using GitHub" - -#: shell-novice/CONTRIBUTING.md:104 -msgid "" -"If you choose to contribute via GitHub,\n" -"you may want to look at\n" -"[How to Contribute to an Open Source Project on GitHub][how-contribute].\n" -"In brief:" -msgstr "" -"If you choose to contribute via GitHub,\n" -"you may want to look at\n" -"[How to Contribute to an Open Source Project on GitHub][how-contribute].\n" -"In brief:" - -# ordered list -#: shell-novice/CONTRIBUTING.md:109 -msgid "1. The published copy of the lesson is in the `gh-pages` branch of the repository" -msgstr "1. The published copy of the lesson is in the `gh-pages` branch of the repository" - -#: shell-novice/CONTRIBUTING.md:110 -msgid "" -" (so that GitHub will regenerate it automatically).\n" -" Please create all branches from that,\n" -" and merge the [master repository][repo]'s `gh-pages` branch into your `gh-pages` branch\n" -" before starting work.\n" -" Please do *not* work directly in your `gh-pages` branch,\n" -" since that will make it difficult for you to work on other contributions." -msgstr "" -" (so that GitHub will regenerate it automatically).\n" -" Please create all branches from that,\n" -" and merge the [master repository][repo]'s `gh-pages` branch into your `gh-pages` branch\n" -" before starting work.\n" -" Please do *not* work directly in your `gh-pages` branch,\n" -" since that will make it difficult for you to work on other contributions." - -# ordered list -#: shell-novice/CONTRIBUTING.md:117 -msgid "2. We use [GitHub flow][github-flow] to manage changes:" -msgstr "2. We use [GitHub flow][github-flow] to manage changes:" - -#: shell-novice/CONTRIBUTING.md:118 -msgid "" -" 1. Create a new branch in your desktop copy of this repository for each significant change.\n" -" 2. Commit the change in that branch.\n" -" 3. Push that branch to your fork of this repository on GitHub.\n" -" 4. Submit a pull request from that branch to the [master repository][repo].\n" -" 5. If you receive feedback,\n" -" make changes on your desktop and push to your branch on GitHub:\n" -" the pull request will update automatically." -msgstr "" -" 1. Create a new branch in your desktop copy of this repository for each significant change.\n" -" 2. Commit the change in that branch.\n" -" 3. Push that branch to your fork of this repository on GitHub.\n" -" 4. Submit a pull request from that branch to the [master repository][repo].\n" -" 5. If you receive feedback,\n" -" make changes on your desktop and push to your branch on GitHub:\n" -" the pull request will update automatically." - -#: shell-novice/CONTRIBUTING.md:126 -msgid "" -"Each lesson has two maintainers who review issues and pull requests\n" -"or encourage others to do so.\n" -"The maintainers are community volunteers,\n" -"and have final say over what gets merged into the lesson." -msgstr "" -"Each lesson has two maintainers who review issues and pull requests\n" -"or encourage others to do so.\n" -"The maintainers are community volunteers,\n" -"and have final say over what gets merged into the lesson." - -# header -#: shell-novice/CONTRIBUTING.md:131 -msgid "## Other Resources" -msgstr "## Other Resources" - -#: shell-novice/CONTRIBUTING.md:133 -msgid "" -"General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" -"happens on the [discussion mailing list][discuss-list],\n" -"which everyone is welcome to join.\n" -"You can also [reach us by email][contact]." -msgstr "" -"General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]\n" -"happens on the [discussion mailing list][discuss-list],\n" -"which everyone is welcome to join.\n" -"You can also [reach us by email][contact]." - -#: shell-novice/CONTRIBUTING.md:138 -msgid "" -"[contact]: mailto:admin@software-carpentry.org\n" -"[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry\n" -"[dc-lessons]: http://datacarpentry.org/lessons/\n" -"[dc-site]: http://datacarpentry.org/\n" -"[discuss-list]: http://lists.software-carpentry.org/listinfo/discuss\n" -"[github]: http://github.com\n" -"[github-flow]: https://guides.github.com/introduction/flow/\n" -"[github-join]: https://github.com/join\n" -"[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\n" -"[issues]: https://github.com/swcarpentry/shell-novice/issues/\n" -"[repo]: https://github.com/swcarpentry/shell-novice/\n" -"[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry\n" -"[swc-lessons]: http://software-carpentry.org/lessons/\n" -"[swc-site]: http://software-carpentry.org/" -msgstr "" -"[contact]: mailto:admin@software-carpentry.org\n" -"[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry\n" -"[dc-lessons]: http://datacarpentry.org/lessons/\n" -"[dc-site]: http://datacarpentry.org/\n" -"[discuss-list]: http://lists.software-carpentry.org/listinfo/discuss\n" -"[github]: http://github.com\n" -"[github-flow]: https://guides.github.com/introduction/flow/\n" -"[github-join]: https://github.com/join\n" -"[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\n" -"[issues]: https://github.com/swcarpentry/shell-novice/issues/\n" -"[repo]: https://github.com/swcarpentry/shell-novice/\n" -"[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry\n" -"[swc-lessons]: http://software-carpentry.org/lessons/\n" -"[swc-site]: http://software-carpentry.org/" - -# Front Matter -#: shell-novice/LICENSE.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: \"Licenses\"\n" -"root: .\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: \"Licenses\"\n" -"root: .\n" -"---" - -# header -#: shell-novice/LICENSE.md:6 -msgid "## Instructional Material" -msgstr "## Instructional Material" - -#: shell-novice/LICENSE.md:8 -msgid "" -"All Software Carpentry and Data Carpentry instructional material is\n" -"made available under the [Creative Commons Attribution\n" -"license][cc-by-human]. The following is a human-readable summary of\n" -"(and not a substitute for) the [full legal text of the CC BY 4.0\n" -"license][cc-by-legal]." -msgstr "" -"All Software Carpentry and Data Carpentry instructional material is\n" -"made available under the [Creative Commons Attribution\n" -"license][cc-by-human]. The following is a human-readable summary of\n" -"(and not a substitute for) the [full legal text of the CC BY 4.0\n" -"license][cc-by-legal]." - -#: shell-novice/LICENSE.md:14 -msgid "You are free:" -msgstr "You are free:" - -# unordered list -#: shell-novice/LICENSE.md:16 -msgid "* to **Share**---copy and redistribute the material in any medium or format" -msgstr "* to **Share**---copy and redistribute the material in any medium or format" - -# unordered list -#: shell-novice/LICENSE.md:17 -msgid "* to **Adapt**---remix, transform, and build upon the material" -msgstr "* to **Adapt**---remix, transform, and build upon the material" - -#: shell-novice/LICENSE.md:19 -msgid "for any purpose, even commercially." -msgstr "for any purpose, even commercially." - -#: shell-novice/LICENSE.md:21 -msgid "" -"The licensor cannot revoke these freedoms as long as you follow the\n" -"license terms." -msgstr "" -"The licensor cannot revoke these freedoms as long as you follow the\n" -"license terms." - -#: shell-novice/LICENSE.md:24 -msgid "Under the following terms:" -msgstr "Under the following terms:" - -# unordered list -#: shell-novice/LICENSE.md:26 -msgid "* **Attribution**---You must give appropriate credit (mentioning that" -msgstr "* **Attribution**---You must give appropriate credit (mentioning that" - -#: shell-novice/LICENSE.md:27 -msgid "" -" your work is derived from work that is Copyright © Software\n" -" Carpentry and, where practical, linking to\n" -" http://software-carpentry.org/), provide a [link to the\n" -" license][cc-by-human], and indicate if changes were made. You may do\n" -" so in any reasonable manner, but not in any way that suggests the\n" -" licensor endorses you or your use." -msgstr "" -" your work is derived from work that is Copyright © Software\n" -" Carpentry and, where practical, linking to\n" -" http://software-carpentry.org/), provide a [link to the\n" -" license][cc-by-human], and indicate if changes were made. You may do\n" -" so in any reasonable manner, but not in any way that suggests the\n" -" licensor endorses you or your use." - -#: shell-novice/LICENSE.md:34 -msgid "" -"**No additional restrictions**---You may not apply legal terms or\n" -"technological measures that legally restrict others from doing\n" -"anything the license permits. With the understanding that:" -msgstr "" -"**No additional restrictions**---You may not apply legal terms or\n" -"technological measures that legally restrict others from doing\n" -"anything the license permits. With the understanding that:" - -#: shell-novice/LICENSE.md:38 -msgid "Notices:" -msgstr "Notices:" - -# unordered list -#: shell-novice/LICENSE.md:40 -msgid "* You do not have to comply with the license for elements of the" -msgstr "* You do not have to comply with the license for elements of the" - -#: shell-novice/LICENSE.md:41 -msgid "" -" material in the public domain or where your use is permitted by an\n" -" applicable exception or limitation.\n" -"* No warranties are given. The license may not give you all of the\n" -" permissions necessary for your intended use. For example, other\n" -" rights such as publicity, privacy, or moral rights may limit how you\n" -" use the material." -msgstr "" -" material in the public domain or where your use is permitted by an\n" -" applicable exception or limitation.\n" -"* No warranties are given. The license may not give you all of the\n" -" permissions necessary for your intended use. For example, other\n" -" rights such as publicity, privacy, or moral rights may limit how you\n" -" use the material." - -# header -#: shell-novice/LICENSE.md:48 -msgid "## Software" -msgstr "## Software" - -#: shell-novice/LICENSE.md:50 -msgid "" -"Except where otherwise noted, the example programs and other software\n" -"provided by Software Carpentry and Data Carpentry are made available under the\n" -"[OSI][osi]-approved\n" -"[MIT license][mit-license]." -msgstr "" -"Except where otherwise noted, the example programs and other software\n" -"provided by Software Carpentry and Data Carpentry are made available under the\n" -"[OSI][osi]-approved\n" -"[MIT license][mit-license]." - -#: shell-novice/LICENSE.md:55 -msgid "" -"Permission is hereby granted, free of charge, to any person obtaining\n" -"a copy of this software and associated documentation files (the\n" -"\"Software\"), to deal in the Software without restriction, including\n" -"without limitation the rights to use, copy, modify, merge, publish,\n" -"distribute, sublicense, and/or sell copies of the Software, and to\n" -"permit persons to whom the Software is furnished to do so, subject to\n" -"the following conditions:" -msgstr "" -"Permission is hereby granted, free of charge, to any person obtaining\n" -"a copy of this software and associated documentation files (the\n" -"\"Software\"), to deal in the Software without restriction, including\n" -"without limitation the rights to use, copy, modify, merge, publish,\n" -"distribute, sublicense, and/or sell copies of the Software, and to\n" -"permit persons to whom the Software is furnished to do so, subject to\n" -"the following conditions:" - -#: shell-novice/LICENSE.md:63 -msgid "" -"The above copyright notice and this permission notice shall be\n" -"included in all copies or substantial portions of the Software." -msgstr "" -"The above copyright notice and this permission notice shall be\n" -"included in all copies or substantial portions of the Software." - -#: shell-novice/LICENSE.md:66 -msgid "" -"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" -"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" -"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" -"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n" -"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n" -"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" -"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -msgstr "" -"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" -"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" -"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" -"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n" -"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n" -"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" -"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - -# header -#: shell-novice/LICENSE.md:74 -msgid "## Trademark" -msgstr "## Trademark" - -#: shell-novice/LICENSE.md:76 -msgid "" -"\"Software Carpentry\" and \"Data Carpentry\" and their respective logos\n" -"are registered trademarks of [Community Initiatives][CI]." -msgstr "" -"\"Software Carpentry\" and \"Data Carpentry\" and their respective logos\n" -"are registered trademarks of [Community Initiatives][CI]." - -#: shell-novice/LICENSE.md:79 -msgid "" -"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" -"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" -"[mit-license]: http://opensource.org/licenses/mit-license.html\n" -"[ci]: http://communityin.org/\n" -"[osi]: http://opensource.org" -msgstr "" -"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" -"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" -"[mit-license]: http://opensource.org/licenses/mit-license.html\n" -"[ci]: http://communityin.org/\n" -"[osi]: http://opensource.org" - -#: shell-novice/README.md:1 -msgid "" -"shell-novice\n" -"============" -msgstr "" -"shell-novice\n" -"============" - -#: shell-novice/README.md:4 -msgid "" -"An introduction to the Unix shell for people who have never used the command line before.\n" -"Please see for a rendered version of this material,\n" -"[the lesson template documentation][lesson-example]\n" -"for instructions on formatting, building, and submitting material,\n" -"or run `make` in this directory for a list of helpful commands." -msgstr "" -"An introduction to the Unix shell for people who have never used the command line before.\n" -"Please see for a rendered version of this material,\n" -"[the lesson template documentation][lesson-example]\n" -"for instructions on formatting, building, and submitting material,\n" -"or run `make` in this directory for a list of helpful commands." - -#: shell-novice/README.md:10 -msgid "Maintainers:" -msgstr "Maintainers:" - -# unordered list -#: shell-novice/README.md:12 -msgid "* [Gabriel Devenyi][devenyi_gabriel]" -msgstr "* [Gabriel Devenyi][devenyi_gabriel]" - -# unordered list -#: shell-novice/README.md:13 -msgid "* [Ashwin Srinath][srinath_ashwin]" -msgstr "* [Ashwin Srinath][srinath_ashwin]" - -# unordered list -#: shell-novice/README.md:14 -msgid "* [Colin Morris][colin_morris]" -msgstr "* [Colin Morris][colin_morris]" - -# unordered list -#: shell-novice/README.md:15 -msgid "* [Will Pitchers][will_pitchers]" -msgstr "* [Will Pitchers][will_pitchers]" - -#: shell-novice/README.md:17 -msgid "" -"[devenyi_gabriel]: http://software-carpentry.org/team/#devenyi_gabriel\n" -"[srinath_ashwin]: http://software-carpentry.org/team/#srinath_ashwin\n" -"[colin_morris]: https://github.com/colinmorris\n" -"[will_pitchers]: https://software-carpentry.org/team/#pitchers_w\n" -"[lesson-example]: https://swcarpentry.github.io/lesson-example/" -msgstr "" -"[devenyi_gabriel]: http://software-carpentry.org/team/#devenyi_gabriel\n" -"[srinath_ashwin]: http://software-carpentry.org/team/#srinath_ashwin\n" -"[colin_morris]: https://github.com/colinmorris\n" -"[will_pitchers]: https://software-carpentry.org/team/#pitchers_w\n" -"[lesson-example]: https://swcarpentry.github.io/lesson-example/" - -# Front Matter -#: shell-novice/_episodes/01-intro.md:1 -msgid "" -"---\n" -"title: \"Introducing the Shell\"\n" -"teaching: 5\n" -"exercises: 0\n" -"questions:\n" -"- \"What is a command shell and why would I use one?\"\n" -"objectives:\n" -"- \"Explain how the shell relates to the keyboard, the screen, the operating system, and users' programs.\"\n" -"- \"Explain when and why command-line interfaces should be used instead of graphical interfaces.\"\n" -"keypoints:\n" -"- \"Explain the steps in the shell's read-run-print cycle.\"\n" -"- \"Most commands take flags (options) which begin with a `-`.\"\n" -"- \"Identify the actual command, flags, and filenames in a command-line call.\"\n" -"- \"Explain the steps in the shell's read-run-print cycle.\"\n" -"- \"Demonstrate the use of tab completion and explain its advantages.\"\n" -"keypoints:\n" -"- \"A shell is a program whose primary purpose is to read commands and run other programs.\"\n" -"- \"The shell's main advantages are its high action-to-keystroke ratio, its support for automating repetitive tasks, and its capacity to access networked machines.\"\n" -"- \"The shell's main disadvantages are its primarily textual nature and how cryptic its commands and operation can be.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Introducing the Shell\"\n" -"teaching: 5\n" -"exercises: 0\n" -"questions:\n" -"- \"What is a command shell and why would I use one?\"\n" -"objectives:\n" -"- \"Explain how the shell relates to the keyboard, the screen, the operating system, and users' programs.\"\n" -"- \"Explain when and why command-line interfaces should be used instead of graphical interfaces.\"\n" -"keypoints:\n" -"- \"Explain the steps in the shell's read-run-print cycle.\"\n" -"- \"Most commands take flags (options) which begin with a `-`.\"\n" -"- \"Identify the actual command, flags, and filenames in a command-line call.\"\n" -"- \"Explain the steps in the shell's read-run-print cycle.\"\n" -"- \"Demonstrate the use of tab completion and explain its advantages.\"\n" -"keypoints:\n" -"- \"A shell is a program whose primary purpose is to read commands and run other programs.\"\n" -"- \"The shell's main advantages are its high action-to-keystroke ratio, its support for automating repetitive tasks, and its capacity to access networked machines.\"\n" -"- \"The shell's main disadvantages are its primarily textual nature and how cryptic its commands and operation can be.\"\n" -"---" - -# header -#: shell-novice/_episodes/01-intro.md:21 -msgid "### Background" -msgstr "### 背景" - -#: shell-novice/_episodes/01-intro.md:22 -msgid "At a high level, computers do four things:" -msgstr "大まかにいうと、コンピューターは以下の4つのことをおこなっています:" - -# unordered list -#: shell-novice/_episodes/01-intro.md:24 -msgid "- run programs" -msgstr "- プログラムを実行する" - -# unordered list -#: shell-novice/_episodes/01-intro.md:25 -msgid "- store data" -msgstr "- データを保存する" - -# unordered list -#: shell-novice/_episodes/01-intro.md:26 -msgid "- communicate with each other, and" -msgstr "- 他のコンピューターとやりとりをする" - -# unordered list -#: shell-novice/_episodes/01-intro.md:27 -msgid "- interact with us" -msgstr "- 私たちとやりとりをする" - -#: shell-novice/_episodes/01-intro.md:29 -msgid "" -"They can do the last of these in many different ways,\n" -"including through a keyboard and mouse, or touch screen interfaces, or speech recognition using systems.\n" -"While such hardware interfaces are becoming more commonplace, most interaction is still\n" -"done using screens, mice, touchpads and keyboards." -msgstr "" -"私たちとのやりとりは様々な方法で行います。\n" -"例えば、キーボードやマウスを使ったり、タッチスクリーンを使ったり、音声認識を使ったりです。\n" -"このようなハードウェアインターフェイスは一般的になりつつありますが、ほとんどのやりとりはまだ\n" -"画面とマウスやタッチパッドとキーボードを用いて行われます。" - -#: shell-novice/_episodes/01-intro.md:34 -msgid "" -"We are all familiar with **graphical user interfaces** (GUI - windows, icons and pointers). \n" -"They are easy to learn and fantastic for simple tasks where a vocabulary consisting of\n" -"\"click\" translates easily into \"do the thing I want\". But this magic relies on \n" -"wanting a simple set of things, and having programs that can do exactly those things." -msgstr "" -"私たちは皆「グラフィカルユーザーインターフェイス (GUI)」とよばれる、ウインドウやアイコンやポインターで操作することに慣れています。\n" -"それらは簡単になれることができ、単純なタスクをこなすのには適しています。\n" -"「クリック」は「やりたいことをやってください」を意味します。 \n" -"しかし、この魔法のような単純さは、やりたいことが単純で、それを行うプログラムが存在していなければなりません。" - -#: shell-novice/_episodes/01-intro.md:39 -msgid "" -"If you wish to do complex, purpose-specific things it helps to have a richer means\n" -"of expressing your instructions to the computer. It doesn't need to be complicated or\n" -"difficult, just a vocabulary of commands and a simple grammar for using them." -msgstr "" -"より複雑なことや目的がはっきりしたことをコンピュータにさせたい時には、\n" -"単純なクリックのみよりも意味のある指示の表現方法があると便利です。\n" -"その表現方法は複雑で難解である必要はなく\n" -"簡単な語句とシンプルな文法で表記できれば良いのです。" - -#: shell-novice/_episodes/01-intro.md:43 -msgid "" -"This is what the shell provides - a simple language and a **command-line interface** \n" -"to use it through. " -msgstr "これがまさにシェルが提供するもので、シンプルな言語と「コマンドラインインターフェイス」でコンピュータに指示を出します。 " - -#: shell-novice/_episodes/01-intro.md:46 -msgid "" -"The heart of a command-line interface is a **read-evaluate-print loop**, or REPL, called\n" -"so because when you type a command and press the Enter (or Return) key, the shell:\n" -"1. Reads it\n" -"2. Executes (or \"evaluates\" it)\n" -"3. Prints the output" -msgstr "" -"コマンドラインインターフェースの核は、REPL (read-evaluate-print-loop)と呼ばれています。\n" -"これは、シェルにコマンドを入力し、Enter(または Return)キーを押した時に起こる動作:\n" -"1. コマンドを読み込む(Read)\n" -"2. コマンドを実行する (または \"評価する\" - Evaluate)\n" -"3. 結果を出力する (Print)" - -#: shell-novice/_episodes/01-intro.md:52 -msgid "and then prints the prompt and waits for you to enter another command." -msgstr "そして、プロンプトで次のコマンドの入力を待ち、1〜3の動作を繰り返す(Loop)ことから、頭文字を取ってREPLと呼ばれています。" - -# header -#: shell-novice/_episodes/01-intro.md:54 -msgid "### The Shell" -msgstr "### シェル" - -#: shell-novice/_episodes/01-intro.md:56 -msgid "" -"A shell is a program like any other.\n" -"What's special about it is that its job is to run other programs\n" -"rather than to do calculations itself.\n" -"The most popular Unix shell is Bash,\n" -"the Bourne Again SHell\n" -"(so-called because it's derived from a shell written by Stephen Bourne).\n" -"Bash is the default shell on most modern implementations of Unix\n" -"and in most packages that provide Unix-like tools for Windows." -msgstr "" -"シェルは他のプログラムと同じようなものです。\n" -"シェルの何が特別なのかというと、シェルは計算をするものでなく、\n" -"他のプログラムを実行するものというところにあります。\n" -"最も人気のある Unix シェルは、Bash、Bourne Again SHell です\n" -" (これは Stephen Bourne によって書かれたシェルから派生したものであるためそう呼ばれています)。\n" -"Bash はほとんどの最新の Unix の搭載されたもののデフォルトシェルであり、\n" -"Windows 用の Unix のようなツールを提供するほとんどのパッケージで使われています。" - -# header -#: shell-novice/_episodes/01-intro.md:65 -msgid "### What does it look like?" -msgstr "### シェルコマンドはどのようなものですか?" - -#: shell-novice/_episodes/01-intro.md:67 -msgid "A typical shell command and output looks something like this:" -msgstr "典型的なシェルコマンドとその出力はこのようなものです:" - -# code block -#: shell-novice/_episodes/01-intro.md:69 -msgid "" -"~~~\n" -"bash-3.2$ \n" -"bash-3.2$ ls -F / \n" -"Applications/ System/\n" -"Library/ Users/\n" -"Network/ Volumes/\n" -"bash-3.2$ \n" -"~~~" -msgstr "" -"~~~\n" -"bash-3.2$ \n" -"bash-3.2$ ls -F / \n" -"Applications/ System/\n" -"Library/ Users/\n" -"Network/ Volumes/\n" -"bash-3.2$ \n" -"~~~" - -#: shell-novice/_episodes/01-intro.md:77 -#: shell-novice/_episodes/02-filedir.md:50 -#: shell-novice/_episodes/02-filedir.md:129 -#: shell-novice/_episodes/02-filedir.md:152 -#: shell-novice/_episodes/02-filedir.md:201 -#: shell-novice/_episodes/02-filedir.md:409 -#: shell-novice/_episodes/02-filedir.md:437 -#: shell-novice/_episodes/02-filedir.md:464 -#: shell-novice/_episodes/02-filedir.md:477 -#: shell-novice/_episodes/02-filedir.md:487 -#: shell-novice/_episodes/02-filedir.md:501 -#: shell-novice/_episodes/02-filedir.md:521 -#: shell-novice/_episodes/02-filedir.md:533 -#: shell-novice/_episodes/02-filedir.md:546 -#: shell-novice/_episodes/02-filedir.md:599 -#: shell-novice/_episodes/02-filedir.md:606 -#: shell-novice/_episodes/02-filedir.md:623 -#: shell-novice/_episodes/02-filedir.md:650 -#: shell-novice/_episodes/02-filedir.md:660 -#: shell-novice/_episodes/02-filedir.md:799 -#: shell-novice/_episodes/02-filedir.md:808 -#: shell-novice/_episodes/02-filedir.md:816 -#: shell-novice/_episodes/03-create.md:30 -#: shell-novice/_episodes/03-create.md:40 -#: shell-novice/_episodes/03-create.md:53 -#: shell-novice/_episodes/03-create.md:64 -#: shell-novice/_episodes/03-create.md:112 -#: shell-novice/_episodes/03-create.md:121 -#: shell-novice/_episodes/03-create.md:183 -#: shell-novice/_episodes/03-create.md:236 -#: shell-novice/_episodes/03-create.md:246 -#: shell-novice/_episodes/03-create.md:265 -#: shell-novice/_episodes/03-create.md:276 -#: shell-novice/_episodes/03-create.md:286 -#: shell-novice/_episodes/03-create.md:294 -#: shell-novice/_episodes/03-create.md:309 -#: shell-novice/_episodes/03-create.md:353 -#: shell-novice/_episodes/03-create.md:365 -#: shell-novice/_episodes/03-create.md:379 -#: shell-novice/_episodes/03-create.md:392 -#: shell-novice/_episodes/03-create.md:419 -#: shell-novice/_episodes/03-create.md:427 -#: shell-novice/_episodes/03-create.md:436 -#: shell-novice/_episodes/03-create.md:484 -#: shell-novice/_episodes/03-create.md:499 -#: shell-novice/_episodes/04-pipefilter.md:37 -#: shell-novice/_episodes/04-pipefilter.md:55 -#: shell-novice/_episodes/04-pipefilter.md:177 -#: shell-novice/_episodes/04-pipefilter.md:201 -#: shell-novice/_episodes/04-pipefilter.md:215 -#: shell-novice/_episodes/04-pipefilter.md:275 -#: shell-novice/_episodes/04-pipefilter.md:351 -#: shell-novice/_episodes/04-pipefilter.md:374 -#: shell-novice/_episodes/04-pipefilter.md:413 -#: shell-novice/_episodes/04-pipefilter.md:437 -#: shell-novice/_episodes/04-pipefilter.md:455 -#: shell-novice/_episodes/04-pipefilter.md:746 -#: shell-novice/_episodes/04-pipefilter.md:766 -#: shell-novice/_episodes/04-pipefilter.md:788 -#: shell-novice/_episodes/04-pipefilter.md:808 -#: shell-novice/_episodes/05-loop.md:39 shell-novice/_episodes/05-loop.md:46 -#: shell-novice/_episodes/05-loop.md:70 shell-novice/_episodes/05-loop.md:223 -#: shell-novice/_episodes/05-loop.md:233 shell-novice/_episodes/05-loop.md:295 -#: shell-novice/_episodes/05-loop.md:306 shell-novice/_episodes/05-loop.md:327 -#: shell-novice/_episodes/05-loop.md:392 shell-novice/_episodes/05-loop.md:402 -#: shell-novice/_episodes/05-loop.md:409 shell-novice/_episodes/05-loop.md:439 -#: shell-novice/_episodes/05-loop.md:462 shell-novice/_episodes/05-loop.md:489 -#: shell-novice/_episodes/05-loop.md:497 shell-novice/_episodes/05-loop.md:511 -#: shell-novice/_episodes/06-script.md:36 -#: shell-novice/_episodes/06-script.md:64 -#: shell-novice/_episodes/06-script.md:99 -#: shell-novice/_episodes/06-script.md:115 -#: shell-novice/_episodes/06-script.md:131 -#: shell-novice/_episodes/06-script.md:157 -#: shell-novice/_episodes/06-script.md:169 -#: shell-novice/_episodes/06-script.md:186 -#: shell-novice/_episodes/06-script.md:204 -#: shell-novice/_episodes/06-script.md:226 -#: shell-novice/_episodes/06-script.md:248 -#: shell-novice/_episodes/06-script.md:260 -#: shell-novice/_episodes/06-script.md:351 -#: shell-novice/_episodes/06-script.md:411 -#: shell-novice/_episodes/06-script.md:419 -#: shell-novice/_episodes/06-script.md:426 -#: shell-novice/_episodes/06-script.md:443 shell-novice/_episodes/07-find.md:39 -#: shell-novice/_episodes/07-find.md:69 shell-novice/_episodes/07-find.md:87 -#: shell-novice/_episodes/07-find.md:107 shell-novice/_episodes/07-find.md:123 -#: shell-novice/_episodes/07-find.md:141 shell-novice/_episodes/07-find.md:159 -#: shell-novice/_episodes/07-find.md:172 shell-novice/_episodes/07-find.md:187 -#: shell-novice/_episodes/07-find.md:207 shell-novice/_episodes/07-find.md:405 -#: shell-novice/_episodes/07-find.md:442 shell-novice/_episodes/07-find.md:460 -#: shell-novice/_episodes/07-find.md:479 shell-novice/_episodes/07-find.md:495 -#: shell-novice/_episodes/07-find.md:508 shell-novice/_episodes/07-find.md:539 -#: shell-novice/_episodes/07-find.md:559 shell-novice/_episodes/07-find.md:574 -msgid "{: .language-bash}" -msgstr "{: .language-bash}" - -#: shell-novice/_episodes/01-intro.md:79 -msgid "" -"The first line shows only a **prompt**, indicating that the shell is waiting\n" -"for input. Your shell may use different text for the prompt. Most importantly: \n" -"when typing commands, either from these lessons or from other sources,\n" -"*do not type the prompt*, only the commands that follow it." -msgstr "" -"最初の行には **プロンプト** だけが表示され、シェルが入力を待っていることを表します。\n" -"お使いのシェルはプロンプトに異なるテキストを使用しているかもしれません。最も重要なことは\n" -"これからのレッスンや他のソースからコマンドを入力する時には\n" -"*プロンプト*は入力せず、それに続くコマンドのみを入力してください。" - -#: shell-novice/_episodes/01-intro.md:84 -msgid "" -"The part that you type (in this example `ls -F /`)\n" -"typically has the following structure: a **command**,\n" -"some **flags** (also called **options** or **switches**) and an **argument**.\n" -"Flags start with a dash (`-`), and change the behaviour of a command.\n" -"Arguments tell the command what to operate on (e.g. files and directories).\n" -"Sometimes flags and arguments are referred to as parameters.\n" -"A command can be called with more than one flag and more than one argument: but a\n" -"command doesn't always require an argument or a flag." -msgstr "" -"入力する部分(この例では `ls -F /`)は通常、次のような構造になっています: \n" -"**コマンド**、いくつかの**フラグ**(**オプション**または**スイッチ**とも呼ばれます)、**引数**。\n" -"フラグはダッシュ(`-`)で始まり、コマンドの動作を変更します。引数は、コマンドが何を操作するかを指定します (ファイルやディレクトリなど)。フラグや引数はパラメータと呼ばれることもあります。\n" -"コマンドは複数のフラグと複数の引数を使って呼び出すこともできますし、\n" -"必ずしも引数やフラグを必要としません。" - -#: shell-novice/_episodes/01-intro.md:93 -msgid "" -"In the example above, our **command** is `ls`, with a **flag** `-F` and an\n" -"**argument** `/`. Each part is separated by spaces: if you omit the space \n" -"between `ls` and `-F` the shell will look for a command called `ls-F`, which \n" -"doesn't exist. Also, capitalization matters: `LS` is different to `ls`. " -msgstr "" -"上の例では、**コマンド** は `ls` であり、**フラグ** `-F` と**引数** `/` があります。\n" -"これらのパラメータはスペースで分けられます。\n" -"もし`ls` と `-F` の間のスペースを省略すれば、シェルは `ls-F` というコマンドを探しますが、そのようなコマンドはありません。\n" -"また、大文字小文字も問題になります。`LS` は `ls` とは異なります。 " - -#: shell-novice/_episodes/01-intro.md:98 -msgid "" -"Next we see the output that our command produced. In this case it is a listing \n" -"of files and folders in a location called `/` - we'll cover what all these mean \n" -"later today. Those with a Mac might recognize the output in this example." -msgstr "" -"次に、コマンドを実行し出てきた出力を見てみましょう。\n" -"この場合、`/`と呼ばれる場所にあるファイルとフォルダのリストが表示されます。\n" -"これらが何を意味するかは今日の後ほど学びます。\n" -"Macをお持ちの方は、この例の出力がわかるかもしれません。" - -#: shell-novice/_episodes/01-intro.md:102 -msgid "" -"Finally, the shell again prints the prompt and waits for you to type the next \n" -"command." -msgstr "最後に、シェルは再びプロンプトを表示し、あなたが次のコマンドを入力するのを待ちます。" - -#: shell-novice/_episodes/01-intro.md:105 -msgid "" -"In the examples for this lesson, we'll show the prompt as `$ `. You can make your \n" -"prompt look the same by entering the command `PS1='$ '`. But you can also leave \n" -"your prompt as it is - often the prompt includes useful information about who and where \n" -"you are." -msgstr "これからレッスンの例では、プロンプトを `$ ` として表示します。コマンド `PS1=‘$ ‘` を入力することで、プロンプトを同じように表示することができます。しかし、プロンプトをそのままにしておくこともできます - プロンプトには、あなたが誰でどこにいるのかという有用な情報が含まれていることがよくあります。" - -#: shell-novice/_episodes/01-intro.md:110 -msgid "" -"Open a shell window and try entering `ls -F /` for yourself (don't forget that spaces\n" -"and capitalization are important!). You can change the prompt too, if you like." -msgstr "" -"シェルのウィンドウを開いて、”ls -F”と入力してみましょう。\n" -"(半角スペースを忘れないでください。大文字か小文字かも大事です。)\n" -"もしプロンプトを変更したければ、変更しても構いません。" - -# header -#: shell-novice/_episodes/01-intro.md:113 -msgid "### How does the shell know what `ls` and its flags mean?" -msgstr "### シェルはどのようにして”ls”やフラッグを判断するか" - -#: shell-novice/_episodes/01-intro.md:115 -msgid "" -"Every command is a program stored somewhere on the computer, and the shell keeps a\n" -"list of places to search for commands (the list is in a **variable** called `$PATH`, \n" -"but those are concepts we'll meet later and not too important at the moment). Recall\n" -"that commands, flags and arguments are separated by spaces." -msgstr "" -"すべてのコマンドはコンピュータのどこかに保存されているプログラムであり、\n" -"シェルはそのコマンドを検索する場所のリストを保持しています。 \n" -"(リストは `$PATH` という**変数**にありますが、これは後ほど説明する概念であり、今のところあまり重要ではありません)。\n" -"コマンド、フラグ、引数はスペースで区切られていることを覚えておいてください。" - -#: shell-novice/_episodes/01-intro.md:120 -msgid "" -"So let's look at the REPL (read-evaluate-print loop) in more detail. Notice that the\n" -"\"evaluate\" step is made of two parts:" -msgstr "" -"続いてREPL(read-evaluate-print loop)についてもう少し詳しく見ていきましょう。\n" -"evaluateのステップは大きく分けて二つの部分からなります。" - -# ordered list -#: shell-novice/_episodes/01-intro.md:123 -msgid "1. Read what was typed (`ls -F /` in our example) " -msgstr "1. 何が入力されたかを読み込みます。私たちの例では `ls -F /` となります。 " - -#: shell-novice/_episodes/01-intro.md:124 -msgid "" -" The shell uses the spaces to split the line into the command, flags, and arguments\n" -"2. Evaluate: \n" -" a. Find a program called `ls` \n" -" b. Execute it, passing it the flags and arguments (`-F` and `/`) to \n" -" interpret as the program sees fit \n" -"3. Print the output produced by the program" -msgstr "" -" シェルは半角スペースによって、1行の入力はコマンド、フラグ、引数に分けます。 \n" -"2. 評価します: \n" -" a. ls と呼ばれるプログラムがあるか探します \n" -" b. それを実行しプログラムが適切に実行されるようにフラグや引数をそれに引き渡します。\n" -"3. プログラムによって生成された結果を表示します。 " - -#: shell-novice/_episodes/01-intro.md:131 -msgid "and then print the prompt and wait for you to enter another command." -msgstr "and then print the prompt and wait for you to enter another command." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:133 -msgid "> ## Command not found " -msgstr "> ## Command not found " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:134 -msgid "> If the shell can't find a program whose name is the command you typed, it " -msgstr "> If the shell can't find a program whose name is the command you typed, it " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:135 -msgid "> will print an erorr message like:" -msgstr "> will print an erorr message like:" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:136 -#: shell-novice/_episodes/01-intro.md:142 shell-novice/_episodes/05-loop.md:349 -#: shell-novice/_episodes/05-loop.md:351 shell-novice/_episodes/07-find.md:283 -#: shell-novice/_episodes/07-find.md:286 shell-novice/_episodes/07-find.md:661 -msgid "> " -msgstr "> " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:137 -#: shell-novice/_episodes/01-intro.md:140 -#: shell-novice/_episodes/03-create.md:570 -#: shell-novice/_episodes/03-create.md:572 -#: shell-novice/_episodes/03-create.md:574 -#: shell-novice/_episodes/03-create.md:576 -#: shell-novice/_episodes/03-create.md:578 -#: shell-novice/_episodes/03-create.md:583 -#: shell-novice/_episodes/03-create.md:633 -#: shell-novice/_episodes/03-create.md:635 -#: shell-novice/_episodes/03-create.md:637 -#: shell-novice/_episodes/03-create.md:639 -#: shell-novice/_episodes/03-create.md:675 -#: shell-novice/_episodes/03-create.md:677 -#: shell-novice/_episodes/05-loop.md:352 shell-novice/_episodes/05-loop.md:357 -#: shell-novice/_episodes/07-find.md:287 shell-novice/_episodes/07-find.md:293 -msgid "> ~~~" -msgstr "> ~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:138 -msgid "> $ ls-F" -msgstr "> $ ls-F" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:139 -msgid "> -bash: ls-F: command not found" -msgstr "> -bash: ls-F: command not found" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:141 -#: shell-novice/_episodes/03-create.md:573 -#: shell-novice/_episodes/03-create.md:584 -#: shell-novice/_episodes/03-create.md:636 -#: shell-novice/_episodes/03-create.md:678 -#: shell-novice/_episodes/05-loop.md:358 -msgid "> {: .language-bash}" -msgstr "> {: .language-bash}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:143 -msgid "> Usually this means that you have mis-typed the command - in this case we omitted" -msgstr "> 通常これは、あなたがコマンドをタイプミスしたことを意味します。このケースでは" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/01-intro.md:144 -msgid "> the space between `ls` and `-F`. " -msgstr "> `ls` と `-F` の間に空白を忘れています。 " - -# SC/DC Template label -#: shell-novice/_episodes/01-intro.md:145 -#: shell-novice/_episodes/02-filedir.md:70 -#: shell-novice/_episodes/02-filedir.md:107 -#: shell-novice/_episodes/02-filedir.md:190 -#: shell-novice/_episodes/02-filedir.md:337 -#: shell-novice/_episodes/02-filedir.md:576 -#: shell-novice/_episodes/02-filedir.md:589 -#: shell-novice/_episodes/02-filedir.md:678 -#: shell-novice/_episodes/02-filedir.md:781 -#: shell-novice/_episodes/03-create.md:77 -#: shell-novice/_episodes/03-create.md:105 -#: shell-novice/_episodes/03-create.md:145 -#: shell-novice/_episodes/03-create.md:175 -#: shell-novice/_episodes/03-create.md:257 -#: shell-novice/_episodes/03-create.md:344 -#: shell-novice/_episodes/03-create.md:532 -#: shell-novice/_episodes/04-pipefilter.md:99 -#: shell-novice/_episodes/04-pipefilter.md:297 -#: shell-novice/_episodes/04-pipefilter.md:402 -#: shell-novice/_episodes/04-pipefilter.md:558 -#: shell-novice/_episodes/05-loop.md:85 shell-novice/_episodes/05-loop.md:195 -#: shell-novice/_episodes/05-loop.md:209 shell-novice/_episodes/05-loop.md:381 -#: shell-novice/_episodes/05-loop.md:517 shell-novice/_episodes/05-loop.md:563 -#: shell-novice/_episodes/05-loop.md:579 shell-novice/_episodes/06-script.md:89 -#: shell-novice/_episodes/06-script.md:147 -#: shell-novice/_episodes/06-script.md:337 shell-novice/_episodes/07-find.md:62 -#: shell-novice/_episodes/07-find.md:280 shell-novice/_episodes/07-find.md:524 -#: shell-novice/_episodes/07-find.md:631 shell-novice/setup.md:63 -msgid "{: .callout}" -msgstr "{: .callout}" - -# header -#: shell-novice/_episodes/01-intro.md:147 -msgid "### Is it difficult?" -msgstr "### Is it difficult?" - -#: shell-novice/_episodes/01-intro.md:149 -msgid "" -"It isn't difficult, but it is a different model of interacting than a GUI, and that \n" -"will take some effort - and some time - to learn. A GUI \n" -"presents you with choices and you select one. With a CLI the choices are combinations \n" -"of commands and parameters, more like words in a language than buttons on a screen. They\n" -"are not presented to you so\n" -"you must learn a few, like learning some vocabulary in a new language. But a small \n" -"number of commands gets you a long way, and we'll cover those essential few today." -msgstr "" -"It isn't difficult, but it is a different model of interacting than a GUI, and that \n" -"will take some effort - and some time - to learn. A GUI \n" -"presents you with choices and you select one. With a CLI the choices are combinations \n" -"of commands and parameters, more like words in a language than buttons on a screen. They\n" -"are not presented to you so\n" -"you must learn a few, like learning some vocabulary in a new language. But a small \n" -"number of commands gets you a long way, and we'll cover those essential few today." - -# header -#: shell-novice/_episodes/01-intro.md:157 -msgid "### Flexibility and automation " -msgstr "### Flexibility and automation " - -#: shell-novice/_episodes/01-intro.md:159 -msgid "" -"The grammar of a shell allows you to combine existing tools into powerful\n" -"pipelines and handle large volumes of data automatically. Sequences of\n" -"commands can be written into a *script*, improving the reproducibility of \n" -"workflows and allowing you to repeat them easily." -msgstr "" -"The grammar of a shell allows you to combine existing tools into powerful\n" -"pipelines and handle large volumes of data automatically. Sequences of\n" -"commands can be written into a *script*, improving the reproducibility of \n" -"workflows and allowing you to repeat them easily." - -#: shell-novice/_episodes/01-intro.md:164 -msgid "" -"In addition, the command line is often the easiest way to interact with remote machines and supercomputers.\n" -"Familiarity with the shell is near essential to run a variety of specialized tools and resources\n" -"including high-performance computing systems.\n" -"As clusters and cloud computing systems become more popular for scientific data crunching,\n" -"being able to interact with the shell is becoming a necessary skill.\n" -"We can build on the command-line skills covered here\n" -"to tackle a wide range of scientific questions and computational challenges." -msgstr "" -"In addition, the command line is often the easiest way to interact with remote machines and supercomputers.\n" -"Familiarity with the shell is near essential to run a variety of specialized tools and resources\n" -"including high-performance computing systems.\n" -"As clusters and cloud computing systems become more popular for scientific data crunching,\n" -"being able to interact with the shell is becoming a necessary skill.\n" -"We can build on the command-line skills covered here\n" -"to tackle a wide range of scientific questions and computational challenges." - -# header -#: shell-novice/_episodes/01-intro.md:172 -msgid "## Nelle's Pipeline: Starting Point" -msgstr "## Nelle's Pipeline: Starting Point" - -#: shell-novice/_episodes/01-intro.md:174 -msgid "" -"Nelle Nemo, a marine biologist,\n" -"has just returned from a six-month survey of the\n" -"[North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre),\n" -"where she has been sampling gelatinous marine life in the\n" -"[Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch).\n" -"She has 1520 samples in all and now needs to:" -msgstr "" -"Nelle Nemo, a marine biologist,\n" -"has just returned from a six-month survey of the\n" -"[North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre),\n" -"where she has been sampling gelatinous marine life in the\n" -"[Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch).\n" -"She has 1520 samples in all and now needs to:" - -# ordered list -#: shell-novice/_episodes/01-intro.md:181 -msgid "1. Run each sample through an assay machine" -msgstr "1. Run each sample through an assay machine" - -#: shell-novice/_episodes/01-intro.md:182 -msgid "" -" that will measure the relative abundance of 300 different proteins.\n" -" The machine's output for a single sample is\n" -" a file with one line for each protein.\n" -"2. Calculate statistics for each of the proteins separately\n" -" using a program her supervisor wrote called `goostats`.\n" -"3. Write up results.\n" -" Her supervisor would really like her to do this by the end of the month\n" -" so that her paper can appear in an upcoming special issue of *Aquatic Goo Letters*." -msgstr "" -" that will measure the relative abundance of 300 different proteins.\n" -" The machine's output for a single sample is\n" -" a file with one line for each protein.\n" -"2. Calculate statistics for each of the proteins separately\n" -" using a program her supervisor wrote called `goostats`.\n" -"3. Write up results.\n" -" Her supervisor would really like her to do this by the end of the month\n" -" so that her paper can appear in an upcoming special issue of *Aquatic Goo Letters*." - -#: shell-novice/_episodes/01-intro.md:191 -msgid "" -"It takes about half an hour for the assay machine to process each sample.\n" -"The good news is that\n" -"it only takes two minutes to set each one up.\n" -"Since her lab has eight assay machines that she can use in parallel,\n" -"this step will \"only\" take about two weeks." -msgstr "" -"It takes about half an hour for the assay machine to process each sample.\n" -"The good news is that\n" -"it only takes two minutes to set each one up.\n" -"Since her lab has eight assay machines that she can use in parallel,\n" -"this step will \"only\" take about two weeks." - -#: shell-novice/_episodes/01-intro.md:197 -msgid "" -"The bad news is that if she has to run `goostats` by hand,\n" -"she'll have to enter filenames and click \"OK\" 1520 times.\n" -"At 30 seconds per sample,\n" -"the whole process will take more than 12 hours\n" -"(and that's assuming the best-case scenario where she is ready to enter the next file name\n" -"as soon as the previous sample analysis has finished).\n" -"This zero-breaks always-ready scenario is only achieveable by a machine so it would\n" -"likely take much longer than 12 hours, not to mention that\n" -"the chances of her typing all of those commands correctly are practically zero.\n" -"Missing that paper deadline is looking increasingly likely." -msgstr "" -"The bad news is that if she has to run `goostats` by hand,\n" -"she'll have to enter filenames and click \"OK\" 1520 times.\n" -"At 30 seconds per sample,\n" -"the whole process will take more than 12 hours\n" -"(and that's assuming the best-case scenario where she is ready to enter the next file name\n" -"as soon as the previous sample analysis has finished).\n" -"This zero-breaks always-ready scenario is only achieveable by a machine so it would\n" -"likely take much longer than 12 hours, not to mention that\n" -"the chances of her typing all of those commands correctly are practically zero.\n" -"Missing that paper deadline is looking increasingly likely." - -#: shell-novice/_episodes/01-intro.md:208 -msgid "" -"The next few lessons will explore what she should do instead.\n" -"More specifically,\n" -"they explain how she can use a command shell\n" -"to automate the repetitive steps in her processing pipeline\n" -"so that her computer can work 24 hours a day while she writes her paper.\n" -"As a bonus,\n" -"once she has put a processing pipeline together,\n" -"she will be able to use it again whenever she collects more data." -msgstr "" -"The next few lessons will explore what she should do instead.\n" -"More specifically,\n" -"they explain how she can use a command shell\n" -"to automate the repetitive steps in her processing pipeline\n" -"so that her computer can work 24 hours a day while she writes her paper.\n" -"As a bonus,\n" -"once she has put a processing pipeline together,\n" -"she will be able to use it again whenever she collects more data." - -# Front Matter -#: shell-novice/_episodes/02-filedir.md:1 -msgid "" -"---\n" -"title: \"Navigating Files and Directories\"\n" -"teaching: 30\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I move around on my computer?\"\n" -"- \"How can I see what files and directories I have?\"\n" -"- \"How can I specify the location of a file or directory on my computer?\"\n" -"objectives:\n" -"- \"Explain the similarities and differences between a file and a directory.\"\n" -"- \"Translate an absolute path into a relative path and vice versa.\"\n" -"- \"Construct absolute and relative paths that identify specific files and directories.\"\n" -"- \"Demonstrate the use of tab completion, and explain its advantages.\"\n" -"keypoints:\n" -"- \"The file system is responsible for managing information on the disk.\"\n" -"- \"Information is stored in files, which are stored in directories (folders).\"\n" -"- \"Directories can also store other directories, which forms a directory tree.\"\n" -"- \"`cd path` changes the current working directory.\"\n" -"- \"`ls path` prints a listing of a specific file or directory; `ls` on its own lists the current working directory.\"\n" -"- \"`pwd` prints the user's current working directory.\"\n" -"- \"`whoami` shows the user's current identity.\"\n" -"- \"`/` on its own is the root directory of the whole file system.\"\n" -"- \"A relative path specifies a location starting from the current location.\"\n" -"- \"An absolute path specifies a location from the root of the file system.\"\n" -"- \"Directory names in a path are separated with `/` on Unix, but `\\\\\\\\` on Windows.\"\n" -"- \"`..` means 'the directory above the current one'; `.` on its own means 'the current directory'.\"\n" -"- \"Most files' names are `something.extension`. The extension isn't required, and doesn't guarantee anything, but is normally used to indicate the type of data in the file.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Navigating Files and Directories\"\n" -"teaching: 30\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I move around on my computer?\"\n" -"- \"How can I see what files and directories I have?\"\n" -"- \"How can I specify the location of a file or directory on my computer?\"\n" -"objectives:\n" -"- \"Explain the similarities and differences between a file and a directory.\"\n" -"- \"Translate an absolute path into a relative path and vice versa.\"\n" -"- \"Construct absolute and relative paths that identify specific files and directories.\"\n" -"- \"Demonstrate the use of tab completion, and explain its advantages.\"\n" -"keypoints:\n" -"- \"The file system is responsible for managing information on the disk.\"\n" -"- \"Information is stored in files, which are stored in directories (folders).\"\n" -"- \"Directories can also store other directories, which forms a directory tree.\"\n" -"- \"`cd path` changes the current working directory.\"\n" -"- \"`ls path` prints a listing of a specific file or directory; `ls` on its own lists the current working directory.\"\n" -"- \"`pwd` prints the user's current working directory.\"\n" -"- \"`whoami` shows the user's current identity.\"\n" -"- \"`/` on its own is the root directory of the whole file system.\"\n" -"- \"A relative path specifies a location starting from the current location.\"\n" -"- \"An absolute path specifies a location from the root of the file system.\"\n" -"- \"Directory names in a path are separated with `/` on Unix, but `\\\\\\\\` on Windows.\"\n" -"- \"`..` means 'the directory above the current one'; `.` on its own means 'the current directory'.\"\n" -"- \"Most files' names are `something.extension`. The extension isn't required, and doesn't guarantee anything, but is normally used to indicate the type of data in the file.\"\n" -"---" - -#: shell-novice/_episodes/02-filedir.md:30 -msgid "" -"The part of the operating system responsible for managing files and directories \n" -"is called the **file system**.\n" -"It organizes our data into files,\n" -"which hold information,\n" -"and directories (also called \"folders\"),\n" -"which hold files or other directories." -msgstr "" -"The part of the operating system responsible for managing files and directories \n" -"is called the **file system**.\n" -"It organizes our data into files,\n" -"which hold information,\n" -"and directories (also called \"folders\"),\n" -"which hold files or other directories." - -#: shell-novice/_episodes/02-filedir.md:37 -msgid "" -"Several commands are frequently used to create, inspect, rename, and delete files and directories.\n" -"To start exploring them, we'll go to our open shell window:" -msgstr "" -"Several commands are frequently used to create, inspect, rename, and delete files and directories.\n" -"To start exploring them, we'll go to our open shell window:" - -#: shell-novice/_episodes/02-filedir.md:40 -msgid "" -"First let's find out where we are by running a command called `pwd`\n" -"(which stands for \"print working directory\"). Directories are like *places* - at any time\n" -"while we are using the shell we are in exactly one place, called\n" -"our **current working directory**. Commands mostly read and write files in the \n" -"current working directory, i.e. \"here\", so knowing where you are before running\n" -"a command is important. `pwd` shows you where you are:" -msgstr "" -"First let's find out where we are by running a command called `pwd`\n" -"(which stands for \"print working directory\"). Directories are like *places* - at any time\n" -"while we are using the shell we are in exactly one place, called\n" -"our **current working directory**. Commands mostly read and write files in the \n" -"current working directory, i.e. \"here\", so knowing where you are before running\n" -"a command is important. `pwd` shows you where you are:" - -# code block -#: shell-novice/_episodes/02-filedir.md:47 -#: shell-novice/_episodes/02-filedir.md:474 -#: shell-novice/_episodes/02-filedir.md:530 -#: shell-novice/_episodes/02-filedir.md:603 -#: shell-novice/_episodes/02-filedir.md:647 -#: shell-novice/_episodes/03-create.md:27 -#: shell-novice/_episodes/03-create.md:262 -#: shell-novice/_episodes/03-create.md:350 -msgid "" -"~~~\n" -"$ pwd\n" -"~~~" -msgstr "" -"~~~\n" -"$ pwd\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:52 -#: shell-novice/_episodes/02-filedir.md:608 -msgid "" -"~~~\n" -"/Users/nelle\n" -"~~~" -msgstr "" -"~~~\n" -"/Users/nelle\n" -"~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:55 -#: shell-novice/_episodes/02-filedir.md:135 -#: shell-novice/_episodes/02-filedir.md:158 -#: shell-novice/_episodes/02-filedir.md:321 -#: shell-novice/_episodes/02-filedir.md:414 -#: shell-novice/_episodes/02-filedir.md:443 -#: shell-novice/_episodes/02-filedir.md:482 -#: shell-novice/_episodes/02-filedir.md:493 -#: shell-novice/_episodes/02-filedir.md:538 -#: shell-novice/_episodes/02-filedir.md:552 -#: shell-novice/_episodes/02-filedir.md:611 -#: shell-novice/_episodes/02-filedir.md:655 -#: shell-novice/_episodes/03-create.md:35 -#: shell-novice/_episodes/03-create.md:45 -#: shell-novice/_episodes/03-create.md:69 -#: shell-novice/_episodes/03-create.md:188 -#: shell-novice/_episodes/03-create.md:270 -#: shell-novice/_episodes/03-create.md:281 -#: shell-novice/_episodes/03-create.md:358 -#: shell-novice/_episodes/03-create.md:370 -#: shell-novice/_episodes/03-create.md:397 -#: shell-novice/_episodes/03-create.md:441 -#: shell-novice/_episodes/03-create.md:489 -#: shell-novice/_episodes/04-pipefilter.md:43 -#: shell-novice/_episodes/04-pipefilter.md:66 -#: shell-novice/_episodes/04-pipefilter.md:188 -#: shell-novice/_episodes/04-pipefilter.md:220 -#: shell-novice/_episodes/04-pipefilter.md:286 -#: shell-novice/_episodes/04-pipefilter.md:362 -#: shell-novice/_episodes/04-pipefilter.md:379 -#: shell-novice/_episodes/04-pipefilter.md:418 -#: shell-novice/_episodes/04-pipefilter.md:448 -#: shell-novice/_episodes/04-pipefilter.md:460 -#: shell-novice/_episodes/04-pipefilter.md:759 -#: shell-novice/_episodes/04-pipefilter.md:775 -#: shell-novice/_episodes/04-pipefilter.md:797 -#: shell-novice/_episodes/04-pipefilter.md:813 -#: shell-novice/_episodes/05-loop.md:80 shell-novice/_episodes/05-loop.md:313 -#: shell-novice/_episodes/05-loop.md:449 shell-novice/_episodes/05-loop.md:472 -#: shell-novice/_episodes/05-loop.md:528 shell-novice/_episodes/06-script.md:73 -#: shell-novice/_episodes/06-script.md:106 -#: shell-novice/_episodes/06-script.md:124 -#: shell-novice/_episodes/06-script.md:140 -#: shell-novice/_episodes/06-script.md:162 -#: shell-novice/_episodes/06-script.md:178 -#: shell-novice/_episodes/06-script.md:195 -#: shell-novice/_episodes/06-script.md:211 -#: shell-novice/_episodes/06-script.md:255 -#: shell-novice/_episodes/06-script.md:272 shell-novice/_episodes/07-find.md:54 -#: shell-novice/_episodes/07-find.md:76 shell-novice/_episodes/07-find.md:93 -#: shell-novice/_episodes/07-find.md:112 shell-novice/_episodes/07-find.md:128 -#: shell-novice/_episodes/07-find.md:148 shell-novice/_episodes/07-find.md:165 -#: shell-novice/_episodes/07-find.md:179 shell-novice/_episodes/07-find.md:200 -#: shell-novice/_episodes/07-find.md:230 shell-novice/_episodes/07-find.md:422 -#: shell-novice/_episodes/07-find.md:451 shell-novice/_episodes/07-find.md:472 -#: shell-novice/_episodes/07-find.md:484 shell-novice/_episodes/07-find.md:516 -#: shell-novice/_episodes/07-find.md:548 shell-novice/_episodes/07-find.md:579 -msgid "{: .output}" -msgstr "{: .output}" - -#: shell-novice/_episodes/02-filedir.md:57 -msgid "" -"Here,\n" -"the computer's response is `/Users/nelle`,\n" -"which is Nelle's **home directory**:" -msgstr "" -"Here,\n" -"the computer's response is `/Users/nelle`,\n" -"which is Nelle's **home directory**:" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:61 -msgid "> ## Home Directory Variation" -msgstr "> ## Home Directory Variation" - -#: shell-novice/_episodes/02-filedir.md:62 -msgid "" -">\n" -"> The home directory path will look different on different operating systems.\n" -"> On Linux it may look like `/home/nelle`,\n" -"> and on Windows it will be similar to `C:\\Documents and Settings\\nelle` or\n" -"> `C:\\Users\\nelle`. \n" -"> (Note that it may look slightly different for different versions of Windows.)\n" -"> In future examples, we've used Mac output as the default - Linux and Windows\n" -"> output may differ slightly, but should be generally similar. " -msgstr "" -">\n" -"> The home directory path will look different on different operating systems.\n" -"> On Linux it may look like `/home/nelle`,\n" -"> and on Windows it will be similar to `C:\\Documents and Settings\\nelle` or\n" -"> `C:\\Users\\nelle`. \n" -"> (Note that it may look slightly different for different versions of Windows.)\n" -"> In future examples, we've used Mac output as the default - Linux and Windows\n" -"> output may differ slightly, but should be generally similar. " - -#: shell-novice/_episodes/02-filedir.md:72 -msgid "" -"To understand what a \"home directory\" is,\n" -"let's have a look at how the file system as a whole is organized. For the\n" -"sake of this example, we'll be\n" -"illustrating the filesystem on our scientist Nelle's computer. After this\n" -"illustration, you'll be learning commands to explore your own filesystem,\n" -"which will be constructed in a similar way, but not be exactly identical. " -msgstr "" -"To understand what a \"home directory\" is,\n" -"let's have a look at how the file system as a whole is organized. For the\n" -"sake of this example, we'll be\n" -"illustrating the filesystem on our scientist Nelle's computer. After this\n" -"illustration, you'll be learning commands to explore your own filesystem,\n" -"which will be constructed in a similar way, but not be exactly identical. " - -#: shell-novice/_episodes/02-filedir.md:79 -msgid "On Nelle's computer, the filesystem looks like this:" -msgstr "On Nelle's computer, the filesystem looks like this:" - -#: shell-novice/_episodes/02-filedir.md:81 -msgid "![The File System](../fig/filesystem.svg)" -msgstr "![The File System](../fig/filesystem.svg)" - -#: shell-novice/_episodes/02-filedir.md:83 -msgid "" -"At the top is the **root directory**\n" -"that holds everything else.\n" -"We refer to it using a slash character `/` on its own;\n" -"this is the leading slash in `/Users/nelle`." -msgstr "" -"At the top is the **root directory**\n" -"that holds everything else.\n" -"We refer to it using a slash character `/` on its own;\n" -"this is the leading slash in `/Users/nelle`." - -#: shell-novice/_episodes/02-filedir.md:88 -msgid "" -"Inside that directory are several other directories:\n" -"`bin` (which is where some built-in programs are stored),\n" -"`data` (for miscellaneous data files),\n" -"`Users` (where users' personal directories are located),\n" -"`tmp` (for temporary files that don't need to be stored long-term),\n" -"and so on. " -msgstr "" -"Inside that directory are several other directories:\n" -"`bin` (which is where some built-in programs are stored),\n" -"`data` (for miscellaneous data files),\n" -"`Users` (where users' personal directories are located),\n" -"`tmp` (for temporary files that don't need to be stored long-term),\n" -"and so on. " - -#: shell-novice/_episodes/02-filedir.md:95 -msgid "" -"We know that our current working directory `/Users/nelle` is stored inside `/Users`\n" -"because `/Users` is the first part of its name.\n" -"Similarly,\n" -"we know that `/Users` is stored inside the root directory `/`\n" -"because its name begins with `/`." -msgstr "" -"We know that our current working directory `/Users/nelle` is stored inside `/Users`\n" -"because `/Users` is the first part of its name.\n" -"Similarly,\n" -"we know that `/Users` is stored inside the root directory `/`\n" -"because its name begins with `/`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:101 -msgid "> ## Slashes" -msgstr "> ## Slashes" - -#: shell-novice/_episodes/02-filedir.md:102 -msgid "" -">\n" -"> Notice that there are two meanings for the `/` character.\n" -"> When it appears at the front of a file or directory name,\n" -"> it refers to the root directory. When it appears *inside* a name,\n" -"> it's just a separator." -msgstr "" -">\n" -"> Notice that there are two meanings for the `/` character.\n" -"> When it appears at the front of a file or directory name,\n" -"> it refers to the root directory. When it appears *inside* a name,\n" -"> it's just a separator." - -#: shell-novice/_episodes/02-filedir.md:109 -msgid "" -"Underneath `/Users`,\n" -"we find one directory for each user with an account on Nelle's machine,\n" -"her colleagues the Mummy and Wolfman. " -msgstr "" -"Underneath `/Users`,\n" -"we find one directory for each user with an account on Nelle's machine,\n" -"her colleagues the Mummy and Wolfman. " - -#: shell-novice/_episodes/02-filedir.md:113 -msgid "![Home Directories](../fig/home-directories.svg)" -msgstr "![Home Directories](../fig/home-directories.svg)" - -#: shell-novice/_episodes/02-filedir.md:115 -msgid "" -"The Mummy's files are stored in `/Users/imhotep`,\n" -"Wolfman's in `/Users/larry`,\n" -"and Nelle's in `/Users/nelle`. Because Nelle is the user in our\n" -"examples here, this is why we get `/Users/nelle` as our home directory. \n" -"Typically, when you open a new command prompt you will be in\n" -"your home directory to start. " -msgstr "" -"The Mummy's files are stored in `/Users/imhotep`,\n" -"Wolfman's in `/Users/larry`,\n" -"and Nelle's in `/Users/nelle`. Because Nelle is the user in our\n" -"examples here, this is why we get `/Users/nelle` as our home directory. \n" -"Typically, when you open a new command prompt you will be in\n" -"your home directory to start. " - -#: shell-novice/_episodes/02-filedir.md:122 -msgid "" -"Now let's learn the command that will let us see the contents of our\n" -"own filesystem. We can see what's in our home directory by running `ls`,\n" -"which stands for \"listing\":" -msgstr "" -"Now let's learn the command that will let us see the contents of our\n" -"own filesystem. We can see what's in our home directory by running `ls`,\n" -"which stands for \"listing\":" - -# code block -#: shell-novice/_episodes/02-filedir.md:126 -#: shell-novice/_episodes/03-create.md:180 -#: shell-novice/_episodes/03-create.md:243 -msgid "" -"~~~\n" -"$ ls\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:131 -msgid "" -"~~~\n" -"Applications Documents Library Music Public\n" -"Desktop Downloads Movies Pictures\n" -"~~~" -msgstr "" -"~~~\n" -"Applications Documents Library Music Public\n" -"Desktop Downloads Movies Pictures\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:137 -msgid "" -"(Again, your results may be slightly different depending on your operating\n" -"system and how you have customized your filesystem.)" -msgstr "" -"(Again, your results may be slightly different depending on your operating\n" -"system and how you have customized your filesystem.)" - -#: shell-novice/_episodes/02-filedir.md:140 -msgid "" -"`ls` prints the names of the files and directories in the current directory. \n" -"We can make its output more comprehensible by using the **flag** `-F`\n" -"(also known as a **switch** or an **option**) ,\n" -"which tells `ls` to add a marker to file and directory names to indicate what\n" -"they are. A trailing `/` indicates that this is a directory. Depending on your\n" -"settings, it might also use colors to indicate whether each entry is a file or \n" -"directory.\n" -"You might recall that we used `ls -F` in an earlier example." -msgstr "" -"`ls` prints the names of the files and directories in the current directory. \n" -"We can make its output more comprehensible by using the **flag** `-F`\n" -"(also known as a **switch** or an **option**) ,\n" -"which tells `ls` to add a marker to file and directory names to indicate what\n" -"they are. A trailing `/` indicates that this is a directory. Depending on your\n" -"settings, it might also use colors to indicate whether each entry is a file or \n" -"directory.\n" -"You might recall that we used `ls -F` in an earlier example." - -# code block -#: shell-novice/_episodes/02-filedir.md:149 -#: shell-novice/_episodes/02-filedir.md:484 -#: shell-novice/_episodes/03-create.md:37 -#: shell-novice/_episodes/03-create.md:61 -msgid "" -"~~~\n" -"$ ls -F\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls -F\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:154 -msgid "" -"~~~\n" -"Applications/ Documents/ Library/ Music/ Public/\n" -"Desktop/ Downloads/ Movies/ Pictures/\n" -"~~~" -msgstr "" -"~~~\n" -"Applications/ Documents/ Library/ Music/ Public/\n" -"Desktop/ Downloads/ Movies/ Pictures/\n" -"~~~" - -# header -#: shell-novice/_episodes/02-filedir.md:160 -msgid "### Getting help" -msgstr "### Getting help" - -#: shell-novice/_episodes/02-filedir.md:162 -msgid "" -"`ls` has lots of other **flags**. There are two common ways to find out how \n" -"to use a command and what flags it accepts:" -msgstr "" -"`ls` has lots of other **flags**. There are two common ways to find out how \n" -"to use a command and what flags it accepts:" - -# ordered list -#: shell-novice/_episodes/02-filedir.md:165 -msgid "1. We can pass a `--help` flag to the command, such as:" -msgstr "1. We can pass a `--help` flag to the command, such as:" - -#: shell-novice/_episodes/02-filedir.md:166 -msgid "" -" ~~~\n" -" $ ls --help\n" -" ~~~" -msgstr "" -" ~~~\n" -" $ ls --help\n" -" ~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:169 -#: shell-novice/_episodes/02-filedir.md:175 shell-novice/_extras/guide.md:210 -msgid " {: .bash}" -msgstr " {: .bash}" - -# ordered list -#: shell-novice/_episodes/02-filedir.md:171 -msgid "2. We can read its manual with `man`, such as:" -msgstr "2. We can read its manual with `man`, such as:" - -#: shell-novice/_episodes/02-filedir.md:172 -msgid "" -" ~~~\n" -" $ man ls \n" -" ~~~" -msgstr "" -" ~~~\n" -" $ man ls \n" -" ~~~" - -#: shell-novice/_episodes/02-filedir.md:177 -msgid "" -"If you use a Mac, or Git for Windows, you might find that only one of these works \n" -"(probably `man` on Mac and `--help` in Windows). We'll describe both ways." -msgstr "" -"If you use a Mac, or Git for Windows, you might find that only one of these works \n" -"(probably `man` on Mac and `--help` in Windows). We'll describe both ways." - -#: shell-novice/_episodes/02-filedir.md:180 -msgid "" -"Of course there is a third way: searching the internet via your web browser. \n" -"When using internet search, including the phrase `unix man page` in your search\n" -"query will help to find relevant results." -msgstr "" -"Of course there is a third way: searching the internet via your web browser. \n" -"When using internet search, including the phrase `unix man page` in your search\n" -"query will help to find relevant results." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:184 -msgid "> ## Manual pages on the web" -msgstr "> ## Manual pages on the web" - -#: shell-novice/_episodes/02-filedir.md:185 -msgid "" -">\n" -"> GNU provides links to its\n" -"> [manuals](http://www.gnu.org/manual/manual.html) including the\n" -"> [core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html),\n" -"> which covers many commands introduced within this lesson." -msgstr "" -">\n" -"> GNU provides links to its\n" -"> [manuals](http://www.gnu.org/manual/manual.html) including the\n" -"> [core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html),\n" -"> which covers many commands introduced within this lesson." - -# header -#: shell-novice/_episodes/02-filedir.md:192 -msgid "#### The `--help` flag" -msgstr "#### The `--help` flag" - -#: shell-novice/_episodes/02-filedir.md:194 -msgid "" -"Many bash commands, and programs that people have written that can be\n" -"run from within bash, support a `--help` flag to display more\n" -"information on how to use the command or program." -msgstr "" -"Many bash commands, and programs that people have written that can be\n" -"run from within bash, support a `--help` flag to display more\n" -"information on how to use the command or program." - -# code block -#: shell-novice/_episodes/02-filedir.md:198 -msgid "" -"~~~\n" -"$ ls --help\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls --help\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:203 -msgid "" -"~~~\n" -"Usage: ls [OPTION]... [FILE]...\n" -"List information about the FILEs (the current directory by default).\n" -"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" -"\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -a, --all do not ignore entries starting with .\n" -" -A, --almost-all do not list implied . and ..\n" -" --author with -l, print the author of each file\n" -" -b, --escape print C-style escapes for nongraphic characters\n" -" --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n" -" '--block-size=M' prints sizes in units of\n" -" 1,048,576 bytes; see SIZE format below\n" -" -B, --ignore-backups do not list implied entries ending with ~\n" -" -c with -lt: sort by, and show, ctime (time of last\n" -" modification of file status information);\n" -" with -l: show ctime and sort by name;\n" -" otherwise: sort by ctime, newest first\n" -" -C list entries by columns\n" -" --color[=WHEN] colorize the output; WHEN can be 'always' (default\n" -" if omitted), 'auto', or 'never'; more info below\n" -" -d, --directory list directories themselves, not their contents\n" -" -D, --dired generate output designed for Emacs' dired mode\n" -" -f do not sort, enable -aU, disable -ls --color\n" -" -F, --classify append indicator (one of */=>@|) to entries\n" -" --file-type likewise, except do not append '*'\n" -" --format=WORD across -x, commas -m, horizontal -x, long -l,\n" -" single-column -1, verbose -l, vertical -C\n" -" --full-time like -l --time-style=full-iso\n" -" -g like -l, but do not list owner\n" -" --group-directories-first\n" -" group directories before files;\n" -" can be augmented with a --sort option, but any\n" -" use of --sort=none (-U) disables grouping\n" -" -G, --no-group in a long listing, don't print group names\n" -" -h, --human-readable with -l and/or -s, print human readable sizes\n" -" (e.g., 1K 234M 2G)\n" -" --si likewise, but use powers of 1000 not 1024\n" -" -H, --dereference-command-line\n" -" follow symbolic links listed on the command line\n" -" --dereference-command-line-symlink-to-dir\n" -" follow each command line symbolic link\n" -" that points to a directory\n" -" --hide=PATTERN do not list implied entries matching shell PATTERN\n" -" (overridden by -a or -A)\n" -" --indicator-style=WORD append indicator with style WORD to entry names:\n" -" none (default), slash (-p),\n" -" file-type (--file-type), classify (-F)\n" -" -i, --inode print the index number of each file\n" -" -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n" -" -k, --kibibytes default to 1024-byte blocks for disk usage\n" -" -l use a long listing format\n" -" -L, --dereference when showing file information for a symbolic\n" -" link, show information for the file the link\n" -" references rather than for the link itself\n" -" -m fill width with a comma separated list of entries\n" -" -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n" -" -N, --literal print raw entry names (don't treat e.g. control\n" -" characters specially)\n" -" -o like -l, but do not list group information\n" -" -p, --indicator-style=slash\n" -" append / indicator to directories\n" -" -q, --hide-control-chars print ? instead of nongraphic characters\n" -" --show-control-chars show nongraphic characters as-is (the default,\n" -" unless program is 'ls' and output is a terminal)\n" -" -Q, --quote-name enclose entry names in double quotes\n" -" --quoting-style=WORD use quoting style WORD for entry names:\n" -" literal, locale, shell, shell-always,\n" -" shell-escape, shell-escape-always, c, escape\n" -" -r, --reverse reverse order while sorting\n" -" -R, --recursive list subdirectories recursively\n" -" -s, --size print the allocated size of each file, in blocks\n" -" -S sort by file size, largest first\n" -" --sort=WORD sort by WORD instead of name: none (-U), size (-S),\n" -" time (-t), version (-v), extension (-X)\n" -" --time=WORD with -l, show time as WORD instead of default\n" -" modification time: atime or access or use (-u);\n" -" ctime or status (-c); also use specified time\n" -" as sort key if --sort=time (newest first)\n" -" --time-style=STYLE with -l, show times using style STYLE:\n" -" full-iso, long-iso, iso, locale, or +FORMAT;\n" -" FORMAT is interpreted like in 'date'; if FORMAT\n" -" is FORMAT1FORMAT2, then FORMAT1 applies\n" -" to non-recent files and FORMAT2 to recent files;\n" -" if STYLE is prefixed with 'posix-', STYLE\n" -" takes effect only outside the POSIX locale\n" -" -t sort by modification time, newest first\n" -" -T, --tabsize=COLS assume tab stops at each COLS instead of 8\n" -" -u with -lt: sort by, and show, access time;\n" -" with -l: show access time and sort by name;\n" -" otherwise: sort by access time, newest first\n" -" -U do not sort; list entries in directory order\n" -" -v natural sort of (version) numbers within text\n" -" -w, --width=COLS set output width to COLS. 0 means no limit\n" -" -x list entries by lines instead of by columns\n" -" -X sort alphabetically by entry extension\n" -" -Z, --context print any security context of each file\n" -" -1 list one file per line. Avoid '\\n' with -q or -b\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -"\n" -"The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\n" -"Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\n" -"\n" -"Using color to distinguish file types is disabled both by default and\n" -"with --color=never. With --color=auto, ls emits color codes only when\n" -"standard output is connected to a terminal. The LS_COLORS environment\n" -"variable can change the settings. Use the dircolors command to set it.\n" -"\n" -"Exit status:\n" -" 0 if OK,\n" -" 1 if minor problems (e.g., cannot access subdirectory),\n" -" 2 if serious trouble (e.g., cannot access command-line argument).\n" -"\n" -"GNU coreutils online help: \n" -"Full documentation at: \n" -"or available locally via: info '(coreutils) ls invocation'\n" -"~~~" -msgstr "" -"~~~\n" -"Usage: ls [OPTION]... [FILE]...\n" -"List information about the FILEs (the current directory by default).\n" -"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" -"\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -a, --all do not ignore entries starting with .\n" -" -A, --almost-all do not list implied . and ..\n" -" --author with -l, print the author of each file\n" -" -b, --escape print C-style escapes for nongraphic characters\n" -" --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n" -" '--block-size=M' prints sizes in units of\n" -" 1,048,576 bytes; see SIZE format below\n" -" -B, --ignore-backups do not list implied entries ending with ~\n" -" -c with -lt: sort by, and show, ctime (time of last\n" -" modification of file status information);\n" -" with -l: show ctime and sort by name;\n" -" otherwise: sort by ctime, newest first\n" -" -C list entries by columns\n" -" --color[=WHEN] colorize the output; WHEN can be 'always' (default\n" -" if omitted), 'auto', or 'never'; more info below\n" -" -d, --directory list directories themselves, not their contents\n" -" -D, --dired generate output designed for Emacs' dired mode\n" -" -f do not sort, enable -aU, disable -ls --color\n" -" -F, --classify append indicator (one of */=>@|) to entries\n" -" --file-type likewise, except do not append '*'\n" -" --format=WORD across -x, commas -m, horizontal -x, long -l,\n" -" single-column -1, verbose -l, vertical -C\n" -" --full-time like -l --time-style=full-iso\n" -" -g like -l, but do not list owner\n" -" --group-directories-first\n" -" group directories before files;\n" -" can be augmented with a --sort option, but any\n" -" use of --sort=none (-U) disables grouping\n" -" -G, --no-group in a long listing, don't print group names\n" -" -h, --human-readable with -l and/or -s, print human readable sizes\n" -" (e.g., 1K 234M 2G)\n" -" --si likewise, but use powers of 1000 not 1024\n" -" -H, --dereference-command-line\n" -" follow symbolic links listed on the command line\n" -" --dereference-command-line-symlink-to-dir\n" -" follow each command line symbolic link\n" -" that points to a directory\n" -" --hide=PATTERN do not list implied entries matching shell PATTERN\n" -" (overridden by -a or -A)\n" -" --indicator-style=WORD append indicator with style WORD to entry names:\n" -" none (default), slash (-p),\n" -" file-type (--file-type), classify (-F)\n" -" -i, --inode print the index number of each file\n" -" -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n" -" -k, --kibibytes default to 1024-byte blocks for disk usage\n" -" -l use a long listing format\n" -" -L, --dereference when showing file information for a symbolic\n" -" link, show information for the file the link\n" -" references rather than for the link itself\n" -" -m fill width with a comma separated list of entries\n" -" -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n" -" -N, --literal print raw entry names (don't treat e.g. control\n" -" characters specially)\n" -" -o like -l, but do not list group information\n" -" -p, --indicator-style=slash\n" -" append / indicator to directories\n" -" -q, --hide-control-chars print ? instead of nongraphic characters\n" -" --show-control-chars show nongraphic characters as-is (the default,\n" -" unless program is 'ls' and output is a terminal)\n" -" -Q, --quote-name enclose entry names in double quotes\n" -" --quoting-style=WORD use quoting style WORD for entry names:\n" -" literal, locale, shell, shell-always,\n" -" shell-escape, shell-escape-always, c, escape\n" -" -r, --reverse reverse order while sorting\n" -" -R, --recursive list subdirectories recursively\n" -" -s, --size print the allocated size of each file, in blocks\n" -" -S sort by file size, largest first\n" -" --sort=WORD sort by WORD instead of name: none (-U), size (-S),\n" -" time (-t), version (-v), extension (-X)\n" -" --time=WORD with -l, show time as WORD instead of default\n" -" modification time: atime or access or use (-u);\n" -" ctime or status (-c); also use specified time\n" -" as sort key if --sort=time (newest first)\n" -" --time-style=STYLE with -l, show times using style STYLE:\n" -" full-iso, long-iso, iso, locale, or +FORMAT;\n" -" FORMAT is interpreted like in 'date'; if FORMAT\n" -" is FORMAT1FORMAT2, then FORMAT1 applies\n" -" to non-recent files and FORMAT2 to recent files;\n" -" if STYLE is prefixed with 'posix-', STYLE\n" -" takes effect only outside the POSIX locale\n" -" -t sort by modification time, newest first\n" -" -T, --tabsize=COLS assume tab stops at each COLS instead of 8\n" -" -u with -lt: sort by, and show, access time;\n" -" with -l: show access time and sort by name;\n" -" otherwise: sort by access time, newest first\n" -" -U do not sort; list entries in directory order\n" -" -v natural sort of (version) numbers within text\n" -" -w, --width=COLS set output width to COLS. 0 means no limit\n" -" -x list entries by lines instead of by columns\n" -" -X sort alphabetically by entry extension\n" -" -Z, --context print any security context of each file\n" -" -1 list one file per line. Avoid '\\n' with -q or -b\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -"\n" -"The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\n" -"Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\n" -"\n" -"Using color to distinguish file types is disabled both by default and\n" -"with --color=never. With --color=auto, ls emits color codes only when\n" -"standard output is connected to a terminal. The LS_COLORS environment\n" -"variable can change the settings. Use the dircolors command to set it.\n" -"\n" -"Exit status:\n" -" 0 if OK,\n" -" 1 if minor problems (e.g., cannot access subdirectory),\n" -" 2 if serious trouble (e.g., cannot access command-line argument).\n" -"\n" -"GNU coreutils online help: \n" -"Full documentation at: \n" -"or available locally via: info '(coreutils) ls invocation'\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:323 -msgid "> ## Unsupported command-line options" -msgstr "> ## Unsupported command-line options" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:324 -msgid "> If you try to use an option (flag) that is not supported, `ls` and other programs" -msgstr "> If you try to use an option (flag) that is not supported, `ls` and other programs" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:325 -msgid "> will usually print an error message similar to this:" -msgstr "> will usually print an error message similar to this:" - -#: shell-novice/_episodes/02-filedir.md:326 -msgid "" -">\n" -"> ~~~\n" -"> $ ls -j\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> \n" -"> ~~~\n" -"> ls: invalid option -- 'j'\n" -"> Try 'ls --help' for more information.\n" -"> ~~~" -msgstr "" -">\n" -"> ~~~\n" -"> $ ls -j\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> \n" -"> ~~~\n" -"> ls: invalid option -- 'j'\n" -"> Try 'ls --help' for more information.\n" -"> ~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:336 -msgid "> {: .error}" -msgstr "> {: .error}" - -# header -#: shell-novice/_episodes/02-filedir.md:339 -msgid "#### The `man` command" -msgstr "#### The `man` command" - -#: shell-novice/_episodes/02-filedir.md:341 -msgid "" -"The other way to learn about `ls` is to type \n" -"~~~\n" -"$ man ls\n" -"~~~" -msgstr "" -"The other way to learn about `ls` is to type \n" -"~~~\n" -"$ man ls\n" -"~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:345 -msgid "{: .bash}" -msgstr "{: .bash}" - -#: shell-novice/_episodes/02-filedir.md:347 -msgid "" -"This will turn your terminal into a page with a description \n" -"of the `ls` command and its options and, if you're lucky, some examples\n" -"of how to use it." -msgstr "" -"This will turn your terminal into a page with a description \n" -"of the `ls` command and its options and, if you're lucky, some examples\n" -"of how to use it." - -#: shell-novice/_episodes/02-filedir.md:351 -msgid "" -"To navigate through the `man` pages,\n" -"you may use the up and down arrow keys to move line-by-line,\n" -"or try the \"b\" and spacebar keys to skip up and down by a full page.\n" -"To search for a character or word in the `man` pages, \n" -"use \"/\" followed by the character or word you are searching for. " -msgstr "" -"To navigate through the `man` pages,\n" -"you may use the up and down arrow keys to move line-by-line,\n" -"or try the \"b\" and spacebar keys to skip up and down by a full page.\n" -"To search for a character or word in the `man` pages, \n" -"use \"/\" followed by the character or word you are searching for. " - -#: shell-novice/_episodes/02-filedir.md:357 -msgid "To **quit** the `man` pages, press `q`. " -msgstr "To **quit** the `man` pages, press `q`. " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:360 -msgid "> ## Exploring More `ls` Flags" -msgstr "> ## Exploring More `ls` Flags" - -#: shell-novice/_episodes/02-filedir.md:361 -msgid "" -">\n" -"> What does the command `ls` do when used with the `-l` and `-h` flags?\n" -">\n" -"> Some of its output is about properties that we do not cover in this lesson (such\n" -"> as file permissions and ownership), but the rest should be useful\n" -"> nevertheless.\n" -">\n" -"> > ## Solution\n" -"> > The `-l` flag makes `ls` use a **l**ong listing format, showing not only\n" -"> > the file/directory names but also additional information such as the file size\n" -"> > and the time of its last modification. The `-h` flag makes the file size\n" -"> > \"**h**uman readable\", i.e. display something like `5.3K` instead of `5369`." -msgstr "" -">\n" -"> What does the command `ls` do when used with the `-l` and `-h` flags?\n" -">\n" -"> Some of its output is about properties that we do not cover in this lesson (such\n" -"> as file permissions and ownership), but the rest should be useful\n" -"> nevertheless.\n" -">\n" -"> > ## Solution\n" -"> > The `-l` flag makes `ls` use a **l**ong listing format, showing not only\n" -"> > the file/directory names but also additional information such as the file size\n" -"> > and the time of its last modification. The `-h` flag makes the file size\n" -"> > \"**h**uman readable\", i.e. display something like `5.3K` instead of `5369`." - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:373 -#: shell-novice/_episodes/02-filedir.md:387 -#: shell-novice/_episodes/02-filedir.md:706 -#: shell-novice/_episodes/02-filedir.md:727 -#: shell-novice/_episodes/02-filedir.md:753 -#: shell-novice/_episodes/03-create.md:226 -#: shell-novice/_episodes/03-create.md:324 -#: shell-novice/_episodes/03-create.md:471 -#: shell-novice/_episodes/03-create.md:555 -#: shell-novice/_episodes/03-create.md:604 -#: shell-novice/_episodes/03-create.md:650 -#: shell-novice/_episodes/03-create.md:691 -#: shell-novice/_episodes/03-create.md:740 -#: shell-novice/_episodes/04-pipefilter.md:123 -#: shell-novice/_episodes/04-pipefilter.md:168 -#: shell-novice/_episodes/04-pipefilter.md:263 -#: shell-novice/_episodes/04-pipefilter.md:340 -#: shell-novice/_episodes/04-pipefilter.md:483 -#: shell-novice/_episodes/04-pipefilter.md:604 -#: shell-novice/_episodes/04-pipefilter.md:641 -#: shell-novice/_episodes/04-pipefilter.md:702 -#: shell-novice/_episodes/04-pipefilter.md:733 -#: shell-novice/_episodes/04-pipefilter.md:860 -#: shell-novice/_episodes/04-pipefilter.md:884 -#: shell-novice/_episodes/05-loop.md:186 shell-novice/_episodes/05-loop.md:261 -#: shell-novice/_episodes/05-loop.md:282 shell-novice/_episodes/05-loop.md:606 -#: shell-novice/_episodes/05-loop.md:633 shell-novice/_episodes/05-loop.md:685 -#: shell-novice/_episodes/05-loop.md:712 -#: shell-novice/_episodes/06-script.md:312 -#: shell-novice/_episodes/06-script.md:387 -#: shell-novice/_episodes/06-script.md:496 -#: shell-novice/_episodes/06-script.md:526 -#: shell-novice/_episodes/06-script.md:570 -#: shell-novice/_episodes/06-script.md:612 -#: shell-novice/_episodes/07-find.md:249 shell-novice/_episodes/07-find.md:338 -#: shell-novice/_episodes/07-find.md:382 shell-novice/_episodes/07-find.md:605 -#: shell-novice/_episodes/07-find.md:657 shell-novice/_episodes/07-find.md:679 -msgid "> {: .solution}" -msgstr "> {: .solution}" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:374 -#: shell-novice/_episodes/02-filedir.md:388 -#: shell-novice/_episodes/02-filedir.md:707 -#: shell-novice/_episodes/02-filedir.md:728 -#: shell-novice/_episodes/02-filedir.md:754 -#: shell-novice/_episodes/03-create.md:227 -#: shell-novice/_episodes/03-create.md:325 -#: shell-novice/_episodes/03-create.md:472 -#: shell-novice/_episodes/03-create.md:556 -#: shell-novice/_episodes/03-create.md:605 -#: shell-novice/_episodes/03-create.md:651 -#: shell-novice/_episodes/03-create.md:692 -#: shell-novice/_episodes/03-create.md:741 -#: shell-novice/_episodes/04-pipefilter.md:124 -#: shell-novice/_episodes/04-pipefilter.md:169 -#: shell-novice/_episodes/04-pipefilter.md:239 -#: shell-novice/_episodes/04-pipefilter.md:264 -#: shell-novice/_episodes/04-pipefilter.md:341 -#: shell-novice/_episodes/04-pipefilter.md:484 -#: shell-novice/_episodes/04-pipefilter.md:605 -#: shell-novice/_episodes/04-pipefilter.md:642 -#: shell-novice/_episodes/04-pipefilter.md:667 -#: shell-novice/_episodes/04-pipefilter.md:703 -#: shell-novice/_episodes/04-pipefilter.md:734 -#: shell-novice/_episodes/04-pipefilter.md:861 -#: shell-novice/_episodes/04-pipefilter.md:885 -#: shell-novice/_episodes/05-loop.md:187 shell-novice/_episodes/05-loop.md:283 -#: shell-novice/_episodes/05-loop.md:607 shell-novice/_episodes/05-loop.md:634 -#: shell-novice/_episodes/05-loop.md:686 shell-novice/_episodes/05-loop.md:713 -#: shell-novice/_episodes/06-script.md:313 -#: shell-novice/_episodes/06-script.md:388 -#: shell-novice/_episodes/06-script.md:497 -#: shell-novice/_episodes/06-script.md:527 -#: shell-novice/_episodes/06-script.md:571 -#: shell-novice/_episodes/06-script.md:613 -#: shell-novice/_episodes/07-find.md:250 shell-novice/_episodes/07-find.md:339 -#: shell-novice/_episodes/07-find.md:383 shell-novice/_episodes/07-find.md:606 -#: shell-novice/_episodes/07-find.md:658 shell-novice/_episodes/07-find.md:680 -msgid "{: .challenge}" -msgstr "{: .challenge}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:376 -msgid "> ## Listing Recursively and By Time" -msgstr "> ## Listing Recursively and By Time" - -#: shell-novice/_episodes/02-filedir.md:377 -msgid "" -">\n" -"> The command `ls -R` lists the contents of directories recursively, i.e., lists\n" -"> their sub-directories, sub-sub-directories, and so on at each level. The command\n" -"> `ls -t` lists things by time of last change, with most recently changed files or\n" -"> directories first.\n" -"> In what order does `ls -R -t` display things? Hint: `ls -l` uses a long listing\n" -"> format to view timestamps.\n" -">\n" -"> > ## Solution\n" -"> > The files/directories in each directory are sorted by time of last change." -msgstr "" -">\n" -"> The command `ls -R` lists the contents of directories recursively, i.e., lists\n" -"> their sub-directories, sub-sub-directories, and so on at each level. The command\n" -"> `ls -t` lists things by time of last change, with most recently changed files or\n" -"> directories first.\n" -"> In what order does `ls -R -t` display things? Hint: `ls -l` uses a long listing\n" -"> format to view timestamps.\n" -">\n" -"> > ## Solution\n" -"> > The files/directories in each directory are sorted by time of last change." - -#: shell-novice/_episodes/02-filedir.md:390 -msgid "" -"Here,\n" -"we can see that our home directory contains mostly **sub-directories**.\n" -"Any names in your output that don't have trailing slashes,\n" -"are plain old **files**.\n" -"And note that there is a space between `ls` and `-F`:\n" -"without it,\n" -"the shell thinks we're trying to run a command called `ls-F`,\n" -"which doesn't exist." -msgstr "" -"Here,\n" -"we can see that our home directory contains mostly **sub-directories**.\n" -"Any names in your output that don't have trailing slashes,\n" -"are plain old **files**.\n" -"And note that there is a space between `ls` and `-F`:\n" -"without it,\n" -"the shell thinks we're trying to run a command called `ls-F`,\n" -"which doesn't exist." - -#: shell-novice/_episodes/02-filedir.md:399 -msgid "" -"We can also use `ls` to see the contents of a different directory. Let's take a\n" -"look at our `Desktop` directory by running `ls -F Desktop`,\n" -"i.e.,\n" -"the command `ls` with the `-F` **flag** and the **argument** `Desktop`.\n" -"The argument `Desktop` tells `ls` that\n" -"we want a listing of something other than our current working directory:" -msgstr "" -"We can also use `ls` to see the contents of a different directory. Let's take a\n" -"look at our `Desktop` directory by running `ls -F Desktop`,\n" -"i.e.,\n" -"the command `ls` with the `-F` **flag** and the **argument** `Desktop`.\n" -"The argument `Desktop` tells `ls` that\n" -"we want a listing of something other than our current working directory:" - -# code block -#: shell-novice/_episodes/02-filedir.md:406 -msgid "" -"~~~\n" -"$ ls -F Desktop\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls -F Desktop\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:411 -msgid "" -"~~~\n" -"data-shell/\n" -"~~~" -msgstr "" -"~~~\n" -"data-shell/\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:416 -msgid "" -"Your output should be a list of all the files and sub-directories on your\n" -"Desktop, including the `data-shell` directory you downloaded at\n" -"the start of the lesson. Take a look at your Desktop to confirm that\n" -"your output is accurate. " -msgstr "" -"Your output should be a list of all the files and sub-directories on your\n" -"Desktop, including the `data-shell` directory you downloaded at\n" -"the start of the lesson. Take a look at your Desktop to confirm that\n" -"your output is accurate. " - -#: shell-novice/_episodes/02-filedir.md:421 -msgid "" -"As you may now see, using a bash shell is strongly dependent on the idea that\n" -"your files are organized in a hierarchical file system.\n" -"Organizing things hierarchically in this way helps us keep track of our work:\n" -"it's possible to put hundreds of files in our home directory,\n" -"just as it's possible to pile hundreds of printed papers on our desk,\n" -"but it's a self-defeating strategy." -msgstr "" -"As you may now see, using a bash shell is strongly dependent on the idea that\n" -"your files are organized in a hierarchical file system.\n" -"Organizing things hierarchically in this way helps us keep track of our work:\n" -"it's possible to put hundreds of files in our home directory,\n" -"just as it's possible to pile hundreds of printed papers on our desk,\n" -"but it's a self-defeating strategy." - -#: shell-novice/_episodes/02-filedir.md:428 -msgid "" -"Now that we know the `data-shell` directory is located on our Desktop, we\n" -"can do two things. " -msgstr "" -"Now that we know the `data-shell` directory is located on our Desktop, we\n" -"can do two things. " - -#: shell-novice/_episodes/02-filedir.md:431 -msgid "" -"First, we can look at its contents, using the same strategy as before, passing\n" -"a directory name to `ls`:" -msgstr "" -"First, we can look at its contents, using the same strategy as before, passing\n" -"a directory name to `ls`:" - -# code block -#: shell-novice/_episodes/02-filedir.md:434 -msgid "" -"~~~\n" -"$ ls -F Desktop/data-shell\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls -F Desktop/data-shell\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:439 -msgid "" -"~~~\n" -"creatures/ molecules/ notes.txt solar.pdf\n" -"data/ north-pacific-gyre/ pizza.cfg writing/\n" -"~~~" -msgstr "" -"~~~\n" -"creatures/ molecules/ notes.txt solar.pdf\n" -"data/ north-pacific-gyre/ pizza.cfg writing/\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:445 -msgid "" -"Second, we can actually change our location to a different directory, so\n" -"we are no longer located in\n" -"our home directory. " -msgstr "" -"Second, we can actually change our location to a different directory, so\n" -"we are no longer located in\n" -"our home directory. " - -#: shell-novice/_episodes/02-filedir.md:449 -msgid "" -"The command to change locations is `cd` followed by a\n" -"directory name to change our working directory.\n" -"`cd` stands for \"change directory\",\n" -"which is a bit misleading:\n" -"the command doesn't change the directory,\n" -"it changes the shell's idea of what directory we are in." -msgstr "" -"The command to change locations is `cd` followed by a\n" -"directory name to change our working directory.\n" -"`cd` stands for \"change directory\",\n" -"which is a bit misleading:\n" -"the command doesn't change the directory,\n" -"it changes the shell's idea of what directory we are in." - -#: shell-novice/_episodes/02-filedir.md:456 -msgid "" -"Let's say we want to move to the `data` directory we saw above. We can\n" -"use the following series of commands to get there:" -msgstr "" -"Let's say we want to move to the `data` directory we saw above. We can\n" -"use the following series of commands to get there:" - -# code block -#: shell-novice/_episodes/02-filedir.md:459 -msgid "" -"~~~\n" -"$ cd Desktop\n" -"$ cd data-shell\n" -"$ cd data\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd Desktop\n" -"$ cd data-shell\n" -"$ cd data\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:466 -msgid "" -"These commands will move us from our home directory onto our Desktop, then into\n" -"the `data-shell` directory, then into the `data` directory. `cd` doesn't print anything,\n" -"but if we run `pwd` after it, we can see that we are now\n" -"in `/Users/nelle/Desktop/data-shell/data`.\n" -"If we run `ls` without arguments now,\n" -"it lists the contents of `/Users/nelle/Desktop/data-shell/data`,\n" -"because that's where we now are:" -msgstr "" -"These commands will move us from our home directory onto our Desktop, then into\n" -"the `data-shell` directory, then into the `data` directory. `cd` doesn't print anything,\n" -"but if we run `pwd` after it, we can see that we are now\n" -"in `/Users/nelle/Desktop/data-shell/data`.\n" -"If we run `ls` without arguments now,\n" -"it lists the contents of `/Users/nelle/Desktop/data-shell/data`,\n" -"because that's where we now are:" - -# code block -#: shell-novice/_episodes/02-filedir.md:479 -#: shell-novice/_episodes/02-filedir.md:652 -msgid "" -"~~~\n" -"/Users/nelle/Desktop/data-shell/data\n" -"~~~" -msgstr "" -"~~~\n" -"/Users/nelle/Desktop/data-shell/data\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:489 -msgid "" -"~~~\n" -"amino-acids.txt elements/ pdb/\t salmon.txt\n" -"animals.txt morse.txt planets.txt sunspot.txt\n" -"~~~" -msgstr "" -"~~~\n" -"amino-acids.txt elements/ pdb/\t salmon.txt\n" -"animals.txt morse.txt planets.txt sunspot.txt\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:495 -msgid "" -"We now know how to go down the directory tree, but\n" -"how do we go up? We might try the following:" -msgstr "" -"We now know how to go down the directory tree, but\n" -"how do we go up? We might try the following:" - -# code block -#: shell-novice/_episodes/02-filedir.md:498 -msgid "" -"~~~\n" -"$ cd data-shell\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd data-shell\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:503 -msgid "" -"~~~\n" -"-bash: cd: data-shell: No such file or directory\n" -"~~~" -msgstr "" -"~~~\n" -"-bash: cd: data-shell: No such file or directory\n" -"~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:506 -#: shell-novice/_episodes/03-create.md:299 -#: shell-novice/_episodes/03-create.md:505 shell-novice/_episodes/05-loop.md:53 -msgid "{: .error}" -msgstr "{: .error}" - -#: shell-novice/_episodes/02-filedir.md:508 -msgid "But we get an error! Why is this? " -msgstr "But we get an error! Why is this? " - -#: shell-novice/_episodes/02-filedir.md:510 -msgid "" -"With our methods so far,\n" -"`cd` can only see sub-directories inside your current directory. There are\n" -"different ways to see directories above your current location; we'll start\n" -"with the simplest. " -msgstr "" -"With our methods so far,\n" -"`cd` can only see sub-directories inside your current directory. There are\n" -"different ways to see directories above your current location; we'll start\n" -"with the simplest. " - -#: shell-novice/_episodes/02-filedir.md:515 -msgid "" -"There is a shortcut in the shell to move up one directory level\n" -"that looks like this:" -msgstr "" -"There is a shortcut in the shell to move up one directory level\n" -"that looks like this:" - -# code block -#: shell-novice/_episodes/02-filedir.md:518 -#: shell-novice/_episodes/03-create.md:283 -msgid "" -"~~~\n" -"$ cd ..\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd ..\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:523 -msgid "" -"`..` is a special directory name meaning\n" -"\"the directory containing this one\",\n" -"or more succinctly,\n" -"the **parent** of the current directory.\n" -"Sure enough,\n" -"if we run `pwd` after running `cd ..`, we're back in `/Users/nelle/Desktop/data-shell`:" -msgstr "" -"`..` is a special directory name meaning\n" -"\"the directory containing this one\",\n" -"or more succinctly,\n" -"the **parent** of the current directory.\n" -"Sure enough,\n" -"if we run `pwd` after running `cd ..`, we're back in `/Users/nelle/Desktop/data-shell`:" - -# code block -#: shell-novice/_episodes/02-filedir.md:535 -#: shell-novice/_episodes/03-create.md:32 -#: shell-novice/_episodes/03-create.md:355 -msgid "" -"~~~\n" -"/Users/nelle/Desktop/data-shell\n" -"~~~" -msgstr "" -"~~~\n" -"/Users/nelle/Desktop/data-shell\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:540 -msgid "" -"The special directory `..` doesn't usually show up when we run `ls`. If we want\n" -"to display it, we can give `ls` the `-a` flag:" -msgstr "" -"The special directory `..` doesn't usually show up when we run `ls`. If we want\n" -"to display it, we can give `ls` the `-a` flag:" - -# code block -#: shell-novice/_episodes/02-filedir.md:543 -msgid "" -"~~~\n" -"$ ls -F -a\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls -F -a\n" -"~~~" - -# code block -#: shell-novice/_episodes/02-filedir.md:548 -msgid "" -"~~~\n" -"./ .bash_profile data/ north-pacific-gyre/ pizza.cfg thesis/\n" -"../ creatures/ molecules/ notes.txt solar.pdf writing/\n" -"~~~" -msgstr "" -"~~~\n" -"./ .bash_profile data/ north-pacific-gyre/ pizza.cfg thesis/\n" -"../ creatures/ molecules/ notes.txt solar.pdf writing/\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:554 -msgid "" -"`-a` stands for \"show all\";\n" -"it forces `ls` to show us file and directory names that begin with `.`,\n" -"such as `..` (which, if we're in `/Users/nelle`, refers to the `/Users` directory)\n" -"As you can see,\n" -"it also displays another special directory that's just called `.`,\n" -"which means \"the current working directory\".\n" -"It may seem redundant to have a name for it,\n" -"but we'll see some uses for it soon." -msgstr "" -"`-a` stands for \"show all\";\n" -"it forces `ls` to show us file and directory names that begin with `.`,\n" -"such as `..` (which, if we're in `/Users/nelle`, refers to the `/Users` directory)\n" -"As you can see,\n" -"it also displays another special directory that's just called `.`,\n" -"which means \"the current working directory\".\n" -"It may seem redundant to have a name for it,\n" -"but we'll see some uses for it soon." - -#: shell-novice/_episodes/02-filedir.md:563 -msgid "" -"Note that in most command line tools, multiple flags can be combined \n" -"with a single `-` and no spaces between the flags: `ls -F -a` is \n" -"equivalent to `ls -Fa`." -msgstr "" -"Note that in most command line tools, multiple flags can be combined \n" -"with a single `-` and no spaces between the flags: `ls -F -a` is \n" -"equivalent to `ls -Fa`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:567 -msgid "> ## Other Hidden Files" -msgstr "> ## Other Hidden Files" - -#: shell-novice/_episodes/02-filedir.md:568 -msgid "" -">\n" -"> In addition to the hidden directories `..` and `.`, you may also see a file\n" -"> called `.bash_profile`. This file usually contains shell configuration\n" -"> settings. You may also see other files and directories beginning\n" -"> with `.`. These are usually files and directories that are used to configure\n" -"> different programs on your computer. The prefix `.` is used to prevent these\n" -"> configuration files from cluttering the terminal when a standard `ls` command\n" -"> is used." -msgstr "" -">\n" -"> In addition to the hidden directories `..` and `.`, you may also see a file\n" -"> called `.bash_profile`. This file usually contains shell configuration\n" -"> settings. You may also see other files and directories beginning\n" -"> with `.`. These are usually files and directories that are used to configure\n" -"> different programs on your computer. The prefix `.` is used to prevent these\n" -"> configuration files from cluttering the terminal when a standard `ls` command\n" -"> is used." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:578 -msgid "> ## Orthogonality" -msgstr "> ## Orthogonality" - -#: shell-novice/_episodes/02-filedir.md:579 -msgid "" -">\n" -"> The special names `.` and `..` don't belong to `cd`;\n" -"> they are interpreted the same way by every program.\n" -"> For example,\n" -"> if we are in `/Users/nelle/data`,\n" -"> the command `ls ..` will give us a listing of `/Users/nelle`.\n" -"> When the meanings of the parts are the same no matter how they're combined,\n" -"> programmers say they are **orthogonal**:\n" -"> Orthogonal systems tend to be easier for people to learn\n" -"> because there are fewer special cases and exceptions to keep track of." -msgstr "" -">\n" -"> The special names `.` and `..` don't belong to `cd`;\n" -"> they are interpreted the same way by every program.\n" -"> For example,\n" -"> if we are in `/Users/nelle/data`,\n" -"> the command `ls ..` will give us a listing of `/Users/nelle`.\n" -"> When the meanings of the parts are the same no matter how they're combined,\n" -"> programmers say they are **orthogonal**:\n" -"> Orthogonal systems tend to be easier for people to learn\n" -"> because there are fewer special cases and exceptions to keep track of." - -#: shell-novice/_episodes/02-filedir.md:591 -msgid "" -"These then, are the basic commands for navigating the filesystem on your computer:\n" -"`pwd`, `ls` and `cd`. Let's explore some variations on those commands. What happens\n" -"if you type `cd` on its own, without giving\n" -"a directory? " -msgstr "" -"These then, are the basic commands for navigating the filesystem on your computer:\n" -"`pwd`, `ls` and `cd`. Let's explore some variations on those commands. What happens\n" -"if you type `cd` on its own, without giving\n" -"a directory? " - -# code block -#: shell-novice/_episodes/02-filedir.md:596 -msgid "" -"~~~\n" -"$ cd\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:601 -msgid "How can you check what happened? `pwd` gives us the answer! " -msgstr "How can you check what happened? `pwd` gives us the answer! " - -#: shell-novice/_episodes/02-filedir.md:613 -msgid "" -"It turns out that `cd` without an argument will return you to your home directory,\n" -"which is great if you've gotten lost in your own filesystem. " -msgstr "" -"It turns out that `cd` without an argument will return you to your home directory,\n" -"which is great if you've gotten lost in your own filesystem. " - -#: shell-novice/_episodes/02-filedir.md:616 -msgid "" -"Let's try returning to the `data` directory from before. Last time, we used\n" -"three commands, but we can actually string together the list of directories\n" -"to move to `data` in one step:" -msgstr "" -"Let's try returning to the `data` directory from before. Last time, we used\n" -"three commands, but we can actually string together the list of directories\n" -"to move to `data` in one step:" - -# code block -#: shell-novice/_episodes/02-filedir.md:620 -msgid "" -"~~~\n" -"$ cd Desktop/data-shell/data\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd Desktop/data-shell/data\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:625 -msgid "Check that we've moved to the right place by running `pwd` and `ls -F` " -msgstr "Check that we've moved to the right place by running `pwd` and `ls -F` " - -#: shell-novice/_episodes/02-filedir.md:627 -msgid "" -"If we want to move up one level from the data directory, we could use `cd ..`. But\n" -"there is another way to move to any directory, regardless of your\n" -"current location. " -msgstr "" -"If we want to move up one level from the data directory, we could use `cd ..`. But\n" -"there is another way to move to any directory, regardless of your\n" -"current location. " - -#: shell-novice/_episodes/02-filedir.md:631 -msgid "" -"So far, when specifying directory names, or even a directory path (as above),\n" -"we have been using **relative paths**. When you use a relative path with a command\n" -"like `ls` or `cd`, it tries to find that location from where we are,\n" -"rather than from the root of the file system. " -msgstr "" -"So far, when specifying directory names, or even a directory path (as above),\n" -"we have been using **relative paths**. When you use a relative path with a command\n" -"like `ls` or `cd`, it tries to find that location from where we are,\n" -"rather than from the root of the file system. " - -#: shell-novice/_episodes/02-filedir.md:636 -msgid "" -"However, it is possible to specify the **absolute path** to a directory by\n" -"including its entire path from the root directory, which is indicated by a\n" -"leading slash. The leading `/` tells the computer to follow the path from\n" -"the root of the file system, so it always refers to exactly one directory,\n" -"no matter where we are when we run the command." -msgstr "" -"However, it is possible to specify the **absolute path** to a directory by\n" -"including its entire path from the root directory, which is indicated by a\n" -"leading slash. The leading `/` tells the computer to follow the path from\n" -"the root of the file system, so it always refers to exactly one directory,\n" -"no matter where we are when we run the command." - -#: shell-novice/_episodes/02-filedir.md:642 -msgid "" -"This allows us to move to our `data-shell` directory from anywhere on\n" -"the filesystem (including from inside `data`). To find the absolute path\n" -"we're looking for, we can use `pwd` and then extract the piece we need\n" -"to move to `data-shell`. " -msgstr "" -"This allows us to move to our `data-shell` directory from anywhere on\n" -"the filesystem (including from inside `data`). To find the absolute path\n" -"we're looking for, we can use `pwd` and then extract the piece we need\n" -"to move to `data-shell`. " - -# code block -#: shell-novice/_episodes/02-filedir.md:657 -msgid "" -"~~~\n" -"$ cd /Users/nelle/Desktop/data-shell\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd /Users/nelle/Desktop/data-shell\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:662 -msgid "Run `pwd` and `ls -F` to ensure that we're in the directory we expect. " -msgstr "Run `pwd` and `ls -F` to ensure that we're in the directory we expect. " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:664 -msgid "> ## Two More Shortcuts" -msgstr "> ## Two More Shortcuts" - -#: shell-novice/_episodes/02-filedir.md:665 -msgid "" -">\n" -"> The shell interprets the character `~` (tilde) at the start of a path to\n" -"> mean \"the current user's home directory\". For example, if Nelle's home\n" -"> directory is `/Users/nelle`, then `~/data` is equivalent to\n" -"> `/Users/nelle/data`. This only works if it is the first character in the\n" -"> path: `here/there/~/elsewhere` is *not* `here/there/Users/nelle/elsewhere`.\n" -">\n" -"> Another shortcut is the `-` (dash) character. `cd` will translate `-` into\n" -"> *the previous directory I was in*, which is faster than having to remember,\n" -"> then type, the full path. This is a *very* efficient way of moving back\n" -"> and forth between directories. The difference between `cd ..` and `cd -` is\n" -"> that the former brings you *up*, while the latter brings you *back*. You can\n" -"> think of it as the *Last Channel* button on a TV remote." -msgstr "" -">\n" -"> The shell interprets the character `~` (tilde) at the start of a path to\n" -"> mean \"the current user's home directory\". For example, if Nelle's home\n" -"> directory is `/Users/nelle`, then `~/data` is equivalent to\n" -"> `/Users/nelle/data`. This only works if it is the first character in the\n" -"> path: `here/there/~/elsewhere` is *not* `here/there/Users/nelle/elsewhere`.\n" -">\n" -"> Another shortcut is the `-` (dash) character. `cd` will translate `-` into\n" -"> *the previous directory I was in*, which is faster than having to remember,\n" -"> then type, the full path. This is a *very* efficient way of moving back\n" -"> and forth between directories. The difference between `cd ..` and `cd -` is\n" -"> that the former brings you *up*, while the latter brings you *back*. You can\n" -"> think of it as the *Last Channel* button on a TV remote." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:680 -msgid "> ## Absolute vs Relative Paths" -msgstr "> ## Absolute vs Relative Paths" - -#: shell-novice/_episodes/02-filedir.md:681 -msgid "" -">\n" -"> Starting from `/Users/amanda/data/`,\n" -"> which of the following commands could Amanda use to navigate to her home directory,\n" -"> which is `/Users/amanda`?\n" -">\n" -"> 1. `cd .`\n" -"> 2. `cd /`\n" -"> 3. `cd /home/amanda`\n" -"> 4. `cd ../..`\n" -"> 5. `cd ~`\n" -"> 6. `cd home`\n" -"> 7. `cd ~/data/..`\n" -"> 8. `cd`\n" -"> 9. `cd ..`\n" -">\n" -"> > ## Solution\n" -"> > 1. No: `.` stands for the current directory.\n" -"> > 2. No: `/` stands for the root directory.\n" -"> > 3. No: Amanda's home directory is `/Users/amanda`.\n" -"> > 4. No: this goes up two levels, i.e. ends in `/Users`.\n" -"> > 5. Yes: `~` stands for the user's home directory, in this case `/Users/amanda`.\n" -"> > 6. No: this would navigate into a directory `home` in the current directory if it exists.\n" -"> > 7. Yes: unnecessarily complicated, but correct.\n" -"> > 8. Yes: shortcut to go back to the user's home directory.\n" -"> > 9. Yes: goes up one level." -msgstr "" -">\n" -"> Starting from `/Users/amanda/data/`,\n" -"> which of the following commands could Amanda use to navigate to her home directory,\n" -"> which is `/Users/amanda`?\n" -">\n" -"> 1. `cd .`\n" -"> 2. `cd /`\n" -"> 3. `cd /home/amanda`\n" -"> 4. `cd ../..`\n" -"> 5. `cd ~`\n" -"> 6. `cd home`\n" -"> 7. `cd ~/data/..`\n" -"> 8. `cd`\n" -"> 9. `cd ..`\n" -">\n" -"> > ## Solution\n" -"> > 1. No: `.` stands for the current directory.\n" -"> > 2. No: `/` stands for the root directory.\n" -"> > 3. No: Amanda's home directory is `/Users/amanda`.\n" -"> > 4. No: this goes up two levels, i.e. ends in `/Users`.\n" -"> > 5. Yes: `~` stands for the user's home directory, in this case `/Users/amanda`.\n" -"> > 6. No: this would navigate into a directory `home` in the current directory if it exists.\n" -"> > 7. Yes: unnecessarily complicated, but correct.\n" -"> > 8. Yes: shortcut to go back to the user's home directory.\n" -"> > 9. Yes: goes up one level." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:709 -msgid "> ## Relative Path Resolution" -msgstr "> ## Relative Path Resolution" - -#: shell-novice/_episodes/02-filedir.md:710 -msgid "" -">\n" -"> Using the filesystem diagram below, if `pwd` displays `/Users/thing`,\n" -"> what will `ls -F ../backup` display?\n" -">\n" -"> 1. `../backup: No such file or directory`\n" -"> 2. `2012-12-01 2013-01-08 2013-01-27`\n" -"> 3. `2012-12-01/ 2013-01-08/ 2013-01-27/`\n" -"> 4. `original/ pnas_final/ pnas_sub/`\n" -">\n" -"> ![File System for Challenge Questions](../fig/filesystem-challenge.svg)\n" -">\n" -"> > ## Solution\n" -"> > 1. No: there *is* a directory `backup` in `/Users`.\n" -"> > 2. No: this is the content of `Users/thing/backup`,\n" -"> > but with `..` we asked for one level further up.\n" -"> > 3. No: see previous explanation.\n" -"> > 4. Yes: `../backup/` refers to `/Users/backup/`." -msgstr "" -">\n" -"> Using the filesystem diagram below, if `pwd` displays `/Users/thing`,\n" -"> what will `ls -F ../backup` display?\n" -">\n" -"> 1. `../backup: No such file or directory`\n" -"> 2. `2012-12-01 2013-01-08 2013-01-27`\n" -"> 3. `2012-12-01/ 2013-01-08/ 2013-01-27/`\n" -"> 4. `original/ pnas_final/ pnas_sub/`\n" -">\n" -"> ![File System for Challenge Questions](../fig/filesystem-challenge.svg)\n" -">\n" -"> > ## Solution\n" -"> > 1. No: there *is* a directory `backup` in `/Users`.\n" -"> > 2. No: this is the content of `Users/thing/backup`,\n" -"> > but with `..` we asked for one level further up.\n" -"> > 3. No: see previous explanation.\n" -"> > 4. Yes: `../backup/` refers to `/Users/backup/`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:730 -msgid "> ## `ls` Reading Comprehension" -msgstr "> ## `ls` Reading Comprehension" - -#: shell-novice/_episodes/02-filedir.md:731 -msgid "" -">\n" -"> Assuming a directory structure as in the above Figure\n" -"> (File System for Challenge Questions), if `pwd` displays `/Users/backup`,\n" -"> and `-r` tells `ls` to display things in reverse order,\n" -"> what command will display:\n" -">\n" -"> ~~~\n" -"> pnas_sub/ pnas_final/ original/\n" -"> ~~~" -msgstr "" -">\n" -"> Assuming a directory structure as in the above Figure\n" -"> (File System for Challenge Questions), if `pwd` displays `/Users/backup`,\n" -"> and `-r` tells `ls` to display things in reverse order,\n" -"> what command will display:\n" -">\n" -"> ~~~\n" -"> pnas_sub/ pnas_final/ original/\n" -"> ~~~" - -# SC/DC Template label -#: shell-novice/_episodes/02-filedir.md:740 -#: shell-novice/_episodes/03-create.md:569 -#: shell-novice/_episodes/03-create.md:577 -#: shell-novice/_episodes/03-create.md:619 -#: shell-novice/_episodes/03-create.md:632 -#: shell-novice/_episodes/03-create.md:640 -#: shell-novice/_episodes/03-create.md:674 -#: shell-novice/_episodes/04-pipefilter.md:323 -#: shell-novice/_episodes/04-pipefilter.md:334 -#: shell-novice/_episodes/04-pipefilter.md:630 -#: shell-novice/_episodes/04-pipefilter.md:691 -#: shell-novice/_episodes/04-pipefilter.md:716 -#: shell-novice/_episodes/05-loop.md:124 shell-novice/_episodes/05-loop.md:369 -#: shell-novice/_episodes/05-loop.md:559 shell-novice/_episodes/07-find.md:239 -#: shell-novice/_episodes/07-find.md:272 -msgid "> {: .output}" -msgstr "> {: .output}" - -#: shell-novice/_episodes/02-filedir.md:741 -msgid "" -">\n" -"> 1. `ls pwd`\n" -"> 2. `ls -r -F`\n" -"> 3. `ls -r -F /Users/backup`\n" -"> 4. Either #2 or #3 above, but not #1.\n" -">\n" -"> > ## Solution\n" -"> > 1. No: `pwd` is not the name of a directory.\n" -"> > 2. Yes: `ls` without directory argument lists files and directories\n" -"> > in the current directory.\n" -"> > 3. Yes: uses the absolute path explicitly.\n" -"> > 4. Correct: see explanations above." -msgstr "" -">\n" -"> 1. `ls pwd`\n" -"> 2. `ls -r -F`\n" -"> 3. `ls -r -F /Users/backup`\n" -"> 4. Either #2 or #3 above, but not #1.\n" -">\n" -"> > ## Solution\n" -"> > 1. No: `pwd` is not the name of a directory.\n" -"> > 2. Yes: `ls` without directory argument lists files and directories\n" -"> > in the current directory.\n" -"> > 3. Yes: uses the absolute path explicitly.\n" -"> > 4. Correct: see explanations above." - -# header -#: shell-novice/_episodes/02-filedir.md:756 -msgid "### Nelle's Pipeline: Organizing Files" -msgstr "### Nelle's Pipeline: Organizing Files" - -#: shell-novice/_episodes/02-filedir.md:758 -msgid "" -"Knowing just this much about files and directories,\n" -"Nelle is ready to organize the files that the protein assay machine will create.\n" -"First,\n" -"she creates a directory called `north-pacific-gyre`\n" -"(to remind herself where the data came from).\n" -"Inside that,\n" -"she creates a directory called `2012-07-03`,\n" -"which is the date she started processing the samples.\n" -"She used to use names like `conference-paper` and `revised-results`,\n" -"but she found them hard to understand after a couple of years.\n" -"(The final straw was when she found herself creating\n" -"a directory called `revised-revised-results-3`.)" -msgstr "" -"Knowing just this much about files and directories,\n" -"Nelle is ready to organize the files that the protein assay machine will create.\n" -"First,\n" -"she creates a directory called `north-pacific-gyre`\n" -"(to remind herself where the data came from).\n" -"Inside that,\n" -"she creates a directory called `2012-07-03`,\n" -"which is the date she started processing the samples.\n" -"She used to use names like `conference-paper` and `revised-results`,\n" -"but she found them hard to understand after a couple of years.\n" -"(The final straw was when she found herself creating\n" -"a directory called `revised-revised-results-3`.)" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/02-filedir.md:771 -msgid "> ## Sorting Output" -msgstr "> ## Sorting Output" - -#: shell-novice/_episodes/02-filedir.md:772 -msgid "" -">\n" -"> Nelle names her directories \"year-month-day\",\n" -"> with leading zeroes for months and days,\n" -"> because the shell displays file and directory names in alphabetical order.\n" -"> If she used month names,\n" -"> December would come before July;\n" -"> if she didn't use leading zeroes,\n" -"> November ('11') would come before July ('7'). Similarly, putting the year first\n" -"> means that June 2012 will come before June 2013." -msgstr "" -">\n" -"> Nelle names her directories \"year-month-day\",\n" -"> with leading zeroes for months and days,\n" -"> because the shell displays file and directory names in alphabetical order.\n" -"> If she used month names,\n" -"> December would come before July;\n" -"> if she didn't use leading zeroes,\n" -"> November ('11') would come before July ('7'). Similarly, putting the year first\n" -"> means that June 2012 will come before June 2013." - -#: shell-novice/_episodes/02-filedir.md:783 -msgid "" -"Each of her physical samples is labelled according to her lab's convention\n" -"with a unique ten-character ID,\n" -"such as \"NENE01729A\".\n" -"This is what she used in her collection log\n" -"to record the location, time, depth, and other characteristics of the sample,\n" -"so she decides to use it as part of each data file's name.\n" -"Since the assay machine's output is plain text,\n" -"she will call her files `NENE01729A.txt`, `NENE01812A.txt`, and so on.\n" -"All 1520 files will go into the same directory." -msgstr "" -"Each of her physical samples is labelled according to her lab's convention\n" -"with a unique ten-character ID,\n" -"such as \"NENE01729A\".\n" -"This is what she used in her collection log\n" -"to record the location, time, depth, and other characteristics of the sample,\n" -"so she decides to use it as part of each data file's name.\n" -"Since the assay machine's output is plain text,\n" -"she will call her files `NENE01729A.txt`, `NENE01812A.txt`, and so on.\n" -"All 1520 files will go into the same directory." - -#: shell-novice/_episodes/02-filedir.md:793 -msgid "" -"Now in her current directory `data-shell`,\n" -"Nelle can see what files she has using the command:" -msgstr "" -"Now in her current directory `data-shell`,\n" -"Nelle can see what files she has using the command:" - -# code block -#: shell-novice/_episodes/02-filedir.md:796 -msgid "" -"~~~\n" -"$ ls north-pacific-gyre/2012-07-03/\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls north-pacific-gyre/2012-07-03/\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:801 -msgid "" -"This is a lot to type,\n" -"but she can let the shell do most of the work through what is called **tab completion**.\n" -"If she types:" -msgstr "" -"This is a lot to type,\n" -"but she can let the shell do most of the work through what is called **tab completion**.\n" -"If she types:" - -# code block -#: shell-novice/_episodes/02-filedir.md:805 -msgid "" -"~~~\n" -"$ ls nor\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls nor\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:810 -msgid "" -"and then presses tab (the tab key on her keyboard),\n" -"the shell automatically completes the directory name for her:" -msgstr "" -"and then presses tab (the tab key on her keyboard),\n" -"the shell automatically completes the directory name for her:" - -# code block -#: shell-novice/_episodes/02-filedir.md:813 -msgid "" -"~~~\n" -"$ ls north-pacific-gyre/\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls north-pacific-gyre/\n" -"~~~" - -#: shell-novice/_episodes/02-filedir.md:818 -msgid "" -"If she presses tab again,\n" -"Bash will add `2012-07-03/` to the command,\n" -"since it's the only possible completion.\n" -"Pressing tab again does nothing,\n" -"since there are 19 possibilities;\n" -"pressing tab twice brings up a list of all the files,\n" -"and so on.\n" -"This is called **tab completion**,\n" -"and we will see it in many other tools as we go on." -msgstr "" -"If she presses tab again,\n" -"Bash will add `2012-07-03/` to the command,\n" -"since it's the only possible completion.\n" -"Pressing tab again does nothing,\n" -"since there are 19 possibilities;\n" -"pressing tab twice brings up a list of all the files,\n" -"and so on.\n" -"This is called **tab completion**,\n" -"and we will see it in many other tools as we go on." - -# Front Matter -#: shell-novice/_episodes/03-create.md:1 -msgid "" -"---\n" -"title: \"Working With Files and Directories\"\n" -"teaching: 25\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I create, copy, and delete files and directories?\"\n" -"- \"How can I edit files?\"\n" -"objectives:\n" -"- \"Create a directory hierarchy that matches a given diagram.\"\n" -"- \"Create files in that hierarchy using an editor or by copying and renaming existing files.\"\n" -"- \"Delete specified files and/or directories.\"\n" -"keypoints:\n" -"- \"`cp old new` copies a file.\"\n" -"- \"`mkdir path` creates a new directory.\"\n" -"- \"`mv old new` moves (renames) a file or directory.\"\n" -"- \"`rm path` removes (deletes) a file.\"\n" -"- \"Use of the Control key may be described in many ways, including `Ctrl-X`, `Control-X`, and `^X`.\"\n" -"- \"The shell does not have a trash bin: once something is deleted, it's really gone.\"\n" -"- \"Depending on the type of work you do, you may need a more powerful text editor than Nano.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Working With Files and Directories\"\n" -"teaching: 25\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I create, copy, and delete files and directories?\"\n" -"- \"How can I edit files?\"\n" -"objectives:\n" -"- \"Create a directory hierarchy that matches a given diagram.\"\n" -"- \"Create files in that hierarchy using an editor or by copying and renaming existing files.\"\n" -"- \"Delete specified files and/or directories.\"\n" -"keypoints:\n" -"- \"`cp old new` copies a file.\"\n" -"- \"`mkdir path` creates a new directory.\"\n" -"- \"`mv old new` moves (renames) a file or directory.\"\n" -"- \"`rm path` removes (deletes) a file.\"\n" -"- \"Use of the Control key may be described in many ways, including `Ctrl-X`, `Control-X`, and `^X`.\"\n" -"- \"The shell does not have a trash bin: once something is deleted, it's really gone.\"\n" -"- \"Depending on the type of work you do, you may need a more powerful text editor than Nano.\"\n" -"---" - -#: shell-novice/_episodes/03-create.md:22 -msgid "" -"We now know how to explore files and directories,\n" -"but how do we create them in the first place?\n" -"Let's go back to our `data-shell` directory on the Desktop\n" -"and use `ls -F` to see what it contains:" -msgstr "" -"We now know how to explore files and directories,\n" -"but how do we create them in the first place?\n" -"Let's go back to our `data-shell` directory on the Desktop\n" -"and use `ls -F` to see what it contains:" - -# code block -#: shell-novice/_episodes/03-create.md:42 -msgid "" -"~~~\n" -"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf writing/\n" -"~~~" -msgstr "" -"~~~\n" -"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf writing/\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:47 -msgid "" -"Let's create a new directory called `thesis` using the command `mkdir thesis`\n" -"(which has no output):" -msgstr "" -"Let's create a new directory called `thesis` using the command `mkdir thesis`\n" -"(which has no output):" - -# code block -#: shell-novice/_episodes/03-create.md:50 -msgid "" -"~~~\n" -"$ mkdir thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ mkdir thesis\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:55 -msgid "" -"As you might guess from its name,\n" -"`mkdir` means \"make directory\".\n" -"Since `thesis` is a relative path\n" -"(i.e., doesn't have a leading slash),\n" -"the new directory is created in the current working directory:" -msgstr "" -"As you might guess from its name,\n" -"`mkdir` means \"make directory\".\n" -"Since `thesis` is a relative path\n" -"(i.e., doesn't have a leading slash),\n" -"the new directory is created in the current working directory:" - -# code block -#: shell-novice/_episodes/03-create.md:66 -msgid "" -"~~~\n" -"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf thesis/ writing/\n" -"~~~" -msgstr "" -"~~~\n" -"creatures/ data/ molecules/ north-pacific-gyre/ notes.txt pizza.cfg solar.pdf thesis/ writing/\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:71 -msgid "> ## Two ways of doing the same thing" -msgstr "> ## Two ways of doing the same thing" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:72 -msgid "> Using the shell to create a directory is no different than using a file explorer." -msgstr "> Using the shell to create a directory is no different than using a file explorer." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:73 -msgid "> If you open the current directory using your operating system's graphical file explorer," -msgstr "> If you open the current directory using your operating system's graphical file explorer," - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:74 -msgid "> the `thesis` directory will appear there too." -msgstr "> the `thesis` directory will appear there too." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:75 -msgid "> While they are two different ways of interacting with the files," -msgstr "> While they are two different ways of interacting with the files," - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:76 -msgid "> the files and directories themselves are the same." -msgstr "> the files and directories themselves are the same." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:79 -msgid "> ## Good names for files and directories" -msgstr "> ## Good names for files and directories" - -#: shell-novice/_episodes/03-create.md:80 -msgid "" -">\n" -"> Complicated names of files and directories can make your life painful\n" -"> when working on the command line. Here we provide a few useful\n" -"> tips for the names of your files.\n" -">\n" -"> 1. Don't use whitespaces.\n" -">\n" -"> Whitespaces can make a name more meaningful\n" -"> but since whitespace is used to break arguments on the command line\n" -"> it is better to avoid them in names of files and directories.\n" -"> You can use `-` or `_` instead of whitespace.\n" -">\n" -"> 2. Don't begin the name with `-` (dash).\n" -">\n" -"> Commands treat names starting with `-` as options.\n" -">\n" -"> 3. Stick with letters, numbers, `.` (period), `-` (dash) and `_` (underscore).\n" -">\n" -"> Many other characters have special meanings on the command line.\n" -"> We will learn about some of these during this lesson.\n" -"> There are special characters that can cause your command to not work as\n" -"> expected and can even result in data loss.\n" -">\n" -"> If you need to refer to names of files or directories that have whitespace\n" -"> or another non-alphanumeric character, you should surround the name in quotes (`\"\"`)." -msgstr "" -">\n" -"> Complicated names of files and directories can make your life painful\n" -"> when working on the command line. Here we provide a few useful\n" -"> tips for the names of your files.\n" -">\n" -"> 1. Don't use whitespaces.\n" -">\n" -"> Whitespaces can make a name more meaningful\n" -"> but since whitespace is used to break arguments on the command line\n" -"> it is better to avoid them in names of files and directories.\n" -"> You can use `-` or `_` instead of whitespace.\n" -">\n" -"> 2. Don't begin the name with `-` (dash).\n" -">\n" -"> Commands treat names starting with `-` as options.\n" -">\n" -"> 3. Stick with letters, numbers, `.` (period), `-` (dash) and `_` (underscore).\n" -">\n" -"> Many other characters have special meanings on the command line.\n" -"> We will learn about some of these during this lesson.\n" -"> There are special characters that can cause your command to not work as\n" -"> expected and can even result in data loss.\n" -">\n" -"> If you need to refer to names of files or directories that have whitespace\n" -"> or another non-alphanumeric character, you should surround the name in quotes (`\"\"`)." - -#: shell-novice/_episodes/03-create.md:107 -msgid "Since we've just created the `thesis` directory, there's nothing in it yet:" -msgstr "Since we've just created the `thesis` directory, there's nothing in it yet:" - -# code block -#: shell-novice/_episodes/03-create.md:109 -msgid "" -"~~~\n" -"$ ls -F thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls -F thesis\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:114 -msgid "" -"Let's change our working directory to `thesis` using `cd`,\n" -"then run a text editor called Nano to create a file called `draft.txt`:" -msgstr "" -"Let's change our working directory to `thesis` using `cd`,\n" -"then run a text editor called Nano to create a file called `draft.txt`:" - -# code block -#: shell-novice/_episodes/03-create.md:117 -msgid "" -"~~~\n" -"$ cd thesis\n" -"$ nano draft.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd thesis\n" -"$ nano draft.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:123 -msgid "> ## Which Editor?" -msgstr "> ## Which Editor?" - -#: shell-novice/_episodes/03-create.md:124 -msgid "" -">\n" -"> When we say, \"`nano` is a text editor,\" we really do mean \"text\": it can\n" -"> only work with plain character data, not tables, images, or any other\n" -"> human-friendly media. We use it in examples because it is one of the \n" -"> least complex text editors. However, because of this trait, it may \n" -"> not be powerful enough or flexible enough for the work you need to do\n" -"> after this workshop. On Unix systems (such as Linux and Mac OS X),\n" -"> many programmers use [Emacs](http://www.gnu.org/software/emacs/) or\n" -"> [Vim](http://www.vim.org/) (both of which require more time to learn), \n" -"> or a graphical editor such as\n" -"> [Gedit](http://projects.gnome.org/gedit/). On Windows, you may wish to\n" -"> use [Notepad++](http://notepad-plus-plus.org/). Windows also has a built-in\n" -"> editor called `notepad` that can be run from the command line in the same\n" -"> way as `nano` for the purposes of this lesson. \n" -">\n" -"> No matter what editor you use, you will need to know where it searches\n" -"> for and saves files. If you start it from the shell, it will (probably)\n" -"> use your current working directory as its default location. If you use\n" -"> your computer's start menu, it may want to save files in your desktop or\n" -"> documents directory instead. You can change this by navigating to\n" -"> another directory the first time you \"Save As...\"" -msgstr "" -">\n" -"> When we say, \"`nano` is a text editor,\" we really do mean \"text\": it can\n" -"> only work with plain character data, not tables, images, or any other\n" -"> human-friendly media. We use it in examples because it is one of the \n" -"> least complex text editors. However, because of this trait, it may \n" -"> not be powerful enough or flexible enough for the work you need to do\n" -"> after this workshop. On Unix systems (such as Linux and Mac OS X),\n" -"> many programmers use [Emacs](http://www.gnu.org/software/emacs/) or\n" -"> [Vim](http://www.vim.org/) (both of which require more time to learn), \n" -"> or a graphical editor such as\n" -"> [Gedit](http://projects.gnome.org/gedit/). On Windows, you may wish to\n" -"> use [Notepad++](http://notepad-plus-plus.org/). Windows also has a built-in\n" -"> editor called `notepad` that can be run from the command line in the same\n" -"> way as `nano` for the purposes of this lesson. \n" -">\n" -"> No matter what editor you use, you will need to know where it searches\n" -"> for and saves files. If you start it from the shell, it will (probably)\n" -"> use your current working directory as its default location. If you use\n" -"> your computer's start menu, it may want to save files in your desktop or\n" -"> documents directory instead. You can change this by navigating to\n" -"> another directory the first time you \"Save As...\"" - -#: shell-novice/_episodes/03-create.md:147 -msgid "" -"Let's type in a few lines of text.\n" -"Once we're happy with our text, we can press `Ctrl-O` (press the Ctrl or Control key and, while\n" -"holding it down, press the O key) to write our data to disk\n" -"(we'll be asked what file we want to save this to:\n" -"press Return to accept the suggested default of `draft.txt`)." -msgstr "" -"Let's type in a few lines of text.\n" -"Once we're happy with our text, we can press `Ctrl-O` (press the Ctrl or Control key and, while\n" -"holding it down, press the O key) to write our data to disk\n" -"(we'll be asked what file we want to save this to:\n" -"press Return to accept the suggested default of `draft.txt`)." - -#: shell-novice/_episodes/03-create.md:153 -msgid "![Nano in Action](../fig/nano-screenshot.png)" -msgstr "![Nano in Action](../fig/nano-screenshot.png)" - -#: shell-novice/_episodes/03-create.md:155 -msgid "" -"Once our file is saved, we can use `Ctrl-X` to quit the editor and\n" -"return to the shell." -msgstr "" -"Once our file is saved, we can use `Ctrl-X` to quit the editor and\n" -"return to the shell." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:158 -msgid "> ## Control, Ctrl, or ^ Key" -msgstr "> ## Control, Ctrl, or ^ Key" - -#: shell-novice/_episodes/03-create.md:159 -msgid "" -">\n" -"> The Control key is also called the \"Ctrl\" key. There are various ways\n" -"> in which using the Control key may be described. For example, you may\n" -"> see an instruction to press the Control key and, while holding it down,\n" -"> press the X key, described as any of:\n" -">\n" -"> * `Control-X`\n" -"> * `Control+X`\n" -"> * `Ctrl-X`\n" -"> * `Ctrl+X`\n" -"> * `^X`\n" -"> * `C-x`\n" -">\n" -"> In nano, along the bottom of the screen you'll see `^G Get Help ^O WriteOut`.\n" -"> This means that you can use `Control-G` to get help and `Control-O` to save your\n" -"> file." -msgstr "" -">\n" -"> The Control key is also called the \"Ctrl\" key. There are various ways\n" -"> in which using the Control key may be described. For example, you may\n" -"> see an instruction to press the Control key and, while holding it down,\n" -"> press the X key, described as any of:\n" -">\n" -"> * `Control-X`\n" -"> * `Control+X`\n" -"> * `Ctrl-X`\n" -"> * `Ctrl+X`\n" -"> * `^X`\n" -"> * `C-x`\n" -">\n" -"> In nano, along the bottom of the screen you'll see `^G Get Help ^O WriteOut`.\n" -"> This means that you can use `Control-G` to get help and `Control-O` to save your\n" -"> file." - -#: shell-novice/_episodes/03-create.md:177 -msgid "" -"`nano` doesn't leave any output on the screen after it exits,\n" -"but `ls` now shows that we have created a file called `draft.txt`:" -msgstr "" -"`nano` doesn't leave any output on the screen after it exits,\n" -"but `ls` now shows that we have created a file called `draft.txt`:" - -# code block -#: shell-novice/_episodes/03-create.md:185 -#: shell-novice/_episodes/03-create.md:278 -#: shell-novice/_episodes/03-create.md:367 -msgid "" -"~~~\n" -"draft.txt\n" -"~~~" -msgstr "" -"~~~\n" -"draft.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:190 -msgid "> ## Creating Files a Different Way" -msgstr "> ## Creating Files a Different Way" - -#: shell-novice/_episodes/03-create.md:191 -msgid "" -">\n" -"> We have seen how to create text files using the `nano` editor.\n" -"> Now, try the following command in your home directory:\n" -">\n" -"> ~~~\n" -"> $ cd # go to your home directory\n" -"> $ touch my_file.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. What did the touch command do?\n" -"> When you look at your home directory using the GUI file explorer,\n" -"> does the file show up?\n" -">\n" -"> 2. Use `ls -l` to inspect the files. How large is `my_file.txt`?\n" -">\n" -"> 3. When might you want to create a file this way?\n" -">\n" -"> > ## Solution\n" -"> > 1. The touch command generates a new file called 'my_file.txt' in\n" -"> > your home directory. If you are in your home directory, you\n" -"> > can observe this newly generated file by typing 'ls' at the \n" -"> > command line prompt. 'my_file.txt' can also be viewed in your\n" -"> > GUI file explorer.\n" -"> >\n" -"> > 2. When you inspect the file with 'ls -l', note that the size of\n" -"> > 'my_file.txt' is 0kb. In other words, it contains no data.\n" -"> > If you open 'my_file.txt' using your text editor it is blank.\n" -"> >\n" -"> > 3. Some programs do not generate output files themselves, but\n" -"> > instead require that empty files have already been generated.\n" -"> > When the program is run, it searches for an existing file to\n" -"> > populate with its output. The touch command allows you to\n" -"> > efficiently generate a blank text file to be used by such\n" -"> > programs." -msgstr "" -">\n" -"> We have seen how to create text files using the `nano` editor.\n" -"> Now, try the following command in your home directory:\n" -">\n" -"> ~~~\n" -"> $ cd # go to your home directory\n" -"> $ touch my_file.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. What did the touch command do?\n" -"> When you look at your home directory using the GUI file explorer,\n" -"> does the file show up?\n" -">\n" -"> 2. Use `ls -l` to inspect the files. How large is `my_file.txt`?\n" -">\n" -"> 3. When might you want to create a file this way?\n" -">\n" -"> > ## Solution\n" -"> > 1. The touch command generates a new file called 'my_file.txt' in\n" -"> > your home directory. If you are in your home directory, you\n" -"> > can observe this newly generated file by typing 'ls' at the \n" -"> > command line prompt. 'my_file.txt' can also be viewed in your\n" -"> > GUI file explorer.\n" -"> >\n" -"> > 2. When you inspect the file with 'ls -l', note that the size of\n" -"> > 'my_file.txt' is 0kb. In other words, it contains no data.\n" -"> > If you open 'my_file.txt' using your text editor it is blank.\n" -"> >\n" -"> > 3. Some programs do not generate output files themselves, but\n" -"> > instead require that empty files have already been generated.\n" -"> > When the program is run, it searches for an existing file to\n" -"> > populate with its output. The touch command allows you to\n" -"> > efficiently generate a blank text file to be used by such\n" -"> > programs." - -#: shell-novice/_episodes/03-create.md:229 -msgid "" -"Returning to the `data-shell` directory,\n" -"let's tidy up the `thesis` directory by removing the draft we created:" -msgstr "" -"Returning to the `data-shell` directory,\n" -"let's tidy up the `thesis` directory by removing the draft we created:" - -# code block -#: shell-novice/_episodes/03-create.md:232 -msgid "" -"~~~\n" -"$ cd thesis\n" -"$ rm draft.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd thesis\n" -"$ rm draft.txt\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:238 -msgid "" -"This command removes files (`rm` is short for \"remove\").\n" -"If we run `ls` again,\n" -"its output is empty once more,\n" -"which tells us that our file is gone:" -msgstr "" -"This command removes files (`rm` is short for \"remove\").\n" -"If we run `ls` again,\n" -"its output is empty once more,\n" -"which tells us that our file is gone:" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:248 -msgid "> ## Deleting Is Forever" -msgstr "> ## Deleting Is Forever" - -#: shell-novice/_episodes/03-create.md:249 -msgid "" -">\n" -"> The Unix shell doesn't have a trash bin that we can recover deleted\n" -"> files from (though most graphical interfaces to Unix do). Instead,\n" -"> when we delete files, they are unhooked from the file system so that\n" -"> their storage space on disk can be recycled. Tools for finding and\n" -"> recovering deleted files do exist, but there's no guarantee they'll\n" -"> work in any particular situation, since the computer may recycle the\n" -"> file's disk space right away." -msgstr "" -">\n" -"> The Unix shell doesn't have a trash bin that we can recover deleted\n" -"> files from (though most graphical interfaces to Unix do). Instead,\n" -"> when we delete files, they are unhooked from the file system so that\n" -"> their storage space on disk can be recycled. Tools for finding and\n" -"> recovering deleted files do exist, but there's no guarantee they'll\n" -"> work in any particular situation, since the computer may recycle the\n" -"> file's disk space right away." - -#: shell-novice/_episodes/03-create.md:259 -msgid "" -"Let's re-create that file\n" -"and then move up one directory to `/Users/nelle/Desktop/data-shell` using `cd ..`:" -msgstr "" -"Let's re-create that file\n" -"and then move up one directory to `/Users/nelle/Desktop/data-shell` using `cd ..`:" - -# code block -#: shell-novice/_episodes/03-create.md:267 -msgid "" -"~~~\n" -"/Users/nelle/Desktop/data-shell/thesis\n" -"~~~" -msgstr "" -"~~~\n" -"/Users/nelle/Desktop/data-shell/thesis\n" -"~~~" - -# code block -#: shell-novice/_episodes/03-create.md:272 -msgid "" -"~~~\n" -"$ nano draft.txt\n" -"$ ls\n" -"~~~" -msgstr "" -"~~~\n" -"$ nano draft.txt\n" -"$ ls\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:288 -msgid "" -"If we try to remove the entire `thesis` directory using `rm thesis`,\n" -"we get an error message:" -msgstr "" -"If we try to remove the entire `thesis` directory using `rm thesis`,\n" -"we get an error message:" - -# code block -#: shell-novice/_episodes/03-create.md:291 -msgid "" -"~~~\n" -"$ rm thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ rm thesis\n" -"~~~" - -# code block -#: shell-novice/_episodes/03-create.md:296 -msgid "" -"~~~\n" -"rm: cannot remove `thesis': Is a directory\n" -"~~~" -msgstr "" -"~~~\n" -"rm: cannot remove `thesis': Is a directory\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:301 -msgid "This happens because `rm` by default only works on files, not directories." -msgstr "This happens because `rm` by default only works on files, not directories." - -#: shell-novice/_episodes/03-create.md:303 -msgid "" -"To really get rid of `thesis` we must also delete the file `draft.txt`.\n" -"We can do this with the [recursive](https://en.wikipedia.org/wiki/Recursion) option for `rm`:" -msgstr "" -"To really get rid of `thesis` we must also delete the file `draft.txt`.\n" -"We can do this with the [recursive](https://en.wikipedia.org/wiki/Recursion) option for `rm`:" - -# code block -#: shell-novice/_episodes/03-create.md:306 -msgid "" -"~~~\n" -"$ rm -r thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ rm -r thesis\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:311 -msgid "> ## Using `rm` Safely" -msgstr "> ## Using `rm` Safely" - -#: shell-novice/_episodes/03-create.md:312 -msgid "" -">\n" -"> What happens when we type `rm -i thesis/quotations.txt`?\n" -"> Why would we want this protection when using `rm`?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ rm: remove regular file 'thesis/quotations.txt'?\n" -"> > ```\n" -"> > {: .language-bash} \n" -"> > The -i option will prompt before every removal. \n" -"> > The Unix shell doesn't have a trash bin, so all the files removed will disappear forever. \n" -"> > By using the -i flag, we have the chance to check that we are deleting only the files that we want to remove." -msgstr "" -">\n" -"> What happens when we type `rm -i thesis/quotations.txt`?\n" -"> Why would we want this protection when using `rm`?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ rm: remove regular file 'thesis/quotations.txt'?\n" -"> > ```\n" -"> > {: .language-bash} \n" -"> > The -i option will prompt before every removal. \n" -"> > The Unix shell doesn't have a trash bin, so all the files removed will disappear forever. \n" -"> > By using the -i flag, we have the chance to check that we are deleting only the files that we want to remove." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:327 -msgid "> ## With Great Power Comes Great Responsibility" -msgstr "> ## With Great Power Comes Great Responsibility" - -#: shell-novice/_episodes/03-create.md:328 -msgid "" -">\n" -"> Removing the files in a directory recursively can be a very dangerous\n" -"> operation. If we're concerned about what we might be deleting we can\n" -"> add the \"interactive\" flag `-i` to `rm` which will ask us for confirmation\n" -"> before each step\n" -">\n" -"> ~~~\n" -"> $ rm -r -i thesis\n" -"> rm: descend into directory ‘thesis’? y\n" -"> rm: remove regular file ‘thesis/draft.txt’? y\n" -"> rm: remove directory ‘thesis’? y\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> This removes everything in the directory, then the directory itself, asking\n" -"> at each step for you to confirm the deletion." -msgstr "" -">\n" -"> Removing the files in a directory recursively can be a very dangerous\n" -"> operation. If we're concerned about what we might be deleting we can\n" -"> add the \"interactive\" flag `-i` to `rm` which will ask us for confirmation\n" -"> before each step\n" -">\n" -"> ~~~\n" -"> $ rm -r -i thesis\n" -"> rm: descend into directory ‘thesis’? y\n" -"> rm: remove regular file ‘thesis/draft.txt’? y\n" -"> rm: remove directory ‘thesis’? y\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> This removes everything in the directory, then the directory itself, asking\n" -"> at each step for you to confirm the deletion." - -#: shell-novice/_episodes/03-create.md:346 -msgid "" -"Let's create that directory and file one more time.\n" -"(Note that this time we're running `nano` with the path `thesis/draft.txt`,\n" -"rather than going into the `thesis` directory and running `nano` on `draft.txt` there.)" -msgstr "" -"Let's create that directory and file one more time.\n" -"(Note that this time we're running `nano` with the path `thesis/draft.txt`,\n" -"rather than going into the `thesis` directory and running `nano` on `draft.txt` there.)" - -# code block -#: shell-novice/_episodes/03-create.md:360 -msgid "" -"~~~\n" -"$ mkdir thesis\n" -"$ nano thesis/draft.txt\n" -"$ ls thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ mkdir thesis\n" -"$ nano thesis/draft.txt\n" -"$ ls thesis\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:372 -msgid "" -"`draft.txt` isn't a particularly informative name,\n" -"so let's change the file's name using `mv`,\n" -"which is short for \"move\":" -msgstr "" -"`draft.txt` isn't a particularly informative name,\n" -"so let's change the file's name using `mv`,\n" -"which is short for \"move\":" - -# code block -#: shell-novice/_episodes/03-create.md:376 -msgid "" -"~~~\n" -"$ mv thesis/draft.txt thesis/quotes.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ mv thesis/draft.txt thesis/quotes.txt\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:381 -msgid "" -"The first argument tells `mv` what we're \"moving\",\n" -"while the second is where it's to go.\n" -"In this case,\n" -"we're moving `thesis/draft.txt` to `thesis/quotes.txt`,\n" -"which has the same effect as renaming the file.\n" -"Sure enough,\n" -"`ls` shows us that `thesis` now contains one file called `quotes.txt`:" -msgstr "" -"The first argument tells `mv` what we're \"moving\",\n" -"while the second is where it's to go.\n" -"In this case,\n" -"we're moving `thesis/draft.txt` to `thesis/quotes.txt`,\n" -"which has the same effect as renaming the file.\n" -"Sure enough,\n" -"`ls` shows us that `thesis` now contains one file called `quotes.txt`:" - -# code block -#: shell-novice/_episodes/03-create.md:389 -#: shell-novice/_episodes/03-create.md:424 -msgid "" -"~~~\n" -"$ ls thesis\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls thesis\n" -"~~~" - -# code block -#: shell-novice/_episodes/03-create.md:394 -#: shell-novice/_episodes/03-create.md:438 -msgid "" -"~~~\n" -"quotes.txt\n" -"~~~" -msgstr "" -"~~~\n" -"quotes.txt\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:399 -msgid "" -"One has to be careful when specifying the target file name, since `mv` will\n" -"silently overwrite any existing file with the same name, which could\n" -"lead to data loss. An additional flag, `mv -i` (or `mv --interactive`),\n" -"can be used to make `mv` ask you for confirmation before overwriting." -msgstr "" -"One has to be careful when specifying the target file name, since `mv` will\n" -"silently overwrite any existing file with the same name, which could\n" -"lead to data loss. An additional flag, `mv -i` (or `mv --interactive`),\n" -"can be used to make `mv` ask you for confirmation before overwriting." - -#: shell-novice/_episodes/03-create.md:404 -msgid "" -"Just for the sake of consistency,\n" -"`mv` also works on directories" -msgstr "" -"Just for the sake of consistency,\n" -"`mv` also works on directories" - -#: shell-novice/_episodes/03-create.md:407 -msgid "" -"Let's move `quotes.txt` into the current working directory.\n" -"We use `mv` once again,\n" -"but this time we'll just use the name of a directory as the second argument\n" -"to tell `mv` that we want to keep the filename,\n" -"but put the file somewhere new.\n" -"(This is why the command is called \"move\".)\n" -"In this case,\n" -"the directory name we use is the special directory name `.` that we mentioned earlier." -msgstr "" -"Let's move `quotes.txt` into the current working directory.\n" -"We use `mv` once again,\n" -"but this time we'll just use the name of a directory as the second argument\n" -"to tell `mv` that we want to keep the filename,\n" -"but put the file somewhere new.\n" -"(This is why the command is called \"move\".)\n" -"In this case,\n" -"the directory name we use is the special directory name `.` that we mentioned earlier." - -# code block -#: shell-novice/_episodes/03-create.md:416 -msgid "" -"~~~\n" -"$ mv thesis/quotes.txt .\n" -"~~~" -msgstr "" -"~~~\n" -"$ mv thesis/quotes.txt .\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:421 -msgid "" -"The effect is to move the file from the directory it was in to the current working directory.\n" -"`ls` now shows us that `thesis` is empty:" -msgstr "" -"The effect is to move the file from the directory it was in to the current working directory.\n" -"`ls` now shows us that `thesis` is empty:" - -#: shell-novice/_episodes/03-create.md:429 -msgid "" -"Further,\n" -"`ls` with a filename or directory name as an argument only lists that file or directory.\n" -"We can use this to see that `quotes.txt` is still in our current directory:" -msgstr "" -"Further,\n" -"`ls` with a filename or directory name as an argument only lists that file or directory.\n" -"We can use this to see that `quotes.txt` is still in our current directory:" - -# code block -#: shell-novice/_episodes/03-create.md:433 -msgid "" -"~~~\n" -"$ ls quotes.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls quotes.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:443 -msgid "> ## Moving to the Current Folder" -msgstr "> ## Moving to the Current Folder" - -#: shell-novice/_episodes/03-create.md:444 -msgid "" -">\n" -"> After running the following commands,\n" -"> Jamie realizes that she put the files `sucrose.dat` and `maltose.dat` into the wrong folder:\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> analyzed/ raw/\n" -"> $ ls -F analyzed\n" -"> fructose.dat glucose.dat maltose.dat sucrose.dat\n" -"> $ cd raw/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Fill in the blanks to move these files to the current folder\n" -"> (i.e., the one she is currently in):\n" -">\n" -"> ~~~\n" -"> $ mv ___/sucrose.dat ___/maltose.dat ___\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ mv ../analyzed/sucrose.dat ../analyzed/maltose.dat .\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > Recall that `..` refers to the parent directory (i.e. one above the current directory)\n" -"> > and that `.` refers to the current directory." -msgstr "" -">\n" -"> After running the following commands,\n" -"> Jamie realizes that she put the files `sucrose.dat` and `maltose.dat` into the wrong folder:\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> analyzed/ raw/\n" -"> $ ls -F analyzed\n" -"> fructose.dat glucose.dat maltose.dat sucrose.dat\n" -"> $ cd raw/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Fill in the blanks to move these files to the current folder\n" -"> (i.e., the one she is currently in):\n" -">\n" -"> ~~~\n" -"> $ mv ___/sucrose.dat ___/maltose.dat ___\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ mv ../analyzed/sucrose.dat ../analyzed/maltose.dat .\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > Recall that `..` refers to the parent directory (i.e. one above the current directory)\n" -"> > and that `.` refers to the current directory." - -#: shell-novice/_episodes/03-create.md:474 -msgid "" -"The `cp` command works very much like `mv`,\n" -"except it copies a file instead of moving it.\n" -"We can check that it did the right thing using `ls`\n" -"with two paths as arguments --- like most Unix commands,\n" -"`ls` can be given multiple paths at once:" -msgstr "" -"The `cp` command works very much like `mv`,\n" -"except it copies a file instead of moving it.\n" -"We can check that it did the right thing using `ls`\n" -"with two paths as arguments --- like most Unix commands,\n" -"`ls` can be given multiple paths at once:" - -# code block -#: shell-novice/_episodes/03-create.md:480 -msgid "" -"~~~\n" -"$ cp quotes.txt thesis/quotations.txt\n" -"$ ls quotes.txt thesis/quotations.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cp quotes.txt thesis/quotations.txt\n" -"$ ls quotes.txt thesis/quotations.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/03-create.md:486 -msgid "" -"~~~\n" -"quotes.txt thesis/quotations.txt\n" -"~~~" -msgstr "" -"~~~\n" -"quotes.txt thesis/quotations.txt\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:491 -msgid "" -"To prove that we made a copy,\n" -"let's delete the `quotes.txt` file in the current directory\n" -"and then run that same `ls` again." -msgstr "" -"To prove that we made a copy,\n" -"let's delete the `quotes.txt` file in the current directory\n" -"and then run that same `ls` again." - -# code block -#: shell-novice/_episodes/03-create.md:495 -msgid "" -"~~~\n" -"$ rm quotes.txt\n" -"$ ls quotes.txt thesis/quotations.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ rm quotes.txt\n" -"$ ls quotes.txt thesis/quotations.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/03-create.md:501 -msgid "" -"~~~\n" -"ls: cannot access quotes.txt: No such file or directory\n" -"thesis/quotations.txt\n" -"~~~" -msgstr "" -"~~~\n" -"ls: cannot access quotes.txt: No such file or directory\n" -"thesis/quotations.txt\n" -"~~~" - -#: shell-novice/_episodes/03-create.md:507 -msgid "" -"This time it tells us that it can't find `quotes.txt` in the current directory,\n" -"but it does find the copy in `thesis` that we didn't delete." -msgstr "" -"This time it tells us that it can't find `quotes.txt` in the current directory,\n" -"but it does find the copy in `thesis` that we didn't delete." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:510 -msgid "> ## What's In A Name?" -msgstr "> ## What's In A Name?" - -#: shell-novice/_episodes/03-create.md:511 -msgid "" -">\n" -"> You may have noticed that all of Nelle's files' names are \"something dot\n" -"> something\", and in this part of the lesson, we always used the extension\n" -"> `.txt`. This is just a convention: we can call a file `mythesis` or\n" -"> almost anything else we want. However, most people use two-part names\n" -"> most of the time to help them (and their programs) tell different kinds\n" -"> of files apart. The second part of such a name is called the\n" -"> **filename extension**, and indicates\n" -"> what type of data the file holds: `.txt` signals a plain text file, `.pdf`\n" -"> indicates a PDF document, `.cfg` is a configuration file full of parameters\n" -"> for some program or other, `.png` is a PNG image, and so on.\n" -">\n" -"> This is just a convention, albeit an important one. Files contain\n" -"> bytes: it's up to us and our programs to interpret those bytes\n" -"> according to the rules for plain text files, PDF documents, configuration\n" -"> files, images, and so on.\n" -">\n" -"> Naming a PNG image of a whale as `whale.mp3` doesn't somehow\n" -"> magically turn it into a recording of whalesong, though it *might*\n" -"> cause the operating system to try to open it with a music player\n" -"> when someone double-clicks it." -msgstr "" -">\n" -"> You may have noticed that all of Nelle's files' names are \"something dot\n" -"> something\", and in this part of the lesson, we always used the extension\n" -"> `.txt`. This is just a convention: we can call a file `mythesis` or\n" -"> almost anything else we want. However, most people use two-part names\n" -"> most of the time to help them (and their programs) tell different kinds\n" -"> of files apart. The second part of such a name is called the\n" -"> **filename extension**, and indicates\n" -"> what type of data the file holds: `.txt` signals a plain text file, `.pdf`\n" -"> indicates a PDF document, `.cfg` is a configuration file full of parameters\n" -"> for some program or other, `.png` is a PNG image, and so on.\n" -">\n" -"> This is just a convention, albeit an important one. Files contain\n" -"> bytes: it's up to us and our programs to interpret those bytes\n" -"> according to the rules for plain text files, PDF documents, configuration\n" -"> files, images, and so on.\n" -">\n" -"> Naming a PNG image of a whale as `whale.mp3` doesn't somehow\n" -"> magically turn it into a recording of whalesong, though it *might*\n" -"> cause the operating system to try to open it with a music player\n" -"> when someone double-clicks it." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:534 -msgid "> ## Renaming Files" -msgstr "> ## Renaming Files" - -#: shell-novice/_episodes/03-create.md:535 -msgid "" -">\n" -"> Suppose that you created a `.txt` file in your current directory to contain a list of the\n" -"> statistical tests you will need to do to analyze your data, and named it: `statstics.txt`\n" -">\n" -"> After creating and saving this file you realize you misspelled the filename! You want to\n" -"> correct the mistake, which of the following commands could you use to do so?\n" -">\n" -"> 1. `cp statstics.txt statistics.txt`\n" -"> 2. `mv statstics.txt statistics.txt`\n" -"> 3. `mv statstics.txt .`\n" -"> 4. `cp statstics.txt .`\n" -">\n" -"> > ## Solution\n" -"> > 1. No. While this would create a file with the correct name, the incorrectly named file still exists in the directory\n" -"> > and would need to be deleted.\n" -"> > 2. Yes, this would work to rename the file.\n" -"> > 3. No, the period(.) indicates where to move the file, but does not provide a new file name; identical file names\n" -"> > cannot be created.\n" -"> > 4. No, the period(.) indicates where to copy the file, but does not provide a new file name; identical file names\n" -"> > cannot be created." -msgstr "" -">\n" -"> Suppose that you created a `.txt` file in your current directory to contain a list of the\n" -"> statistical tests you will need to do to analyze your data, and named it: `statstics.txt`\n" -">\n" -"> After creating and saving this file you realize you misspelled the filename! You want to\n" -"> correct the mistake, which of the following commands could you use to do so?\n" -">\n" -"> 1. `cp statstics.txt statistics.txt`\n" -"> 2. `mv statstics.txt statistics.txt`\n" -"> 3. `mv statstics.txt .`\n" -"> 4. `cp statstics.txt .`\n" -">\n" -"> > ## Solution\n" -"> > 1. No. While this would create a file with the correct name, the incorrectly named file still exists in the directory\n" -"> > and would need to be deleted.\n" -"> > 2. Yes, this would work to rename the file.\n" -"> > 3. No, the period(.) indicates where to move the file, but does not provide a new file name; identical file names\n" -"> > cannot be created.\n" -"> > 4. No, the period(.) indicates where to copy the file, but does not provide a new file name; identical file names\n" -"> > cannot be created." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:558 -msgid "> ## Moving and Copying" -msgstr "> ## Moving and Copying" - -#: shell-novice/_episodes/03-create.md:559 -msgid "" -">\n" -"> What is the output of the closing `ls` command in the sequence shown below?\n" -">\n" -"> ~~~\n" -"> $ pwd\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> /Users/jamie/data\n" -"> ~~~" -msgstr "" -">\n" -"> What is the output of the closing `ls` command in the sequence shown below?\n" -">\n" -"> ~~~\n" -"> $ pwd\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> /Users/jamie/data\n" -"> ~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:571 -#: shell-novice/_episodes/03-create.md:582 -msgid "> $ ls" -msgstr "> $ ls" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:575 -msgid "> proteins.dat" -msgstr "> proteins.dat" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:579 -msgid "> $ mkdir recombine" -msgstr "> $ mkdir recombine" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:580 -msgid "> $ mv proteins.dat recombine/" -msgstr "> $ mv proteins.dat recombine/" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:581 -msgid "> $ cp recombine/proteins.dat ../proteins-saved.dat" -msgstr "> $ cp recombine/proteins.dat ../proteins-saved.dat" - -#: shell-novice/_episodes/03-create.md:585 -msgid "" -">\n" -"> 1. `proteins-saved.dat recombine`\n" -"> 2. `recombine`\n" -"> 3. `proteins.dat recombine`\n" -"> 4. `proteins-saved.dat`\n" -">\n" -"> > ## Solution\n" -"> > We start in the `/Users/jamie/data` directory, and create a new folder called `recombine`.\n" -"> > The second line moves (`mv`) the file `proteins.dat` to the new folder (`recombine`).\n" -"> > The third line makes a copy of the file we just moved. The tricky part here is where the file was\n" -"> > copied to. Recall that `..` means \"go up a level\", so the copied file is now in `/Users/jamie`.\n" -"> > Notice that `..` is interpreted with respect to the current working\n" -"> > directory, **not** with respect to the location of the file being copied.\n" -"> > So, the only thing that will show using ls (in `/Users/jamie/data`) is the recombine folder.\n" -"> >\n" -"> > 1. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`\n" -"> > 2. Yes\n" -"> > 3. No, see explanation above. `proteins.dat` is located at `/Users/jamie/data/recombine`\n" -"> > 4. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`" -msgstr "" -">\n" -"> 1. `proteins-saved.dat recombine`\n" -"> 2. `recombine`\n" -"> 3. `proteins.dat recombine`\n" -"> 4. `proteins-saved.dat`\n" -">\n" -"> > ## Solution\n" -"> > We start in the `/Users/jamie/data` directory, and create a new folder called `recombine`.\n" -"> > The second line moves (`mv`) the file `proteins.dat` to the new folder (`recombine`).\n" -"> > The third line makes a copy of the file we just moved. The tricky part here is where the file was\n" -"> > copied to. Recall that `..` means \"go up a level\", so the copied file is now in `/Users/jamie`.\n" -"> > Notice that `..` is interpreted with respect to the current working\n" -"> > directory, **not** with respect to the location of the file being copied.\n" -"> > So, the only thing that will show using ls (in `/Users/jamie/data`) is the recombine folder.\n" -"> >\n" -"> > 1. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`\n" -"> > 2. Yes\n" -"> > 3. No, see explanation above. `proteins.dat` is located at `/Users/jamie/data/recombine`\n" -"> > 4. No, see explanation above. `proteins-saved.dat` is located at `/Users/jamie`" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:607 -msgid "> ## Organizing Directories and Files" -msgstr "> ## Organizing Directories and Files" - -#: shell-novice/_episodes/03-create.md:608 -msgid "" -">\n" -"> Jamie is working on a project and she sees that her files aren't very well\n" -"> organized:\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> analyzed/ fructose.dat raw/ sucrose.dat\n" -"> ~~~" -msgstr "" -">\n" -"> Jamie is working on a project and she sees that her files aren't very well\n" -"> organized:\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> analyzed/ fructose.dat raw/ sucrose.dat\n" -"> ~~~" - -#: shell-novice/_episodes/03-create.md:620 -msgid "" -">\n" -"> The `fructose.dat` and `sucrose.dat` files contain output from her data\n" -"> analysis. What command(s) covered in this lesson does she need to run so that the commands below will\n" -"> produce the output shown?\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> analyzed/ raw/\n" -"> ~~~" -msgstr "" -">\n" -"> The `fructose.dat` and `sucrose.dat` files contain output from her data\n" -"> analysis. What command(s) covered in this lesson does she need to run so that the commands below will\n" -"> produce the output shown?\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> analyzed/ raw/\n" -"> ~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:634 -msgid "> $ ls analyzed" -msgstr "> $ ls analyzed" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:638 -msgid "> fructose.dat sucrose.dat" -msgstr "> fructose.dat sucrose.dat" - -#: shell-novice/_episodes/03-create.md:641 -msgid "" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > mv *.dat analyzed\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > Jamie needs to move her files `fructose.dat` and `sucrose.dat` to the `analyzed` directory.\n" -"> > The shell will expand *.dat to match all .dat files in the current directory.\n" -"> > The `mv` command then moves the list of .dat files to the \"analyzed\" directory." -msgstr "" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > mv *.dat analyzed\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > Jamie needs to move her files `fructose.dat` and `sucrose.dat` to the `analyzed` directory.\n" -"> > The shell will expand *.dat to match all .dat files in the current directory.\n" -"> > The `mv` command then moves the list of .dat files to the \"analyzed\" directory." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:653 -msgid "> ## Copy with Multiple Filenames" -msgstr "> ## Copy with Multiple Filenames" - -#: shell-novice/_episodes/03-create.md:654 -msgid "" -">\n" -"> For this exercise, you can test the commands in the `data-shell/data directory`.\n" -">\n" -"> In the example below, what does `cp` do when given several filenames and a directory name?\n" -">\n" -"> ~~~\n" -"> $ mkdir backup\n" -"> $ cp amino-acids.txt animals.txt backup/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> In the example below, what does `cp` do when given three or more file names?\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> amino-acids.txt animals.txt backup/ elements/ morse.txt pdb/ planets.txt salmon.txt sunspot.txt\n" -"> ~~~" -msgstr "" -">\n" -"> For this exercise, you can test the commands in the `data-shell/data directory`.\n" -">\n" -"> In the example below, what does `cp` do when given several filenames and a directory name?\n" -">\n" -"> ~~~\n" -"> $ mkdir backup\n" -"> $ cp amino-acids.txt animals.txt backup/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> In the example below, what does `cp` do when given three or more file names?\n" -">\n" -"> ~~~\n" -"> $ ls -F\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> amino-acids.txt animals.txt backup/ elements/ morse.txt pdb/ planets.txt salmon.txt sunspot.txt\n" -"> ~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:676 -msgid "> $ cp amino-acids.txt animals.txt morse.txt " -msgstr "> $ cp amino-acids.txt animals.txt morse.txt " - -#: shell-novice/_episodes/03-create.md:679 -msgid "" -">\n" -"> > ## Solution\n" -"> > If given more than one file name followed by a directory name (i.e. the destination directory must \n" -"> > be the last argument), `cp` copies the files to the named directory.\n" -"> >\n" -"> > If given three file names, `cp` throws an error because it is expecting a directory\n" -"> > name as the last argument.\n" -"> >\n" -"> > ```\n" -"> > cp: target ‘morse.txt’ is not a directory\n" -"> > ```\n" -"> > {: .output}" -msgstr "" -">\n" -"> > ## Solution\n" -"> > If given more than one file name followed by a directory name (i.e. the destination directory must \n" -"> > be the last argument), `cp` copies the files to the named directory.\n" -"> >\n" -"> > If given three file names, `cp` throws an error because it is expecting a directory\n" -"> > name as the last argument.\n" -"> >\n" -"> > ```\n" -"> > cp: target ‘morse.txt’ is not a directory\n" -"> > ```\n" -"> > {: .output}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/03-create.md:694 -msgid "> ## Copy a folder structure sans files" -msgstr "> ## Copy a folder structure sans files" - -#: shell-novice/_episodes/03-create.md:695 -msgid "" -">\n" -"> You're starting a new experiment, and would like to duplicate the file\n" -"> structure from your previous experiment without the data files so you can\n" -"> add new data.\n" -">\n" -"> Assume that the file structure is in a folder called '2016-05-18-data',\n" -"> which contains a `data` folder that in turn contains folders named `raw` and\n" -"> `processed` that contain data files. The goal is to copy the file structure\n" -"> of the `2016-05-18-data` folder into a folder called `2016-05-20-data` and\n" -"> remove the data files from the directory you just created.\n" -">\n" -"> Which of the following set of commands would achieve this objective?\n" -"> What would the other commands do?\n" -">\n" -"> ~~~\n" -"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" -"> $ rm 2016-05-20-data/raw/*\n" -"> $ rm 2016-05-20-data/processed/*\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> $ rm 2016-05-20-data/raw/*\n" -"> $ rm 2016-05-20-data/processed/*\n" -"> $ cp -r 2016-05-18-data/ 2016-5-20-data/\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" -"> $ rm -r -i 2016-05-20-data/\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> >\n" -"> > ## Solution\n" -"> > The first set of commands achieves this objective.\n" -"> > First we have a recursive copy of a data folder.\n" -"> > Then two `rm` commands which remove all files in the specified directories.\n" -"> > The shell expands the '*' wild card to match all files and subdirectories.\n" -"> >\n" -"> > The second set of commands have the wrong order: \n" -"> > attempting to delete files which haven't yet been copied,\n" -"> > followed by the recursive copy command which would copy them.\n" -"> >\n" -"> > The third set of commands would achieve the objective, but in a time-consuming way:\n" -"> > the first command copies the directory recursively, but the second command deletes\n" -"> > interactively, prompting for confirmation for each file and directory." -msgstr "" -">\n" -"> You're starting a new experiment, and would like to duplicate the file\n" -"> structure from your previous experiment without the data files so you can\n" -"> add new data.\n" -">\n" -"> Assume that the file structure is in a folder called '2016-05-18-data',\n" -"> which contains a `data` folder that in turn contains folders named `raw` and\n" -"> `processed` that contain data files. The goal is to copy the file structure\n" -"> of the `2016-05-18-data` folder into a folder called `2016-05-20-data` and\n" -"> remove the data files from the directory you just created.\n" -">\n" -"> Which of the following set of commands would achieve this objective?\n" -"> What would the other commands do?\n" -">\n" -"> ~~~\n" -"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" -"> $ rm 2016-05-20-data/raw/*\n" -"> $ rm 2016-05-20-data/processed/*\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> $ rm 2016-05-20-data/raw/*\n" -"> $ rm 2016-05-20-data/processed/*\n" -"> $ cp -r 2016-05-18-data/ 2016-5-20-data/\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> $ cp -r 2016-05-18-data/ 2016-05-20-data/\n" -"> $ rm -r -i 2016-05-20-data/\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> >\n" -"> > ## Solution\n" -"> > The first set of commands achieves this objective.\n" -"> > First we have a recursive copy of a data folder.\n" -"> > Then two `rm` commands which remove all files in the specified directories.\n" -"> > The shell expands the '*' wild card to match all files and subdirectories.\n" -"> >\n" -"> > The second set of commands have the wrong order: \n" -"> > attempting to delete files which haven't yet been copied,\n" -"> > followed by the recursive copy command which would copy them.\n" -"> >\n" -"> > The third set of commands would achieve the objective, but in a time-consuming way:\n" -"> > the first command copies the directory recursively, but the second command deletes\n" -"> > interactively, prompting for confirmation for each file and directory." - -# Front Matter -#: shell-novice/_episodes/04-pipefilter.md:1 -msgid "" -"---\n" -"title: \"Pipes and Filters\"\n" -"teaching: 30\n" -"exercises: 20\n" -"questions:\n" -"- \"How can I combine existing commands to do new things?\"\n" -"objectives:\n" -"- \"Redirect a command's output to a file.\"\n" -"- \"Process a file instead of keyboard input using redirection.\"\n" -"- \"Construct command pipelines with two or more stages.\"\n" -"- \"Explain what usually happens if a program or pipeline isn't given any input to process.\"\n" -"- \"Explain Unix's 'small pieces, loosely joined' philosophy.\"\n" -"keypoints:\n" -"- \"`cat` displays the contents of its inputs.\"\n" -"- \"`head` displays the first few lines of its input.\"\n" -"- \"`tail` displays the last few lines of its input.\"\n" -"- \"`sort` sorts its inputs.\"\n" -"- \"`wc` counts lines, words, and characters in its inputs.\"\n" -"- \"`*` matches zero or more characters in a filename, so `*.txt` matches all files ending in `.txt`.\"\n" -"- \"`?` matches any single character in a filename, so `?.txt` matches `a.txt` but not `any.txt`.\"\n" -"- \"`command > file` redirects a command's output to a file.\"\n" -"- \"`first | second` is a pipeline: the output of the first command is used as the input to the second.\"\n" -"- \"The best way to use the shell is to use pipes to combine simple single-purpose programs (filters).\"\n" -"---" -msgstr "" -"---\n" -"title: \"Pipes and Filters\"\n" -"teaching: 30\n" -"exercises: 20\n" -"questions:\n" -"- \"How can I combine existing commands to do new things?\"\n" -"objectives:\n" -"- \"Redirect a command's output to a file.\"\n" -"- \"Process a file instead of keyboard input using redirection.\"\n" -"- \"Construct command pipelines with two or more stages.\"\n" -"- \"Explain what usually happens if a program or pipeline isn't given any input to process.\"\n" -"- \"Explain Unix's 'small pieces, loosely joined' philosophy.\"\n" -"keypoints:\n" -"- \"`cat` displays the contents of its inputs.\"\n" -"- \"`head` displays the first few lines of its input.\"\n" -"- \"`tail` displays the last few lines of its input.\"\n" -"- \"`sort` sorts its inputs.\"\n" -"- \"`wc` counts lines, words, and characters in its inputs.\"\n" -"- \"`*` matches zero or more characters in a filename, so `*.txt` matches all files ending in `.txt`.\"\n" -"- \"`?` matches any single character in a filename, so `?.txt` matches `a.txt` but not `any.txt`.\"\n" -"- \"`command > file` redirects a command's output to a file.\"\n" -"- \"`first | second` is a pipeline: the output of the first command is used as the input to the second.\"\n" -"- \"The best way to use the shell is to use pipes to combine simple single-purpose programs (filters).\"\n" -"---" - -#: shell-novice/_episodes/04-pipefilter.md:26 -msgid "" -"Now that we know a few basic commands,\n" -"we can finally look at the shell's most powerful feature:\n" -"the ease with which it lets us combine existing programs in new ways.\n" -"We'll start with a directory called `molecules`\n" -"that contains six files describing some simple organic molecules.\n" -"The `.pdb` extension indicates that these files are in Protein Data Bank format,\n" -"a simple text format that specifies the type and position of each atom in the molecule." -msgstr "" -"Now that we know a few basic commands,\n" -"we can finally look at the shell's most powerful feature:\n" -"the ease with which it lets us combine existing programs in new ways.\n" -"We'll start with a directory called `molecules`\n" -"that contains six files describing some simple organic molecules.\n" -"The `.pdb` extension indicates that these files are in Protein Data Bank format,\n" -"a simple text format that specifies the type and position of each atom in the molecule." - -# code block -#: shell-novice/_episodes/04-pipefilter.md:34 -msgid "" -"~~~\n" -"$ ls molecules\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls molecules\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:39 -msgid "" -"~~~\n" -"cubane.pdb ethane.pdb methane.pdb\n" -"octane.pdb pentane.pdb propane.pdb\n" -"~~~" -msgstr "" -"~~~\n" -"cubane.pdb ethane.pdb methane.pdb\n" -"octane.pdb pentane.pdb propane.pdb\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:45 -msgid "" -"Let's go into that directory with `cd` and run the command `wc *.pdb`.\n" -"`wc` is the \"word count\" command:\n" -"it counts the number of lines, words, and characters in files.\n" -"The `*` in `*.pdb` matches zero or more characters,\n" -"so the shell turns `*.pdb` into a list of all `.pdb` files in the current directory:" -msgstr "" -"Let's go into that directory with `cd` and run the command `wc *.pdb`.\n" -"`wc` is the \"word count\" command:\n" -"it counts the number of lines, words, and characters in files.\n" -"The `*` in `*.pdb` matches zero or more characters,\n" -"so the shell turns `*.pdb` into a list of all `.pdb` files in the current directory:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:51 -msgid "" -"~~~\n" -"$ cd molecules\n" -"$ wc *.pdb\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd molecules\n" -"$ wc *.pdb\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:57 -msgid "" -"~~~\n" -" 20 156 1158 cubane.pdb\n" -" 12 84 622 ethane.pdb\n" -" 9 57 422 methane.pdb\n" -" 30 246 1828 octane.pdb\n" -" 21 165 1226 pentane.pdb\n" -" 15 111 825 propane.pdb\n" -" 107 819 6081 total\n" -"~~~" -msgstr "" -"~~~\n" -" 20 156 1158 cubane.pdb\n" -" 12 84 622 ethane.pdb\n" -" 9 57 422 methane.pdb\n" -" 30 246 1828 octane.pdb\n" -" 21 165 1226 pentane.pdb\n" -" 15 111 825 propane.pdb\n" -" 107 819 6081 total\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:68 -#: shell-novice/_episodes/07-find.md:252 -msgid "> ## Wildcards" -msgstr "> ## Wildcards" - -#: shell-novice/_episodes/04-pipefilter.md:69 -msgid "" -">\n" -"> `*` is a **wildcard**. It matches zero or more\n" -"> characters, so `*.pdb` matches `ethane.pdb`, `propane.pdb`, and every\n" -"> file that ends with '.pdb'. On the other hand, `p*.pdb` only matches\n" -"> `pentane.pdb` and `propane.pdb`, because the 'p' at the front only\n" -"> matches filenames that begin with the letter 'p'.\n" -">\n" -"> `?` is also a wildcard, but it only matches a single character. This\n" -"> means that `p?.pdb` would match `pi.pdb` or `p5.pdb` (if we had these two\n" -"> files in the `molecules` directory), but not `propane.pdb`.\n" -"> We can use any number of wildcards at a time: for example, `p*.p?*`\n" -"> matches anything that starts with a 'p' and ends with '.', 'p', and at\n" -"> least one more character (since the `?` has to match one character, and\n" -"> the final `*` can match any number of characters). Thus, `p*.p?*` would\n" -"> match `preferred.practice`, and even `p.pi` (since the first `*` can\n" -"> match no characters at all), but not `quality.practice` (doesn't start\n" -"> with 'p') or `preferred.p` (there isn't at least one character after the\n" -"> '.p').\n" -">\n" -"> When the shell sees a wildcard, it expands the wildcard to create a\n" -"> list of matching filenames *before* running the command that was\n" -"> asked for. As an exception, if a wildcard expression does not match\n" -"> any file, Bash will pass the expression as an argument to the command\n" -"> as it is. For example typing `ls *.pdf` in the `molecules` directory\n" -"> (which contains only files with names ending with `.pdb`) results in\n" -"> an error message that there is no file called `*.pdf`.\n" -"> However, generally commands like `wc` and `ls` see the lists of\n" -"> file names matching these expressions, but not the wildcards\n" -"> themselves. It is the shell, not the other programs, that deals with\n" -"> expanding wildcards, and this is another example of orthogonal design." -msgstr "" -">\n" -"> `*` is a **wildcard**. It matches zero or more\n" -"> characters, so `*.pdb` matches `ethane.pdb`, `propane.pdb`, and every\n" -"> file that ends with '.pdb'. On the other hand, `p*.pdb` only matches\n" -"> `pentane.pdb` and `propane.pdb`, because the 'p' at the front only\n" -"> matches filenames that begin with the letter 'p'.\n" -">\n" -"> `?` is also a wildcard, but it only matches a single character. This\n" -"> means that `p?.pdb` would match `pi.pdb` or `p5.pdb` (if we had these two\n" -"> files in the `molecules` directory), but not `propane.pdb`.\n" -"> We can use any number of wildcards at a time: for example, `p*.p?*`\n" -"> matches anything that starts with a 'p' and ends with '.', 'p', and at\n" -"> least one more character (since the `?` has to match one character, and\n" -"> the final `*` can match any number of characters). Thus, `p*.p?*` would\n" -"> match `preferred.practice`, and even `p.pi` (since the first `*` can\n" -"> match no characters at all), but not `quality.practice` (doesn't start\n" -"> with 'p') or `preferred.p` (there isn't at least one character after the\n" -"> '.p').\n" -">\n" -"> When the shell sees a wildcard, it expands the wildcard to create a\n" -"> list of matching filenames *before* running the command that was\n" -"> asked for. As an exception, if a wildcard expression does not match\n" -"> any file, Bash will pass the expression as an argument to the command\n" -"> as it is. For example typing `ls *.pdf` in the `molecules` directory\n" -"> (which contains only files with names ending with `.pdb`) results in\n" -"> an error message that there is no file called `*.pdf`.\n" -"> However, generally commands like `wc` and `ls` see the lists of\n" -"> file names matching these expressions, but not the wildcards\n" -"> themselves. It is the shell, not the other programs, that deals with\n" -"> expanding wildcards, and this is another example of orthogonal design." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:101 -msgid "> ## Using Wildcards" -msgstr "> ## Using Wildcards" - -#: shell-novice/_episodes/04-pipefilter.md:102 -msgid "" -">\n" -"> When run in the `molecules` directory, which `ls` command(s) will\n" -"> produce this output?\n" -">\n" -"> `ethane.pdb methane.pdb`\n" -">\n" -"> 1. `ls *t*ane.pdb`\n" -"> 2. `ls *t?ne.*`\n" -"> 3. `ls *t??ne.pdb`\n" -"> 4. `ls ethane.*`\n" -">\n" -"> > ## Solution\n" -">> The solution is `3.`\n" -">>\n" -">> `1.` shows all files that contain any number and combination of characters, followed by the letter `t`, another single character, and end with `ane.pdb`. This includes `octane.pdb` and `pentane.pdb`. \n" -">>\n" -">> `2.` shows all files containing any number and combination of characters, `t`, another single character, `ne.` followed by any number and combination of characters. This will give us `octane.pdb` and `pentane.pdb` but doesn't match anything which ends in `thane.pdb`.\n" -">>\n" -">> `3.` fixes the problems of option 2 by matching two characters between `t` and `ne`. This is the solution.\n" -">>\n" -">> `4.` only shows files starting with `ethane.`." -msgstr "" -">\n" -"> When run in the `molecules` directory, which `ls` command(s) will\n" -"> produce this output?\n" -">\n" -"> `ethane.pdb methane.pdb`\n" -">\n" -"> 1. `ls *t*ane.pdb`\n" -"> 2. `ls *t?ne.*`\n" -"> 3. `ls *t??ne.pdb`\n" -"> 4. `ls ethane.*`\n" -">\n" -"> > ## Solution\n" -">> The solution is `3.`\n" -">>\n" -">> `1.` shows all files that contain any number and combination of characters, followed by the letter `t`, another single character, and end with `ane.pdb`. This includes `octane.pdb` and `pentane.pdb`. \n" -">>\n" -">> `2.` shows all files containing any number and combination of characters, `t`, another single character, `ne.` followed by any number and combination of characters. This will give us `octane.pdb` and `pentane.pdb` but doesn't match anything which ends in `thane.pdb`.\n" -">>\n" -">> `3.` fixes the problems of option 2 by matching two characters between `t` and `ne`. This is the solution.\n" -">>\n" -">> `4.` only shows files starting with `ethane.`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:126 -msgid "> ## More on Wildcards" -msgstr "> ## More on Wildcards" - -#: shell-novice/_episodes/04-pipefilter.md:127 -msgid "" -">\n" -"> Sam has a directory containing calibration data, datasets, and descriptions of\n" -"> the datasets:\n" -">\n" -"> ~~~\n" -"> 2015-10-23-calibration.txt\n" -"> 2015-10-23-dataset1.txt\n" -"> 2015-10-23-dataset2.txt\n" -"> 2015-10-23-dataset_overview.txt\n" -"> 2015-10-26-calibration.txt\n" -"> 2015-10-26-dataset1.txt\n" -"> 2015-10-26-dataset2.txt\n" -"> 2015-10-26-dataset_overview.txt\n" -"> 2015-11-23-calibration.txt\n" -"> 2015-11-23-dataset1.txt\n" -"> 2015-11-23-dataset2.txt\n" -"> 2015-11-23-dataset_overview.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Before heading off to another field trip, she wants to back up her data and\n" -"> send some datasets to her colleague Bob. Sam uses the following commands\n" -"> to get the job done:\n" -">\n" -"> ~~~\n" -"> $ cp *dataset* /backup/datasets\n" -"> $ cp ____calibration____ /backup/calibration\n" -"> $ cp 2015-____-____ ~/send_to_bob/all_november_files/\n" -"> $ cp ____ ~/send_to_bob/all_datasets_created_on_a_23rd/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Help Sam by filling in the blanks.\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ cp *calibration.txt /backup/calibration\n" -"> > $ cp 2015-11-* ~/send_to_bob/all_november_files/\n" -"> > $ cp *-23-dataset* ~send_to_bob/all_datasets_created_on_a_23rd/\n" -"> > ```\n" -"> > {: .language-bash}" -msgstr "" -">\n" -"> Sam has a directory containing calibration data, datasets, and descriptions of\n" -"> the datasets:\n" -">\n" -"> ~~~\n" -"> 2015-10-23-calibration.txt\n" -"> 2015-10-23-dataset1.txt\n" -"> 2015-10-23-dataset2.txt\n" -"> 2015-10-23-dataset_overview.txt\n" -"> 2015-10-26-calibration.txt\n" -"> 2015-10-26-dataset1.txt\n" -"> 2015-10-26-dataset2.txt\n" -"> 2015-10-26-dataset_overview.txt\n" -"> 2015-11-23-calibration.txt\n" -"> 2015-11-23-dataset1.txt\n" -"> 2015-11-23-dataset2.txt\n" -"> 2015-11-23-dataset_overview.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Before heading off to another field trip, she wants to back up her data and\n" -"> send some datasets to her colleague Bob. Sam uses the following commands\n" -"> to get the job done:\n" -">\n" -"> ~~~\n" -"> $ cp *dataset* /backup/datasets\n" -"> $ cp ____calibration____ /backup/calibration\n" -"> $ cp 2015-____-____ ~/send_to_bob/all_november_files/\n" -"> $ cp ____ ~/send_to_bob/all_datasets_created_on_a_23rd/\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Help Sam by filling in the blanks.\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ cp *calibration.txt /backup/calibration\n" -"> > $ cp 2015-11-* ~/send_to_bob/all_november_files/\n" -"> > $ cp *-23-dataset* ~send_to_bob/all_datasets_created_on_a_23rd/\n" -"> > ```\n" -"> > {: .language-bash}" - -#: shell-novice/_episodes/04-pipefilter.md:171 -msgid "" -"If we run `wc -l` instead of just `wc`,\n" -"the output shows only the number of lines per file:" -msgstr "" -"If we run `wc -l` instead of just `wc`,\n" -"the output shows only the number of lines per file:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:174 -msgid "" -"~~~\n" -"$ wc -l *.pdb\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.pdb\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:179 -#: shell-novice/_episodes/04-pipefilter.md:277 -msgid "" -"~~~\n" -" 20 cubane.pdb\n" -" 12 ethane.pdb\n" -" 9 methane.pdb\n" -" 30 octane.pdb\n" -" 21 pentane.pdb\n" -" 15 propane.pdb\n" -" 107 total\n" -"~~~" -msgstr "" -"~~~\n" -" 20 cubane.pdb\n" -" 12 ethane.pdb\n" -" 9 methane.pdb\n" -" 30 octane.pdb\n" -" 21 pentane.pdb\n" -" 15 propane.pdb\n" -" 107 total\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:190 -msgid "" -"We can also use `-w` to get only the number of words,\n" -"or `-c` to get only the number of characters." -msgstr "" -"We can also use `-w` to get only the number of words,\n" -"or `-c` to get only the number of characters." - -#: shell-novice/_episodes/04-pipefilter.md:193 -msgid "" -"Which of these files is shortest?\n" -"It's an easy question to answer when there are only six files,\n" -"but what if there were 6000?\n" -"Our first step toward a solution is to run the command:" -msgstr "" -"Which of these files is shortest?\n" -"It's an easy question to answer when there are only six files,\n" -"but what if there were 6000?\n" -"Our first step toward a solution is to run the command:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:198 -msgid "" -"~~~\n" -"$ wc -l *.pdb > lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.pdb > lengths.txt\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:203 -msgid "" -"The greater than symbol, `>`, tells the shell to **redirect** the command's output\n" -"to a file instead of printing it to the screen. (This is why there is no screen output:\n" -"everything that `wc` would have printed has gone into the\n" -"file `lengths.txt` instead.) The shell will create\n" -"the file if it doesn't exist. If the file exists, it will be\n" -"silently overwritten, which may lead to data loss and thus requires\n" -"some caution.\n" -"`ls lengths.txt` confirms that the file exists:" -msgstr "" -"The greater than symbol, `>`, tells the shell to **redirect** the command's output\n" -"to a file instead of printing it to the screen. (This is why there is no screen output:\n" -"everything that `wc` would have printed has gone into the\n" -"file `lengths.txt` instead.) The shell will create\n" -"the file if it doesn't exist. If the file exists, it will be\n" -"silently overwritten, which may lead to data loss and thus requires\n" -"some caution.\n" -"`ls lengths.txt` confirms that the file exists:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:212 -msgid "" -"~~~\n" -"$ ls lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls lengths.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:217 -msgid "" -"~~~\n" -"lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"lengths.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:222 -msgid "> ## What Does `>>` Mean?" -msgstr "> ## What Does `>>` Mean?" - -#: shell-novice/_episodes/04-pipefilter.md:223 -msgid "" -">\n" -"> What is the difference between:\n" -">\n" -"> ~~~\n" -"> $ echo hello > testfile01.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> and:\n" -">\n" -"> ~~~\n" -"> $ echo hello >> testfile02.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Hint: Try executing each command twice in a row and then examining the output files." -msgstr "" -">\n" -"> What is the difference between:\n" -">\n" -"> ~~~\n" -"> $ echo hello > testfile01.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> and:\n" -">\n" -"> ~~~\n" -"> $ echo hello >> testfile02.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Hint: Try executing each command twice in a row and then examining the output files." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:241 -msgid "> ## Appending Data" -msgstr "> ## Appending Data" - -#: shell-novice/_episodes/04-pipefilter.md:242 -msgid "" -">\n" -"> Consider the file `data-shell/data/animals.txt`.\n" -"> After these commands, select the answer that\n" -"> corresponds to the file `animalsUpd.txt`:\n" -">\n" -"> ~~~\n" -"> $ head -3 animals.txt > animalsUpd.txt\n" -"> $ tail -2 animals.txt >> animalsUpd.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. The first three lines of `animals.txt`\n" -"> 2. The last two lines of `animals.txt`\n" -"> 3. The first three lines and the last two lines of `animals.txt`\n" -"> 4. The second and third lines of `animals.txt`\n" -">\n" -"> > ## Solution\n" -"> > Option 3 is correct. \n" -"> > For option 1 to be correct we would only run the `head` command.\n" -"> > For option 2 to be correct we would only run the `tail` command.\n" -"> > For option 4 to be correct we would have to pipe the output of `head` into `tail -2` by doing `head -3 animals.txt | tail -2 >> animalsUpd.txt`" -msgstr "" -">\n" -"> Consider the file `data-shell/data/animals.txt`.\n" -"> After these commands, select the answer that\n" -"> corresponds to the file `animalsUpd.txt`:\n" -">\n" -"> ~~~\n" -"> $ head -3 animals.txt > animalsUpd.txt\n" -"> $ tail -2 animals.txt >> animalsUpd.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. The first three lines of `animals.txt`\n" -"> 2. The last two lines of `animals.txt`\n" -"> 3. The first three lines and the last two lines of `animals.txt`\n" -"> 4. The second and third lines of `animals.txt`\n" -">\n" -"> > ## Solution\n" -"> > Option 3 is correct. \n" -"> > For option 1 to be correct we would only run the `head` command.\n" -"> > For option 2 to be correct we would only run the `tail` command.\n" -"> > For option 4 to be correct we would have to pipe the output of `head` into `tail -2` by doing `head -3 animals.txt | tail -2 >> animalsUpd.txt`" - -#: shell-novice/_episodes/04-pipefilter.md:266 -msgid "" -"We can now send the content of `lengths.txt` to the screen using `cat lengths.txt`.\n" -"`cat` stands for \"concatenate\":\n" -"it prints the contents of files one after another.\n" -"There's only one file in this case,\n" -"so `cat` just shows us what it contains:" -msgstr "" -"We can now send the content of `lengths.txt` to the screen using `cat lengths.txt`.\n" -"`cat` stands for \"concatenate\":\n" -"it prints the contents of files one after another.\n" -"There's only one file in this case,\n" -"so `cat` just shows us what it contains:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:272 -msgid "" -"~~~\n" -"$ cat lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cat lengths.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:288 -msgid "> ## Output Page by Page" -msgstr "> ## Output Page by Page" - -#: shell-novice/_episodes/04-pipefilter.md:289 -msgid "" -">\n" -"> We'll continue to use `cat` in this lesson, for convenience and consistency,\n" -"> but it has the disadvantage that it always dumps the whole file onto your screen.\n" -"> More useful in practice is the command `less`,\n" -"> which you use with `$ less lengths.txt`.\n" -"> This displays a screenful of the file, and then stops.\n" -"> You can go forward one screenful by pressing the spacebar,\n" -"> or back one by pressing `b`. Press `q` to quit." -msgstr "" -">\n" -"> We'll continue to use `cat` in this lesson, for convenience and consistency,\n" -"> but it has the disadvantage that it always dumps the whole file onto your screen.\n" -"> More useful in practice is the command `less`,\n" -"> which you use with `$ less lengths.txt`.\n" -"> This displays a screenful of the file, and then stops.\n" -"> You can go forward one screenful by pressing the spacebar,\n" -"> or back one by pressing `b`. Press `q` to quit." - -#: shell-novice/_episodes/04-pipefilter.md:299 -msgid "Now let's use the `sort` command to sort its contents." -msgstr "Now let's use the `sort` command to sort its contents." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:301 -msgid "> ## What Does `sort -n` Do?" -msgstr "> ## What Does `sort -n` Do?" - -#: shell-novice/_episodes/04-pipefilter.md:302 -msgid "" -">\n" -"> If we run `sort` on a file containing the following lines:\n" -">\n" -"> ~~~\n" -"> 10\n" -"> 2\n" -"> 19\n" -"> 22\n" -"> 6\n" -"> ~~~" -msgstr "" -">\n" -"> If we run `sort` on a file containing the following lines:\n" -">\n" -"> ~~~\n" -"> 10\n" -"> 2\n" -"> 19\n" -"> 22\n" -"> 6\n" -"> ~~~" - -# SC/DC Template label -#: shell-novice/_episodes/04-pipefilter.md:312 -#: shell-novice/_episodes/04-pipefilter.md:620 -#: shell-novice/_episodes/04-pipefilter.md:658 -#: shell-novice/_episodes/05-loop.md:348 -#: shell-novice/_episodes/06-script.md:288 -#: shell-novice/_episodes/07-find.md:294 shell-novice/_episodes/07-find.md:305 -msgid "> {: .source}" -msgstr "> {: .source}" - -#: shell-novice/_episodes/04-pipefilter.md:313 -msgid "" -">\n" -"> the output is:\n" -">\n" -"> ~~~\n" -"> 10\n" -"> 19\n" -"> 2\n" -"> 22\n" -"> 6\n" -"> ~~~" -msgstr "" -">\n" -"> the output is:\n" -">\n" -"> ~~~\n" -"> 10\n" -"> 19\n" -"> 2\n" -"> 22\n" -"> 6\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:324 -msgid "" -">\n" -"> If we run `sort -n` on the same input, we get this instead:\n" -">\n" -"> ~~~\n" -"> 2\n" -"> 6\n" -"> 10\n" -"> 19\n" -"> 22\n" -"> ~~~" -msgstr "" -">\n" -"> If we run `sort -n` on the same input, we get this instead:\n" -">\n" -"> ~~~\n" -"> 2\n" -"> 6\n" -"> 10\n" -"> 19\n" -"> 22\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:335 -msgid "" -">\n" -"> Explain why `-n` has this effect.\n" -">\n" -"> > ## Solution\n" -"> > The `-n` flag specifies a numeric sort, rather than alphabetical." -msgstr "" -">\n" -"> Explain why `-n` has this effect.\n" -">\n" -"> > ## Solution\n" -"> > The `-n` flag specifies a numeric sort, rather than alphabetical." - -#: shell-novice/_episodes/04-pipefilter.md:343 -msgid "" -"We will also use the `-n` flag to specify that the sort is\n" -"numerical instead of alphabetical.\n" -"This does *not* change the file;\n" -"instead, it sends the sorted result to the screen:" -msgstr "" -"We will also use the `-n` flag to specify that the sort is\n" -"numerical instead of alphabetical.\n" -"This does *not* change the file;\n" -"instead, it sends the sorted result to the screen:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:348 -msgid "" -"~~~\n" -"$ sort -n lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ sort -n lengths.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:353 -msgid "" -"~~~\n" -" 9 methane.pdb\n" -" 12 ethane.pdb\n" -" 15 propane.pdb\n" -" 20 cubane.pdb\n" -" 21 pentane.pdb\n" -" 30 octane.pdb\n" -"107 total\n" -"~~~" -msgstr "" -"~~~\n" -" 9 methane.pdb\n" -" 12 ethane.pdb\n" -" 15 propane.pdb\n" -" 20 cubane.pdb\n" -" 21 pentane.pdb\n" -" 30 octane.pdb\n" -"107 total\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:364 -msgid "" -"We can put the sorted list of lines in another temporary file called `sorted-lengths.txt`\n" -"by putting `> sorted-lengths.txt` after the command,\n" -"just as we used `> lengths.txt` to put the output of `wc` into `lengths.txt`.\n" -"Once we've done that,\n" -"we can run another command called `head` to get the first few lines in `sorted-lengths.txt`:" -msgstr "" -"We can put the sorted list of lines in another temporary file called `sorted-lengths.txt`\n" -"by putting `> sorted-lengths.txt` after the command,\n" -"just as we used `> lengths.txt` to put the output of `wc` into `lengths.txt`.\n" -"Once we've done that,\n" -"we can run another command called `head` to get the first few lines in `sorted-lengths.txt`:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:370 -msgid "" -"~~~\n" -"$ sort -n lengths.txt > sorted-lengths.txt\n" -"$ head -n 1 sorted-lengths.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ sort -n lengths.txt > sorted-lengths.txt\n" -"$ head -n 1 sorted-lengths.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:376 -#: shell-novice/_episodes/04-pipefilter.md:415 -msgid "" -"~~~\n" -" 9 methane.pdb\n" -"~~~" -msgstr "" -"~~~\n" -" 9 methane.pdb\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:381 -msgid "" -"Using `-n 1` with `head` tells it that\n" -"we only want the first line of the file;\n" -"`-n 20` would get the first 20,\n" -"and so on.\n" -"Since `sorted-lengths.txt` contains the lengths of our files ordered from least to greatest,\n" -"the output of `head` must be the file with the fewest lines." -msgstr "" -"Using `-n 1` with `head` tells it that\n" -"we only want the first line of the file;\n" -"`-n 20` would get the first 20,\n" -"and so on.\n" -"Since `sorted-lengths.txt` contains the lengths of our files ordered from least to greatest,\n" -"the output of `head` must be the file with the fewest lines." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:388 -msgid "> ## Redirecting to the same file" -msgstr "> ## Redirecting to the same file" - -#: shell-novice/_episodes/04-pipefilter.md:389 -msgid "" -">\n" -"> It's a very bad idea to try redirecting\n" -"> the output of a command that operates on a file\n" -"> to the same file. For example:\n" -">\n" -"> ~~~\n" -"> $ sort -n lengths.txt > lengths.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Doing something like this may give you\n" -"> incorrect results and/or delete\n" -"> the contents of `lengths.txt`." -msgstr "" -">\n" -"> It's a very bad idea to try redirecting\n" -"> the output of a command that operates on a file\n" -"> to the same file. For example:\n" -">\n" -"> ~~~\n" -"> $ sort -n lengths.txt > lengths.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Doing something like this may give you\n" -"> incorrect results and/or delete\n" -"> the contents of `lengths.txt`." - -#: shell-novice/_episodes/04-pipefilter.md:404 -msgid "" -"If you think this is confusing,\n" -"you're in good company:\n" -"even once you understand what `wc`, `sort`, and `head` do,\n" -"all those intermediate files make it hard to follow what's going on.\n" -"We can make it easier to understand by running `sort` and `head` together:" -msgstr "" -"If you think this is confusing,\n" -"you're in good company:\n" -"even once you understand what `wc`, `sort`, and `head` do,\n" -"all those intermediate files make it hard to follow what's going on.\n" -"We can make it easier to understand by running `sort` and `head` together:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:410 -msgid "" -"~~~\n" -"$ sort -n lengths.txt | head -n 1\n" -"~~~" -msgstr "" -"~~~\n" -"$ sort -n lengths.txt | head -n 1\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:420 -msgid "" -"The vertical bar, `|`, between the two commands is called a **pipe**.\n" -"It tells the shell that we want to use\n" -"the output of the command on the left\n" -"as the input to the command on the right.\n" -"The computer might create a temporary file if it needs to,\n" -"or copy data from one program to the other in memory,\n" -"or something else entirely;\n" -"we don't have to know or care." -msgstr "" -"The vertical bar, `|`, between the two commands is called a **pipe**.\n" -"It tells the shell that we want to use\n" -"the output of the command on the left\n" -"as the input to the command on the right.\n" -"The computer might create a temporary file if it needs to,\n" -"or copy data from one program to the other in memory,\n" -"or something else entirely;\n" -"we don't have to know or care." - -#: shell-novice/_episodes/04-pipefilter.md:429 -msgid "" -"Nothing prevents us from chaining pipes consecutively.\n" -"That is, we can for example send the output of `wc` directly to `sort`,\n" -"and then the resulting output to `head`.\n" -"Thus we first use a pipe to send the output of `wc` to `sort`:" -msgstr "" -"Nothing prevents us from chaining pipes consecutively.\n" -"That is, we can for example send the output of `wc` directly to `sort`,\n" -"and then the resulting output to `head`.\n" -"Thus we first use a pipe to send the output of `wc` to `sort`:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:434 -#: shell-novice/_episodes/06-script.md:223 -msgid "" -"~~~\n" -"$ wc -l *.pdb | sort -n\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.pdb | sort -n\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:439 -msgid "" -"~~~\n" -" 9 methane.pdb\n" -" 12 ethane.pdb\n" -" 15 propane.pdb\n" -" 20 cubane.pdb\n" -" 21 pentane.pdb\n" -" 30 octane.pdb\n" -" 107 total\n" -"~~~" -msgstr "" -"~~~\n" -" 9 methane.pdb\n" -" 12 ethane.pdb\n" -" 15 propane.pdb\n" -" 20 cubane.pdb\n" -" 21 pentane.pdb\n" -" 30 octane.pdb\n" -" 107 total\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:450 -msgid "And now we send the output of this pipe, through another pipe, to `head`, so that the full pipeline becomes:" -msgstr "And now we send the output of this pipe, through another pipe, to `head`, so that the full pipeline becomes:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:452 -msgid "" -"~~~\n" -"$ wc -l *.pdb | sort -n | head -n 1\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.pdb | sort -n | head -n 1\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:457 -msgid "" -"~~~\n" -" 9 methane.pdb\n" -"~~~" -msgstr "" -"~~~\n" -" 9 methane.pdb\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:462 -msgid "" -"This is exactly like a mathematician nesting functions like *log(3x)*\n" -"and saying \"the log of three times *x*\".\n" -"In our case,\n" -"the calculation is \"head of sort of line count of `*.pdb`\"." -msgstr "" -"This is exactly like a mathematician nesting functions like *log(3x)*\n" -"and saying \"the log of three times *x*\".\n" -"In our case,\n" -"the calculation is \"head of sort of line count of `*.pdb`\"." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:467 -msgid "> ## Piping Commands Together" -msgstr "> ## Piping Commands Together" - -#: shell-novice/_episodes/04-pipefilter.md:468 -msgid "" -">\n" -"> In our current directory, we want to find the 3 files which have the least number of\n" -"> lines. Which command listed below would work?\n" -">\n" -"> 1. `wc -l * > sort -n > head -n 3`\n" -"> 2. `wc -l * | sort -n | head -n 1-3`\n" -"> 3. `wc -l * | head -n 3 | sort -n`\n" -"> 4. `wc -l * | sort -n | head -n 3`\n" -">\n" -"> > ## Solution\n" -"> > Option 4 is the solution.\n" -"> > The pipe character `|` is used to feed the standard output from one process to\n" -"> > the standard input of another.\n" -"> > `>` is used to redirect standard output to a file.\n" -"> > Try it in the `data-shell/molecules` directory!" -msgstr "" -">\n" -"> In our current directory, we want to find the 3 files which have the least number of\n" -"> lines. Which command listed below would work?\n" -">\n" -"> 1. `wc -l * > sort -n > head -n 3`\n" -"> 2. `wc -l * | sort -n | head -n 1-3`\n" -"> 3. `wc -l * | head -n 3 | sort -n`\n" -"> 4. `wc -l * | sort -n | head -n 3`\n" -">\n" -"> > ## Solution\n" -"> > Option 4 is the solution.\n" -"> > The pipe character `|` is used to feed the standard output from one process to\n" -"> > the standard input of another.\n" -"> > `>` is used to redirect standard output to a file.\n" -"> > Try it in the `data-shell/molecules` directory!" - -#: shell-novice/_episodes/04-pipefilter.md:486 -msgid "" -"Here's what actually happens behind the scenes when we create a pipe.\n" -"When a computer runs a program --- any program --- it creates a **process**\n" -"in memory to hold the program's software and its current state.\n" -"Every process has an input channel called **standard input**.\n" -"(By this point, you may be surprised that the name is so memorable, but don't worry:\n" -"most Unix programmers call it \"stdin\").\n" -"Every process also has a default output channel called **standard output**\n" -"(or \"stdout\"). A second output channel called **standard error** (stderr) also\n" -"exists. This channel is typically used for error or diagnostic messages, and it\n" -"allows a user to pipe the output of one program into another while still receiving \n" -"error messages in the terminal. " -msgstr "" -"Here's what actually happens behind the scenes when we create a pipe.\n" -"When a computer runs a program --- any program --- it creates a **process**\n" -"in memory to hold the program's software and its current state.\n" -"Every process has an input channel called **standard input**.\n" -"(By this point, you may be surprised that the name is so memorable, but don't worry:\n" -"most Unix programmers call it \"stdin\").\n" -"Every process also has a default output channel called **standard output**\n" -"(or \"stdout\"). A second output channel called **standard error** (stderr) also\n" -"exists. This channel is typically used for error or diagnostic messages, and it\n" -"allows a user to pipe the output of one program into another while still receiving \n" -"error messages in the terminal. " - -#: shell-novice/_episodes/04-pipefilter.md:498 -msgid "" -"The shell is actually just another program.\n" -"Under normal circumstances,\n" -"whatever we type on the keyboard is sent to the shell on its standard input,\n" -"and whatever it produces on standard output is displayed on our screen.\n" -"When we tell the shell to run a program,\n" -"it creates a new process\n" -"and temporarily sends whatever we type on our keyboard to that process's standard input,\n" -"and whatever the process sends to standard output to the screen." -msgstr "" -"The shell is actually just another program.\n" -"Under normal circumstances,\n" -"whatever we type on the keyboard is sent to the shell on its standard input,\n" -"and whatever it produces on standard output is displayed on our screen.\n" -"When we tell the shell to run a program,\n" -"it creates a new process\n" -"and temporarily sends whatever we type on our keyboard to that process's standard input,\n" -"and whatever the process sends to standard output to the screen." - -#: shell-novice/_episodes/04-pipefilter.md:507 -msgid "" -"Here's what happens when we run `wc -l *.pdb > lengths.txt`.\n" -"The shell starts by telling the computer to create a new process to run the `wc` program.\n" -"Since we've provided some filenames as arguments,\n" -"`wc` reads from them instead of from standard input.\n" -"And since we've used `>` to redirect output to a file,\n" -"the shell connects the process's standard output to that file." -msgstr "" -"Here's what happens when we run `wc -l *.pdb > lengths.txt`.\n" -"The shell starts by telling the computer to create a new process to run the `wc` program.\n" -"Since we've provided some filenames as arguments,\n" -"`wc` reads from them instead of from standard input.\n" -"And since we've used `>` to redirect output to a file,\n" -"the shell connects the process's standard output to that file." - -#: shell-novice/_episodes/04-pipefilter.md:514 -msgid "" -"If we run `wc -l *.pdb | sort -n` instead,\n" -"the shell creates two processes\n" -"(one for each process in the pipe)\n" -"so that `wc` and `sort` run simultaneously.\n" -"The standard output of `wc` is fed directly to the standard input of `sort`;\n" -"since there's no redirection with `>`,\n" -"`sort`'s output goes to the screen.\n" -"And if we run `wc -l *.pdb | sort -n | head -n 1`,\n" -"we get three processes with data flowing from the files,\n" -"through `wc` to `sort`,\n" -"and from `sort` through `head` to the screen." -msgstr "" -"If we run `wc -l *.pdb | sort -n` instead,\n" -"the shell creates two processes\n" -"(one for each process in the pipe)\n" -"so that `wc` and `sort` run simultaneously.\n" -"The standard output of `wc` is fed directly to the standard input of `sort`;\n" -"since there's no redirection with `>`,\n" -"`sort`'s output goes to the screen.\n" -"And if we run `wc -l *.pdb | sort -n | head -n 1`,\n" -"we get three processes with data flowing from the files,\n" -"through `wc` to `sort`,\n" -"and from `sort` through `head` to the screen." - -#: shell-novice/_episodes/04-pipefilter.md:526 -msgid "![Redirects and Pipes](../fig/redirects-and-pipes.png)" -msgstr "![Redirects and Pipes](../fig/redirects-and-pipes.png)" - -#: shell-novice/_episodes/04-pipefilter.md:528 -msgid "" -"This simple idea is why Unix has been so successful.\n" -"Instead of creating enormous programs that try to do many different things,\n" -"Unix programmers focus on creating lots of simple tools that each do one job well,\n" -"and that work well with each other.\n" -"This programming model is called \"pipes and filters\".\n" -"We've already seen pipes;\n" -"a **filter** is a program like `wc` or `sort`\n" -"that transforms a stream of input into a stream of output.\n" -"Almost all of the standard Unix tools can work this way:\n" -"unless told to do otherwise,\n" -"they read from standard input,\n" -"do something with what they've read,\n" -"and write to standard output." -msgstr "" -"This simple idea is why Unix has been so successful.\n" -"Instead of creating enormous programs that try to do many different things,\n" -"Unix programmers focus on creating lots of simple tools that each do one job well,\n" -"and that work well with each other.\n" -"This programming model is called \"pipes and filters\".\n" -"We've already seen pipes;\n" -"a **filter** is a program like `wc` or `sort`\n" -"that transforms a stream of input into a stream of output.\n" -"Almost all of the standard Unix tools can work this way:\n" -"unless told to do otherwise,\n" -"they read from standard input,\n" -"do something with what they've read,\n" -"and write to standard output." - -#: shell-novice/_episodes/04-pipefilter.md:542 -msgid "" -"The key is that any program that reads lines of text from standard input\n" -"and writes lines of text to standard output\n" -"can be combined with every other program that behaves this way as well.\n" -"You can *and should* write your programs this way\n" -"so that you and other people can put those programs into pipes to multiply their power." -msgstr "" -"The key is that any program that reads lines of text from standard input\n" -"and writes lines of text to standard output\n" -"can be combined with every other program that behaves this way as well.\n" -"You can *and should* write your programs this way\n" -"so that you and other people can put those programs into pipes to multiply their power." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:548 -msgid "> ## Redirecting Input" -msgstr "> ## Redirecting Input" - -#: shell-novice/_episodes/04-pipefilter.md:549 -msgid "" -">\n" -"> As well as using `>` to redirect a program's output, we can use `<` to\n" -"> redirect its input, i.e., to read from a file instead of from standard\n" -"> input. For example, instead of writing `wc ammonia.pdb`, we could write\n" -"> `wc < ammonia.pdb`. In the first case, `wc` gets a command line\n" -"> argument telling it what file to open. In the second, `wc` doesn't have\n" -"> any command line arguments, so it reads from standard input, but we\n" -"> have told the shell to send the contents of `ammonia.pdb` to `wc`'s\n" -"> standard input." -msgstr "" -">\n" -"> As well as using `>` to redirect a program's output, we can use `<` to\n" -"> redirect its input, i.e., to read from a file instead of from standard\n" -"> input. For example, instead of writing `wc ammonia.pdb`, we could write\n" -"> `wc < ammonia.pdb`. In the first case, `wc` gets a command line\n" -"> argument telling it what file to open. In the second, `wc` doesn't have\n" -"> any command line arguments, so it reads from standard input, but we\n" -"> have told the shell to send the contents of `ammonia.pdb` to `wc`'s\n" -"> standard input." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:560 -msgid "> ## What Does `<` Mean?" -msgstr "> ## What Does `<` Mean?" - -#: shell-novice/_episodes/04-pipefilter.md:561 -msgid "" -">\n" -"> Change directory to `data-shell` (the top level of our downloaded example data).\n" -">\n" -"> What is the difference between:\n" -">\n" -"> ~~~\n" -"> $ wc -l notes.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> and:\n" -">\n" -"> ~~~\n" -"> $ wc -l < notes.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > `<` is used to redirect input to a command. \n" -"> >\n" -"> > In both examples, the shell returns the number of lines from the input to\n" -"> > the `wc` command.\n" -"> > In the first example, the input is the file `notes.txt` and the file name is\n" -"> > given in the output from the `wc` command.\n" -"> > In the second example, the contents of the file `notes.txt` are redirected to\n" -"> > standard input.\n" -"> > It is as if we have entered the contents of the file by typing at the prompt.\n" -"> > Hence the file name is not given in the output - just the number of lines.\n" -"> > Try this for yourself:\n" -"> >\n" -"> > ```\n" -"> > $ wc -l\n" -"> > this\n" -"> > is\n" -"> > a test\n" -"> > Ctrl-D # This lets the shell know you have finished typing the input\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> >\n" -"> > ```\n" -"> > 3\n" -"> > ```\n" -"> > {: .output}" -msgstr "" -">\n" -"> Change directory to `data-shell` (the top level of our downloaded example data).\n" -">\n" -"> What is the difference between:\n" -">\n" -"> ~~~\n" -"> $ wc -l notes.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> and:\n" -">\n" -"> ~~~\n" -"> $ wc -l < notes.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > `<` is used to redirect input to a command. \n" -"> >\n" -"> > In both examples, the shell returns the number of lines from the input to\n" -"> > the `wc` command.\n" -"> > In the first example, the input is the file `notes.txt` and the file name is\n" -"> > given in the output from the `wc` command.\n" -"> > In the second example, the contents of the file `notes.txt` are redirected to\n" -"> > standard input.\n" -"> > It is as if we have entered the contents of the file by typing at the prompt.\n" -"> > Hence the file name is not given in the output - just the number of lines.\n" -"> > Try this for yourself:\n" -"> >\n" -"> > ```\n" -"> > $ wc -l\n" -"> > this\n" -"> > is\n" -"> > a test\n" -"> > Ctrl-D # This lets the shell know you have finished typing the input\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> >\n" -"> > ```\n" -"> > 3\n" -"> > ```\n" -"> > {: .output}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:607 -msgid "> ## Why Does `uniq` Only Remove Adjacent Duplicates?" -msgstr "> ## Why Does `uniq` Only Remove Adjacent Duplicates?" - -#: shell-novice/_episodes/04-pipefilter.md:608 -msgid "" -">\n" -"> The command `uniq` removes adjacent duplicated lines from its input.\n" -"> For example, the file `data-shell/data/salmon.txt` contains:\n" -">\n" -"> ~~~\n" -"> coho\n" -"> coho\n" -"> steelhead\n" -"> coho\n" -"> steelhead\n" -"> steelhead\n" -"> ~~~" -msgstr "" -">\n" -"> The command `uniq` removes adjacent duplicated lines from its input.\n" -"> For example, the file `data-shell/data/salmon.txt` contains:\n" -">\n" -"> ~~~\n" -"> coho\n" -"> coho\n" -"> steelhead\n" -"> coho\n" -"> steelhead\n" -"> steelhead\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:621 -msgid "" -">\n" -"> Running the command `uniq salmon.txt` from the `data-shell/data` directory produces:\n" -">\n" -"> ~~~\n" -"> coho\n" -"> steelhead\n" -"> coho\n" -"> steelhead\n" -"> ~~~" -msgstr "" -">\n" -"> Running the command `uniq salmon.txt` from the `data-shell/data` directory produces:\n" -">\n" -"> ~~~\n" -"> coho\n" -"> steelhead\n" -"> coho\n" -"> steelhead\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:631 -msgid "" -">\n" -"> Why do you think `uniq` only removes *adjacent* duplicated lines?\n" -"> (Hint: think about very large data sets.) What other command could\n" -"> you combine with it in a pipe to remove all duplicated lines?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ sort salmon.txt | uniq\n" -"> > ```\n" -"> > {: .language-bash}" -msgstr "" -">\n" -"> Why do you think `uniq` only removes *adjacent* duplicated lines?\n" -"> (Hint: think about very large data sets.) What other command could\n" -"> you combine with it in a pipe to remove all duplicated lines?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ sort salmon.txt | uniq\n" -"> > ```\n" -"> > {: .language-bash}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:644 -msgid "> ## Pipe Reading Comprehension" -msgstr "> ## Pipe Reading Comprehension" - -#: shell-novice/_episodes/04-pipefilter.md:645 -msgid "" -">\n" -"> A file called `animals.txt` (in the `data-shell/data` folder) contains the following data:\n" -">\n" -"> ~~~\n" -"> 2012-11-05,deer\n" -"> 2012-11-05,rabbit\n" -"> 2012-11-05,raccoon\n" -"> 2012-11-06,rabbit\n" -"> 2012-11-06,deer\n" -"> 2012-11-06,fox\n" -"> 2012-11-07,rabbit\n" -"> 2012-11-07,bear\n" -"> ~~~" -msgstr "" -">\n" -"> A file called `animals.txt` (in the `data-shell/data` folder) contains the following data:\n" -">\n" -"> ~~~\n" -"> 2012-11-05,deer\n" -"> 2012-11-05,rabbit\n" -"> 2012-11-05,raccoon\n" -"> 2012-11-06,rabbit\n" -"> 2012-11-06,deer\n" -"> 2012-11-06,fox\n" -"> 2012-11-07,rabbit\n" -"> 2012-11-07,bear\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:659 -msgid "" -">\n" -"> What text passes through each of the pipes and the final redirect in the pipeline below?\n" -">\n" -"> ~~~\n" -"> $ cat animals.txt | head -n 5 | tail -n 3 | sort -r > final.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> Hint: build the pipeline up one command at a time to test your understanding" -msgstr "" -">\n" -"> What text passes through each of the pipes and the final redirect in the pipeline below?\n" -">\n" -"> ~~~\n" -"> $ cat animals.txt | head -n 5 | tail -n 3 | sort -r > final.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> Hint: build the pipeline up one command at a time to test your understanding" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:669 -msgid "> ## Pipe Construction" -msgstr "> ## Pipe Construction" - -#: shell-novice/_episodes/04-pipefilter.md:670 -msgid "" -">\n" -"> For the file `animals.txt` from the previous exercise, the command:\n" -">\n" -"> ~~~\n" -"> $ cut -d , -f 2 animals.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> \n" -"> uses the -d flag to separate each line by comma, and the -f flag\n" -"> to print the second field in each line, to give the following output:\n" -">\n" -"> ~~~\n" -"> deer\n" -"> rabbit\n" -"> raccoon\n" -"> rabbit\n" -"> deer\n" -"> fox\n" -"> rabbit\n" -"> bear\n" -"> ~~~" -msgstr "" -">\n" -"> For the file `animals.txt` from the previous exercise, the command:\n" -">\n" -"> ~~~\n" -"> $ cut -d , -f 2 animals.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> \n" -"> uses the -d flag to separate each line by comma, and the -f flag\n" -"> to print the second field in each line, to give the following output:\n" -">\n" -"> ~~~\n" -"> deer\n" -"> rabbit\n" -"> raccoon\n" -"> rabbit\n" -"> deer\n" -"> fox\n" -"> rabbit\n" -"> bear\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:692 -msgid "" -">\n" -"> What other command(s) could be added to this in a pipeline to find\n" -"> out what animals the file contains (without any duplicates in their\n" -"> names)?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ cut -d , -f 2 animals.txt | sort | uniq\n" -"> > ```\n" -"> > {: .language-bash}" -msgstr "" -">\n" -"> What other command(s) could be added to this in a pipeline to find\n" -"> out what animals the file contains (without any duplicates in their\n" -"> names)?\n" -">\n" -"> > ## Solution\n" -"> > ```\n" -"> > $ cut -d , -f 2 animals.txt | sort | uniq\n" -"> > ```\n" -"> > {: .language-bash}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:705 -msgid "> ## Which Pipe?" -msgstr "> ## Which Pipe?" - -#: shell-novice/_episodes/04-pipefilter.md:706 -msgid "" -">\n" -"> The file `animals.txt` contains 586 lines of data formatted as follows:\n" -">\n" -"> ~~~\n" -"> 2012-11-05,deer\n" -"> 2012-11-05,rabbit\n" -"> 2012-11-05,raccoon\n" -"> 2012-11-06,rabbit\n" -"> ...\n" -"> ~~~" -msgstr "" -">\n" -"> The file `animals.txt` contains 586 lines of data formatted as follows:\n" -">\n" -"> ~~~\n" -"> 2012-11-05,deer\n" -"> 2012-11-05,rabbit\n" -"> 2012-11-05,raccoon\n" -"> 2012-11-06,rabbit\n" -"> ...\n" -"> ~~~" - -#: shell-novice/_episodes/04-pipefilter.md:717 -msgid "" -">\n" -"> Assuming your current directory is `data-shell/data/`,\n" -"> what command would you use to produce a table that shows\n" -"> the total count of each type of animal in the file?\n" -">\n" -"> 1. `grep {deer, rabbit, raccoon, deer, fox, bear} animals.txt | wc -l`\n" -"> 2. `sort animals.txt | uniq -c`\n" -"> 3. `sort -t, -k2,2 animals.txt | uniq -c`\n" -"> 4. `cut -d, -f 2 animals.txt | uniq -c`\n" -"> 5. `cut -d, -f 2 animals.txt | sort | uniq -c`\n" -"> 6. `cut -d, -f 2 animals.txt | sort | uniq -c | wc -l`\n" -">\n" -"> > ## Solution\n" -"> > Option 5. is the correct answer.\n" -"> > If you have difficulty understanding why, try running the commands, or sub-sections of\n" -"> > the pipelines (make sure you are in the `data-shell/data` directory)." -msgstr "" -">\n" -"> Assuming your current directory is `data-shell/data/`,\n" -"> what command would you use to produce a table that shows\n" -"> the total count of each type of animal in the file?\n" -">\n" -"> 1. `grep {deer, rabbit, raccoon, deer, fox, bear} animals.txt | wc -l`\n" -"> 2. `sort animals.txt | uniq -c`\n" -"> 3. `sort -t, -k2,2 animals.txt | uniq -c`\n" -"> 4. `cut -d, -f 2 animals.txt | uniq -c`\n" -"> 5. `cut -d, -f 2 animals.txt | sort | uniq -c`\n" -"> 6. `cut -d, -f 2 animals.txt | sort | uniq -c | wc -l`\n" -">\n" -"> > ## Solution\n" -"> > Option 5. is the correct answer.\n" -"> > If you have difficulty understanding why, try running the commands, or sub-sections of\n" -"> > the pipelines (make sure you are in the `data-shell/data` directory)." - -# header -#: shell-novice/_episodes/04-pipefilter.md:736 -msgid "## Nelle's Pipeline: Checking Files" -msgstr "## Nelle's Pipeline: Checking Files" - -#: shell-novice/_episodes/04-pipefilter.md:738 -msgid "" -"Nelle has run her samples through the assay machines\n" -"and created 17 files in the `north-pacific-gyre/2012-07-03` directory described earlier.\n" -"As a quick sanity check, starting from her home directory, Nelle types:" -msgstr "" -"Nelle has run her samples through the assay machines\n" -"and created 17 files in the `north-pacific-gyre/2012-07-03` directory described earlier.\n" -"As a quick sanity check, starting from her home directory, Nelle types:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:742 -msgid "" -"~~~\n" -"$ cd north-pacific-gyre/2012-07-03\n" -"$ wc -l *.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd north-pacific-gyre/2012-07-03\n" -"$ wc -l *.txt\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:748 -msgid "The output is 18 lines that look like this:" -msgstr "The output is 18 lines that look like this:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:750 -msgid "" -"~~~\n" -"300 NENE01729A.txt\n" -"300 NENE01729B.txt\n" -"300 NENE01736A.txt\n" -"300 NENE01751A.txt\n" -"300 NENE01751B.txt\n" -"300 NENE01812A.txt\n" -"... ...\n" -"~~~" -msgstr "" -"~~~\n" -"300 NENE01729A.txt\n" -"300 NENE01729B.txt\n" -"300 NENE01736A.txt\n" -"300 NENE01751A.txt\n" -"300 NENE01751B.txt\n" -"300 NENE01812A.txt\n" -"... ...\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:761 -msgid "Now she types this:" -msgstr "Now she types this:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:763 -msgid "" -"~~~\n" -"$ wc -l *.txt | sort -n | head -n 5\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.txt | sort -n | head -n 5\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:768 -msgid "" -"~~~\n" -" 240 NENE02018B.txt\n" -" 300 NENE01729A.txt\n" -" 300 NENE01729B.txt\n" -" 300 NENE01736A.txt\n" -" 300 NENE01751A.txt\n" -"~~~" -msgstr "" -"~~~\n" -" 240 NENE02018B.txt\n" -" 300 NENE01729A.txt\n" -" 300 NENE01729B.txt\n" -" 300 NENE01736A.txt\n" -" 300 NENE01751A.txt\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:777 -msgid "" -"Whoops: one of the files is 60 lines shorter than the others.\n" -"When she goes back and checks it,\n" -"she sees that she did that assay at 8:00 on a Monday morning --- someone\n" -"was probably in using the machine on the weekend,\n" -"and she forgot to reset it.\n" -"Before re-running that sample,\n" -"she checks to see if any files have too much data:" -msgstr "" -"Whoops: one of the files is 60 lines shorter than the others.\n" -"When she goes back and checks it,\n" -"she sees that she did that assay at 8:00 on a Monday morning --- someone\n" -"was probably in using the machine on the weekend,\n" -"and she forgot to reset it.\n" -"Before re-running that sample,\n" -"she checks to see if any files have too much data:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:785 -msgid "" -"~~~\n" -"$ wc -l *.txt | sort -n | tail -n 5\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l *.txt | sort -n | tail -n 5\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:790 -msgid "" -"~~~\n" -" 300 NENE02040B.txt\n" -" 300 NENE02040Z.txt\n" -" 300 NENE02043A.txt\n" -" 300 NENE02043B.txt\n" -"5040 total\n" -"~~~" -msgstr "" -"~~~\n" -" 300 NENE02040B.txt\n" -" 300 NENE02040Z.txt\n" -" 300 NENE02043A.txt\n" -" 300 NENE02043B.txt\n" -"5040 total\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:799 -msgid "" -"Those numbers look good --- but what's that 'Z' doing there in the third-to-last line?\n" -"All of her samples should be marked 'A' or 'B';\n" -"by convention,\n" -"her lab uses 'Z' to indicate samples with missing information.\n" -"To find others like it, she does this:" -msgstr "" -"Those numbers look good --- but what's that 'Z' doing there in the third-to-last line?\n" -"All of her samples should be marked 'A' or 'B';\n" -"by convention,\n" -"her lab uses 'Z' to indicate samples with missing information.\n" -"To find others like it, she does this:" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:805 -msgid "" -"~~~\n" -"$ ls *Z.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ ls *Z.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/04-pipefilter.md:810 -msgid "" -"~~~\n" -"NENE01971Z.txt NENE02040Z.txt\n" -"~~~" -msgstr "" -"~~~\n" -"NENE01971Z.txt NENE02040Z.txt\n" -"~~~" - -#: shell-novice/_episodes/04-pipefilter.md:815 -msgid "" -"Sure enough,\n" -"when she checks the log on her laptop,\n" -"there's no depth recorded for either of those samples.\n" -"Since it's too late to get the information any other way,\n" -"she must exclude those two files from her analysis.\n" -"She could just delete them using `rm`,\n" -"but there are actually some analyses she might do later where depth doesn't matter,\n" -"so instead, she'll just be careful later on to select files using the wildcard expression `*[AB].txt`.\n" -"As always,\n" -"the `*` matches any number of characters;\n" -"the expression `[AB]` matches either an 'A' or a 'B',\n" -"so this matches all the valid data files she has." -msgstr "" -"Sure enough,\n" -"when she checks the log on her laptop,\n" -"there's no depth recorded for either of those samples.\n" -"Since it's too late to get the information any other way,\n" -"she must exclude those two files from her analysis.\n" -"She could just delete them using `rm`,\n" -"but there are actually some analyses she might do later where depth doesn't matter,\n" -"so instead, she'll just be careful later on to select files using the wildcard expression `*[AB].txt`.\n" -"As always,\n" -"the `*` matches any number of characters;\n" -"the expression `[AB]` matches either an 'A' or a 'B',\n" -"so this matches all the valid data files she has." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:828 -msgid "> ## Wildcard Expressions" -msgstr "> ## Wildcard Expressions" - -#: shell-novice/_episodes/04-pipefilter.md:829 -msgid "" -">\n" -"> Wildcard expressions can be very complex, but you can sometimes write\n" -"> them in ways that only use simple syntax, at the expense of being a bit\n" -"> more verbose. \n" -"> Consider the directory `data-shell/north-pacific-gyre/2012-07-03` :\n" -"> the wildcard expression `*[AB].txt`\n" -"> matches all files ending in `A.txt` or `B.txt`. Imagine you forgot about\n" -"> this.\n" -">\n" -"> 1. Can you match the same set of files with basic wildcard expressions\n" -"> that do not use the `[]` syntax? *Hint*: You may need more than one\n" -"> expression.\n" -">\n" -"> 2. The expression that you found and the expression from the lesson match the\n" -"> same set of files in this example. What is the small difference between the\n" -"> outputs?\n" -">\n" -"> 3. Under what circumstances would your new expression produce an error message\n" -"> where the original one would not?\n" -">\n" -"> > ## Solution\n" -"> > 1. \n" -"> >\n" -"> > \t```\n" -"> > \t$ ls *A.txt\n" -"> > \t$ ls *B.txt\n" -"> > \t```\n" -"> >\t{: .language-bash}\n" -"> > 2. The output from the new commands is separated because there are two commands.\n" -"> > 3. When there are no files ending in `A.txt`, or there are no files ending in\n" -"> > `B.txt`." -msgstr "" -">\n" -"> Wildcard expressions can be very complex, but you can sometimes write\n" -"> them in ways that only use simple syntax, at the expense of being a bit\n" -"> more verbose. \n" -"> Consider the directory `data-shell/north-pacific-gyre/2012-07-03` :\n" -"> the wildcard expression `*[AB].txt`\n" -"> matches all files ending in `A.txt` or `B.txt`. Imagine you forgot about\n" -"> this.\n" -">\n" -"> 1. Can you match the same set of files with basic wildcard expressions\n" -"> that do not use the `[]` syntax? *Hint*: You may need more than one\n" -"> expression.\n" -">\n" -"> 2. The expression that you found and the expression from the lesson match the\n" -"> same set of files in this example. What is the small difference between the\n" -"> outputs?\n" -">\n" -"> 3. Under what circumstances would your new expression produce an error message\n" -"> where the original one would not?\n" -">\n" -"> > ## Solution\n" -"> > 1. \n" -"> >\n" -"> > \t```\n" -"> > \t$ ls *A.txt\n" -"> > \t$ ls *B.txt\n" -"> > \t```\n" -"> >\t{: .language-bash}\n" -"> > 2. The output from the new commands is separated because there are two commands.\n" -"> > 3. When there are no files ending in `A.txt`, or there are no files ending in\n" -"> > `B.txt`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/04-pipefilter.md:863 -msgid "> ## Removing Unneeded Files" -msgstr "> ## Removing Unneeded Files" - -#: shell-novice/_episodes/04-pipefilter.md:864 -msgid "" -">\n" -"> Suppose you want to delete your processed data files, and only keep\n" -"> your raw files and processing script to save storage.\n" -"> The raw files end in `.dat` and the processed files end in `.txt`.\n" -"> Which of the following would remove all the processed data files,\n" -"> and *only* the processed data files?\n" -">\n" -"> 1. `rm ?.txt`\n" -"> 2. `rm *.txt`\n" -"> 3. `rm * .txt`\n" -"> 4. `rm *.*`\n" -">\n" -"> > ## Solution\n" -"> > 1. This would remove `.txt` files with one-character names\n" -"> > 2. This is correct answer\n" -"> > 3. The shell would expand `*` to match everything in the current directory,\n" -"> > so the command would try to remove all matched files and an additional\n" -"> > file called `.txt`\n" -"> > 4. The shell would expand `*.*` to match all files with any extension,\n" -"> > so this command would delete all files" -msgstr "" -">\n" -"> Suppose you want to delete your processed data files, and only keep\n" -"> your raw files and processing script to save storage.\n" -"> The raw files end in `.dat` and the processed files end in `.txt`.\n" -"> Which of the following would remove all the processed data files,\n" -"> and *only* the processed data files?\n" -">\n" -"> 1. `rm ?.txt`\n" -"> 2. `rm *.txt`\n" -"> 3. `rm * .txt`\n" -"> 4. `rm *.*`\n" -">\n" -"> > ## Solution\n" -"> > 1. This would remove `.txt` files with one-character names\n" -"> > 2. This is correct answer\n" -"> > 3. The shell would expand `*` to match everything in the current directory,\n" -"> > so the command would try to remove all matched files and an additional\n" -"> > file called `.txt`\n" -"> > 4. The shell would expand `*.*` to match all files with any extension,\n" -"> > so this command would delete all files" - -# Front Matter -#: shell-novice/_episodes/05-loop.md:1 -msgid "" -"---\n" -"title: \"Loops\"\n" -"teaching: 40\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I perform the same actions on many different files?\"\n" -"objectives:\n" -"- \"Write a loop that applies one or more commands separately to each file in a set of files.\"\n" -"- \"Trace the values taken on by a loop variable during execution of the loop.\"\n" -"- \"Explain the difference between a variable's name and its value.\"\n" -"- \"Explain why spaces and some punctuation characters shouldn't be used in file names.\"\n" -"- \"Demonstrate how to see what commands have recently been executed.\"\n" -"- \"Re-run recently executed commands without retyping them.\"\n" -"keypoints:\n" -"- \"A `for` loop repeats commands once for every thing in a list.\"\n" -"- \"Every `for` loop needs a variable to refer to the thing it is currently operating on.\"\n" -"- \"Use `$name` to expand a variable (i.e., get its value). `${name}` can also be used.\"\n" -"- \"Do not use spaces, quotes, or wildcard characters such as '*' or '?' in filenames, as it complicates variable expansion.\"\n" -"- \"Give files consistent names that are easy to match with wildcard patterns to make it easy to select them for looping.\"\n" -"- \"Use the up-arrow key to scroll up through previous commands to edit and repeat them.\"\n" -"- \"Use `Ctrl-R` to search through the previously entered commands.\"\n" -"- \"Use `history` to display recent commands, and `!number` to repeat a command by number.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Loops\"\n" -"teaching: 40\n" -"exercises: 10\n" -"questions:\n" -"- \"How can I perform the same actions on many different files?\"\n" -"objectives:\n" -"- \"Write a loop that applies one or more commands separately to each file in a set of files.\"\n" -"- \"Trace the values taken on by a loop variable during execution of the loop.\"\n" -"- \"Explain the difference between a variable's name and its value.\"\n" -"- \"Explain why spaces and some punctuation characters shouldn't be used in file names.\"\n" -"- \"Demonstrate how to see what commands have recently been executed.\"\n" -"- \"Re-run recently executed commands without retyping them.\"\n" -"keypoints:\n" -"- \"A `for` loop repeats commands once for every thing in a list.\"\n" -"- \"Every `for` loop needs a variable to refer to the thing it is currently operating on.\"\n" -"- \"Use `$name` to expand a variable (i.e., get its value). `${name}` can also be used.\"\n" -"- \"Do not use spaces, quotes, or wildcard characters such as '*' or '?' in filenames, as it complicates variable expansion.\"\n" -"- \"Give files consistent names that are easy to match with wildcard patterns to make it easy to select them for looping.\"\n" -"- \"Use the up-arrow key to scroll up through previous commands to edit and repeat them.\"\n" -"- \"Use `Ctrl-R` to search through the previously entered commands.\"\n" -"- \"Use `history` to display recent commands, and `!number` to repeat a command by number.\"\n" -"---" - -#: shell-novice/_episodes/05-loop.md:25 -msgid "" -"**Loops** are key to productivity improvements through automation as they allow us to execute\n" -"commands repetitively. Similar to wildcards and tab completion, using loops also reduces the\n" -"amount of typing (and typing mistakes).\n" -"Suppose we have several hundred genome data files named `basilisk.dat`, `unicorn.dat`, and so on.\n" -"In this example,\n" -"we'll use the `creatures` directory which only has two example files,\n" -"but the principles can be applied to many many more files at once.\n" -"We would like to modify these files, but also save a version of the original files, naming the copies\n" -"`original-basilisk.dat` and `original-unicorn.dat`.\n" -"We can't use:" -msgstr "" -"**Loops** are key to productivity improvements through automation as they allow us to execute\n" -"commands repetitively. Similar to wildcards and tab completion, using loops also reduces the\n" -"amount of typing (and typing mistakes).\n" -"Suppose we have several hundred genome data files named `basilisk.dat`, `unicorn.dat`, and so on.\n" -"In this example,\n" -"we'll use the `creatures` directory which only has two example files,\n" -"but the principles can be applied to many many more files at once.\n" -"We would like to modify these files, but also save a version of the original files, naming the copies\n" -"`original-basilisk.dat` and `original-unicorn.dat`.\n" -"We can't use:" - -# code block -#: shell-novice/_episodes/05-loop.md:36 -msgid "" -"~~~\n" -"$ cp *.dat original-*.dat\n" -"~~~" -msgstr "" -"~~~\n" -"$ cp *.dat original-*.dat\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:41 -msgid "because that would expand to:" -msgstr "because that would expand to:" - -# code block -#: shell-novice/_episodes/05-loop.md:43 -msgid "" -"~~~\n" -"$ cp basilisk.dat unicorn.dat original-*.dat\n" -"~~~" -msgstr "" -"~~~\n" -"$ cp basilisk.dat unicorn.dat original-*.dat\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:48 -msgid "This wouldn't back up our files, instead we get an error:" -msgstr "This wouldn't back up our files, instead we get an error:" - -# code block -#: shell-novice/_episodes/05-loop.md:50 -msgid "" -"~~~\n" -"cp: target `original-*.dat' is not a directory\n" -"~~~" -msgstr "" -"~~~\n" -"cp: target `original-*.dat' is not a directory\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:55 -msgid "" -"This problem arises when `cp` receives more than two inputs. When this happens, it\n" -"expects the last input to be a directory where it can copy all the files it was passed.\n" -"Since there is no directory named `original-*.dat` in the `creatures` directory we get an\n" -"error." -msgstr "" -"This problem arises when `cp` receives more than two inputs. When this happens, it\n" -"expects the last input to be a directory where it can copy all the files it was passed.\n" -"Since there is no directory named `original-*.dat` in the `creatures` directory we get an\n" -"error." - -#: shell-novice/_episodes/05-loop.md:60 -msgid "" -"Instead, we can use a **loop**\n" -"to do some operation once for each thing in a list.\n" -"Here's a simple example that displays the first three lines of each file in turn:" -msgstr "" -"Instead, we can use a **loop**\n" -"to do some operation once for each thing in a list.\n" -"Here's a simple example that displays the first three lines of each file in turn:" - -# code block -#: shell-novice/_episodes/05-loop.md:64 -msgid "" -"~~~\n" -"$ for filename in basilisk.dat unicorn.dat\n" -"> do\n" -"> head -n 3 $filename\t# Indentation within the loop aids legibility\n" -"> done\n" -"~~~" -msgstr "" -"~~~\n" -"$ for filename in basilisk.dat unicorn.dat\n" -"> do\n" -"> head -n 3 $filename\t# Indentation within the loop aids legibility\n" -"> done\n" -"~~~" - -# code block -#: shell-novice/_episodes/05-loop.md:72 -msgid "" -"~~~\n" -"COMMON NAME: basilisk\n" -"CLASSIFICATION: basiliscus vulgaris\n" -"UPDATED: 1745-05-02\n" -"COMMON NAME: unicorn\n" -"CLASSIFICATION: equus monoceros\n" -"UPDATED: 1738-11-24\n" -"~~~" -msgstr "" -"~~~\n" -"COMMON NAME: basilisk\n" -"CLASSIFICATION: basiliscus vulgaris\n" -"UPDATED: 1745-05-02\n" -"COMMON NAME: unicorn\n" -"CLASSIFICATION: equus monoceros\n" -"UPDATED: 1738-11-24\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:82 -msgid "> ## Indentation of code within a for loop" -msgstr "> ## Indentation of code within a for loop" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:83 -msgid "> Note that it is common practice to indent the line(s) of code within a for loop." -msgstr "> Note that it is common practice to indent the line(s) of code within a for loop." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:84 -msgid "> The only purpose is to make the code easier to read -- it is not required for the loop to run." -msgstr "> The only purpose is to make the code easier to read -- it is not required for the loop to run." - -#: shell-novice/_episodes/05-loop.md:87 -msgid "" -"When the shell sees the keyword `for`,\n" -"it knows to repeat a command (or group of commands) once for each item in a list.\n" -"Each time the loop runs (called an iteration), an item in the list is assigned in sequence to\n" -"the **variable**, and the commands inside the loop are executed, before moving on to \n" -"the next item in the list.\n" -"Inside the loop,\n" -"we call for the variable's value by putting `$` in front of it.\n" -"The `$` tells the shell interpreter to treat\n" -"the **variable** as a variable name and substitute its value in its place,\n" -"rather than treat it as text or an external command. " -msgstr "" -"When the shell sees the keyword `for`,\n" -"it knows to repeat a command (or group of commands) once for each item in a list.\n" -"Each time the loop runs (called an iteration), an item in the list is assigned in sequence to\n" -"the **variable**, and the commands inside the loop are executed, before moving on to \n" -"the next item in the list.\n" -"Inside the loop,\n" -"we call for the variable's value by putting `$` in front of it.\n" -"The `$` tells the shell interpreter to treat\n" -"the **variable** as a variable name and substitute its value in its place,\n" -"rather than treat it as text or an external command. " - -#: shell-novice/_episodes/05-loop.md:98 -msgid "" -"In this example, the list is two filenames: `basilisk.dat` and `unicorn.dat`.\n" -"Each time the loop iterates, it will assign a file name to the variable `filename`\n" -"and run the `head` command.\n" -"The first time through the loop,\n" -"`$filename` is `basilisk.dat`. \n" -"The interpreter runs the command `head` on `basilisk.dat`, \n" -"and the prints the \n" -"first three lines of `basilisk.dat`.\n" -"For the second iteration, `$filename` becomes \n" -"`unicorn.dat`. This time, the shell runs `head` on `unicorn.dat`\n" -"and prints the first three lines of `unicorn.dat`. \n" -"Since the list was only two items, the shell exits the `for` loop." -msgstr "" -"In this example, the list is two filenames: `basilisk.dat` and `unicorn.dat`.\n" -"Each time the loop iterates, it will assign a file name to the variable `filename`\n" -"and run the `head` command.\n" -"The first time through the loop,\n" -"`$filename` is `basilisk.dat`. \n" -"The interpreter runs the command `head` on `basilisk.dat`, \n" -"and the prints the \n" -"first three lines of `basilisk.dat`.\n" -"For the second iteration, `$filename` becomes \n" -"`unicorn.dat`. This time, the shell runs `head` on `unicorn.dat`\n" -"and prints the first three lines of `unicorn.dat`. \n" -"Since the list was only two items, the shell exits the `for` loop." - -#: shell-novice/_episodes/05-loop.md:111 -msgid "" -"When using variables it is also\n" -"possible to put the names into curly braces to clearly delimit the variable\n" -"name: `$filename` is equivalent to `${filename}`, but is different from\n" -"`${file}name`. You may find this notation in other people's programs." -msgstr "" -"When using variables it is also\n" -"possible to put the names into curly braces to clearly delimit the variable\n" -"name: `$filename` is equivalent to `${filename}`, but is different from\n" -"`${file}name`. You may find this notation in other people's programs." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:116 -msgid "> ## Variables in Loops" -msgstr "> ## Variables in Loops" - -#: shell-novice/_episodes/05-loop.md:117 -msgid "" -">\n" -"> This exercise refers to the `data-shell/molecules` directory.\n" -"> `ls` gives the following output:\n" -">\n" -"> ~~~\n" -"> cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> ~~~" -msgstr "" -">\n" -"> This exercise refers to the `data-shell/molecules` directory.\n" -"> `ls` gives the following output:\n" -">\n" -"> ~~~\n" -"> cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> ~~~" - -#: shell-novice/_episodes/05-loop.md:125 -msgid "" -">\n" -"> What is the output of the following code?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -"> ls *.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Now, what is the output of the following code?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -">\tls $datafile\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Why do these two loops give different outputs?\n" -">\n" -"> > ## Solution\n" -"> > The first code block gives the same output on each iteration through\n" -"> > the loop.\n" -"> > Bash expands the wildcard `*.pdb` within the loop body (as well as\n" -"> > before the loop starts) to match all files ending in `.pdb`\n" -"> > and then lists them using `ls`.\n" -"> > The expanded loop would look like this:\n" -"> > ```\n" -"> > for datafile in cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > do\n" -"> >\tls cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > done\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> >\n" -"> > ```\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > ```\n" -"> > {: .output}\n" -"> >\n" -"> > The second code block lists a different file on each loop iteration.\n" -"> > The value of the `datafile` variable is evaluated using `$datafile`,\n" -"> > and then listed using `ls`.\n" -"> >\n" -"> > ```\n" -"> > cubane.pdb\n" -"> > ethane.pdb\n" -"> > methane.pdb\n" -"> > octane.pdb\n" -"> > pentane.pdb\n" -"> > propane.pdb\n" -"> > ```\n" -"> > {: .output}" -msgstr "" -">\n" -"> What is the output of the following code?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -"> ls *.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Now, what is the output of the following code?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -">\tls $datafile\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Why do these two loops give different outputs?\n" -">\n" -"> > ## Solution\n" -"> > The first code block gives the same output on each iteration through\n" -"> > the loop.\n" -"> > Bash expands the wildcard `*.pdb` within the loop body (as well as\n" -"> > before the loop starts) to match all files ending in `.pdb`\n" -"> > and then lists them using `ls`.\n" -"> > The expanded loop would look like this:\n" -"> > ```\n" -"> > for datafile in cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > do\n" -"> >\tls cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > done\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> >\n" -"> > ```\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > ```\n" -"> > {: .output}\n" -"> >\n" -"> > The second code block lists a different file on each loop iteration.\n" -"> > The value of the `datafile` variable is evaluated using `$datafile`,\n" -"> > and then listed using `ls`.\n" -"> >\n" -"> > ```\n" -"> > cubane.pdb\n" -"> > ethane.pdb\n" -"> > methane.pdb\n" -"> > octane.pdb\n" -"> > pentane.pdb\n" -"> > propane.pdb\n" -"> > ```\n" -"> > {: .output}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:189 -msgid "> ## Follow the Prompt" -msgstr "> ## Follow the Prompt" - -#: shell-novice/_episodes/05-loop.md:190 -msgid "" -">\n" -"> The shell prompt changes from `$` to `>` and back again as we were\n" -"> typing in our loop. The second prompt, `>`, is different to remind\n" -"> us that we haven't finished typing a complete command yet. A semicolon, `;`,\n" -"> can be used to separate two commands written on a single line." -msgstr "" -">\n" -"> The shell prompt changes from `$` to `>` and back again as we were\n" -"> typing in our loop. The second prompt, `>`, is different to remind\n" -"> us that we haven't finished typing a complete command yet. A semicolon, `;`,\n" -"> can be used to separate two commands written on a single line." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:197 -msgid "> ## Same Symbols, Different Meanings" -msgstr "> ## Same Symbols, Different Meanings" - -#: shell-novice/_episodes/05-loop.md:198 -msgid "" -">\n" -"> Here we see `>` being used a shell prompt, whereas `>` is also\n" -"> used to redirect output.\n" -"> Similarly, `$` is used as a shell prompt, but, as we saw earlier,\n" -"> it is also used to ask the shell to get the value of a variable.\n" -">\n" -"> If the *shell* prints `>` or `$` then it expects you to type something,\n" -"> and the symbol is a prompt.\n" -">\n" -"> If *you* type `>` or `$` yourself, it is an instruction from you that\n" -"> the shell to redirect output or get the value of a variable." -msgstr "" -">\n" -"> Here we see `>` being used a shell prompt, whereas `>` is also\n" -"> used to redirect output.\n" -"> Similarly, `$` is used as a shell prompt, but, as we saw earlier,\n" -"> it is also used to ask the shell to get the value of a variable.\n" -">\n" -"> If the *shell* prints `>` or `$` then it expects you to type something,\n" -"> and the symbol is a prompt.\n" -">\n" -"> If *you* type `>` or `$` yourself, it is an instruction from you that\n" -"> the shell to redirect output or get the value of a variable." - -#: shell-novice/_episodes/05-loop.md:211 -msgid "" -"Returning to our example in the `data-shell/creatures` directory,\n" -"we have called the variable in this loop `filename`\n" -"in order to make its purpose clearer to human readers.\n" -"The shell itself doesn't care what the variable is called;\n" -"if we wrote this loop as:" -msgstr "" -"Returning to our example in the `data-shell/creatures` directory,\n" -"we have called the variable in this loop `filename`\n" -"in order to make its purpose clearer to human readers.\n" -"The shell itself doesn't care what the variable is called;\n" -"if we wrote this loop as:" - -# code block -#: shell-novice/_episodes/05-loop.md:217 -msgid "" -"~~~\n" -"for x in basilisk.dat unicorn.dat\n" -"do\n" -" head -n 3 $x\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"for x in basilisk.dat unicorn.dat\n" -"do\n" -" head -n 3 $x\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:225 -msgid "or:" -msgstr "or:" - -# code block -#: shell-novice/_episodes/05-loop.md:227 -msgid "" -"~~~\n" -"for temperature in basilisk.dat unicorn.dat\n" -"do\n" -" head -n 3 $temperature\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"for temperature in basilisk.dat unicorn.dat\n" -"do\n" -" head -n 3 $temperature\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:235 -msgid "" -"it would work exactly the same way.\n" -"*Don't do this.*\n" -"Programs are only useful if people can understand them,\n" -"so meaningless names (like `x`) or misleading names (like `temperature`)\n" -"increase the odds that the program won't do what its readers think it does." -msgstr "" -"it would work exactly the same way.\n" -"*Don't do this.*\n" -"Programs are only useful if people can understand them,\n" -"so meaningless names (like `x`) or misleading names (like `temperature`)\n" -"increase the odds that the program won't do what its readers think it does." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:241 -msgid "> ## Limiting Sets of Files" -msgstr "> ## Limiting Sets of Files" - -#: shell-novice/_episodes/05-loop.md:242 -msgid "" -">\n" -"> What would be the output of running the following loop in the `data-shell/molecules` directory?\n" -">\n" -"> ~~~\n" -"> for filename in c*\n" -"> do\n" -"> ls $filename \n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. No files are listed.\n" -"> 2. All files are listed.\n" -"> 3. Only `cubane.pdb`, `octane.pdb` and `pentane.pdb` are listed.\n" -"> 4. Only `cubane.pdb` is listed.\n" -">\n" -"> > ## Solution\n" -"> > 4 is the correct answer. `*` matches zero or more characters, so any file name starting with \n" -"> > the letter c, followed by zero or more other characters will be matched." -msgstr "" -">\n" -"> What would be the output of running the following loop in the `data-shell/molecules` directory?\n" -">\n" -"> ~~~\n" -"> for filename in c*\n" -"> do\n" -"> ls $filename \n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. No files are listed.\n" -"> 2. All files are listed.\n" -"> 3. Only `cubane.pdb`, `octane.pdb` and `pentane.pdb` are listed.\n" -"> 4. Only `cubane.pdb` is listed.\n" -">\n" -"> > ## Solution\n" -"> > 4 is the correct answer. `*` matches zero or more characters, so any file name starting with \n" -"> > the letter c, followed by zero or more other characters will be matched." - -#: shell-novice/_episodes/05-loop.md:262 -msgid "" -">\n" -"> How would the output differ from using this command instead?\n" -">\n" -"> ~~~\n" -"> for filename in *c*\n" -"> do\n" -"> ls $filename \n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. The same files would be listed.\n" -"> 2. All the files are listed this time.\n" -"> 3. No files are listed this time.\n" -"> 4. The files `cubane.pdb` and `octane.pdb` will be listed.\n" -"> 5. Only the file `octane.pdb` will be listed.\n" -">\n" -"> > ## Solution\n" -"> > 4 is the correct answer. `*` matches zero or more characters, so a file name with zero or more\n" -"> > characters before a letter c and zero or more characters after the letter c will be matched." -msgstr "" -">\n" -"> How would the output differ from using this command instead?\n" -">\n" -"> ~~~\n" -"> for filename in *c*\n" -"> do\n" -"> ls $filename \n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. The same files would be listed.\n" -"> 2. All the files are listed this time.\n" -"> 3. No files are listed this time.\n" -"> 4. The files `cubane.pdb` and `octane.pdb` will be listed.\n" -"> 5. Only the file `octane.pdb` will be listed.\n" -">\n" -"> > ## Solution\n" -"> > 4 is the correct answer. `*` matches zero or more characters, so a file name with zero or more\n" -"> > characters before a letter c and zero or more characters after the letter c will be matched." - -#: shell-novice/_episodes/05-loop.md:285 -msgid "" -"Let's continue with our example in the `data-shell/creatures` directory.\n" -"Here's a slightly more complicated loop:" -msgstr "" -"Let's continue with our example in the `data-shell/creatures` directory.\n" -"Here's a slightly more complicated loop:" - -# code block -#: shell-novice/_episodes/05-loop.md:288 -msgid "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" echo $filename\n" -" head -n 100 $filename | tail -n 20\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" echo $filename\n" -" head -n 100 $filename | tail -n 20\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:297 -msgid "" -"The shell starts by expanding `*.dat` to create the list of files it will process.\n" -"The **loop body**\n" -"then executes two commands for each of those files.\n" -"The first, `echo`, just prints its command-line arguments to standard output.\n" -"For example:" -msgstr "" -"The shell starts by expanding `*.dat` to create the list of files it will process.\n" -"The **loop body**\n" -"then executes two commands for each of those files.\n" -"The first, `echo`, just prints its command-line arguments to standard output.\n" -"For example:" - -# code block -#: shell-novice/_episodes/05-loop.md:303 -msgid "" -"~~~\n" -"$ echo hello there\n" -"~~~" -msgstr "" -"~~~\n" -"$ echo hello there\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:308 -msgid "prints:" -msgstr "prints:" - -# code block -#: shell-novice/_episodes/05-loop.md:310 -msgid "" -"~~~\n" -"hello there\n" -"~~~" -msgstr "" -"~~~\n" -"hello there\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:315 -msgid "" -"In this case,\n" -"since the shell expands `$filename` to be the name of a file,\n" -"`echo $filename` just prints the name of the file.\n" -"Note that we can't write this as:" -msgstr "" -"In this case,\n" -"since the shell expands `$filename` to be the name of a file,\n" -"`echo $filename` just prints the name of the file.\n" -"Note that we can't write this as:" - -# code block -#: shell-novice/_episodes/05-loop.md:320 -msgid "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" $filename\n" -" head -n 100 $filename | tail -n 20\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" $filename\n" -" head -n 100 $filename | tail -n 20\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:329 -msgid "" -"because then the first time through the loop,\n" -"when `$filename` expanded to `basilisk.dat`, the shell would try to run `basilisk.dat` as a program.\n" -"Finally,\n" -"the `head` and `tail` combination selects lines 81-100\n" -"from whatever file is being processed\n" -"(assuming the file has at least 100 lines)." -msgstr "" -"because then the first time through the loop,\n" -"when `$filename` expanded to `basilisk.dat`, the shell would try to run `basilisk.dat` as a program.\n" -"Finally,\n" -"the `head` and `tail` combination selects lines 81-100\n" -"from whatever file is being processed\n" -"(assuming the file has at least 100 lines)." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:336 -msgid "> ## Spaces in Names" -msgstr "> ## Spaces in Names" - -#: shell-novice/_episodes/05-loop.md:337 -msgid "" -">\n" -"> Whitespace is used to separate the elements on the list\n" -"> that we are going to loop over. If on the list we have elements\n" -"> with whitespace we need to quote those elements\n" -"> and our variable when using it.\n" -"> Suppose our data files are named:\n" -">\n" -"> ~~~\n" -"> red dragon.dat\n" -"> purple unicorn.dat\n" -"> ~~~" -msgstr "" -">\n" -"> Whitespace is used to separate the elements on the list\n" -"> that we are going to loop over. If on the list we have elements\n" -"> with whitespace we need to quote those elements\n" -"> and our variable when using it.\n" -"> Suppose our data files are named:\n" -">\n" -"> ~~~\n" -"> red dragon.dat\n" -"> purple unicorn.dat\n" -"> ~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:350 -msgid "> We need to use" -msgstr "> We need to use" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:353 -msgid "> for filename in \"red dragon.dat\" \"purple unicorn.dat\"" -msgstr "> for filename in \"red dragon.dat\" \"purple unicorn.dat\"" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:354 -msgid "> do" -msgstr "> do" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:355 -msgid "> head -n 100 \"$filename\" | tail -n 3" -msgstr "> head -n 100 \"$filename\" | tail -n 3" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:356 -msgid "> done" -msgstr "> done" - -#: shell-novice/_episodes/05-loop.md:359 -msgid "" -">\n" -"> It is simpler just to avoid using whitespaces (or other special characters) in filenames.\n" -">\n" -"> The files above don't exist, so if we run the above code, the `head` command will be unable\n" -"> to find them, however the error message returned will show the name of the files it is\n" -"> expecting:\n" -"> ```\n" -"> head: cannot open ‘red dragon.dat’ for reading: No such file or directory\n" -"> head: cannot open ‘purple unicorn.dat’ for reading: No such file or directory\n" -"> ```" -msgstr "" -">\n" -"> It is simpler just to avoid using whitespaces (or other special characters) in filenames.\n" -">\n" -"> The files above don't exist, so if we run the above code, the `head` command will be unable\n" -"> to find them, however the error message returned will show the name of the files it is\n" -"> expecting:\n" -"> ```\n" -"> head: cannot open ‘red dragon.dat’ for reading: No such file or directory\n" -"> head: cannot open ‘purple unicorn.dat’ for reading: No such file or directory\n" -"> ```" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:370 -msgid "> Try removing the quotes around `$filename` in the loop above to see the effect of the quote" -msgstr "> Try removing the quotes around `$filename` in the loop above to see the effect of the quote" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:371 -msgid "> marks on whitespace. Note that we get a result from the loop command for unicorn.dat when we run this code in the `creatures` directory:" -msgstr "> marks on whitespace. Note that we get a result from the loop command for unicorn.dat when we run this code in the `creatures` directory:" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:372 shell-novice/_episodes/05-loop.md:379 -msgid "> ```" -msgstr "> ```" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:373 -msgid "> head: cannot open ‘red’ for reading: No such file or directory" -msgstr "> head: cannot open ‘red’ for reading: No such file or directory" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:374 -msgid "> head: cannot open ‘dragon.dat’ for reading: No such file or directory" -msgstr "> head: cannot open ‘dragon.dat’ for reading: No such file or directory" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:375 -msgid "> head: cannot open ‘purple’ for reading: No such file or directory" -msgstr "> head: cannot open ‘purple’ for reading: No such file or directory" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:376 -msgid "> CGGTACCGAA" -msgstr "> CGGTACCGAA" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:377 -msgid "> AAGGGTCGCG" -msgstr "> AAGGGTCGCG" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:378 -msgid "> CAAGTGTTCC" -msgstr "> CAAGTGTTCC" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:380 -msgid "> {: . output}" -msgstr "> {: . output}" - -#: shell-novice/_episodes/05-loop.md:383 -msgid "" -"Going back to our original file copying problem,\n" -"we can solve it using this loop:" -msgstr "" -"Going back to our original file copying problem,\n" -"we can solve it using this loop:" - -# code block -#: shell-novice/_episodes/05-loop.md:386 -msgid "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" cp $filename original-$filename\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"for filename in *.dat\n" -"do\n" -" cp $filename original-$filename\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:394 -msgid "" -"This loop runs the `cp` command once for each filename.\n" -"The first time,\n" -"when `$filename` expands to `basilisk.dat`,\n" -"the shell executes:" -msgstr "" -"This loop runs the `cp` command once for each filename.\n" -"The first time,\n" -"when `$filename` expands to `basilisk.dat`,\n" -"the shell executes:" - -# code block -#: shell-novice/_episodes/05-loop.md:399 -msgid "" -"~~~\n" -"cp basilisk.dat original-basilisk.dat\n" -"~~~" -msgstr "" -"~~~\n" -"cp basilisk.dat original-basilisk.dat\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:404 -msgid "The second time, the command is:" -msgstr "The second time, the command is:" - -# code block -#: shell-novice/_episodes/05-loop.md:406 -msgid "" -"~~~\n" -"cp unicorn.dat original-unicorn.dat\n" -"~~~" -msgstr "" -"~~~\n" -"cp unicorn.dat original-unicorn.dat\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:411 -msgid "" -"Since the `cp` command does not normally produce any output, it's hard to check \n" -"that the loop is doing the correct thing. By prefixing the command with `echo` \n" -"it is possible to see each command as it _would_ be executed. The following diagram \n" -"shows what happens when the modified script is executed, and demonstrates how the \n" -"judicious use of `echo` is a good debugging technique." -msgstr "" -"Since the `cp` command does not normally produce any output, it's hard to check \n" -"that the loop is doing the correct thing. By prefixing the command with `echo` \n" -"it is possible to see each command as it _would_ be executed. The following diagram \n" -"shows what happens when the modified script is executed, and demonstrates how the \n" -"judicious use of `echo` is a good debugging technique." - -#: shell-novice/_episodes/05-loop.md:417 -msgid "![For Loop in Action](../fig/shell_script_for_loop_flow_chart.svg)" -msgstr "![For Loop in Action](../fig/shell_script_for_loop_flow_chart.svg)" - -# header -#: shell-novice/_episodes/05-loop.md:419 -msgid "## Nelle's Pipeline: Processing Files" -msgstr "## Nelle's Pipeline: Processing Files" - -#: shell-novice/_episodes/05-loop.md:421 -msgid "" -"Nelle is now ready to process her data files using `goostats` --- a shell script written by her supervisor.\n" -"This calculates some statistics from a protein sample file, and takes two arguments:" -msgstr "" -"Nelle is now ready to process her data files using `goostats` --- a shell script written by her supervisor.\n" -"This calculates some statistics from a protein sample file, and takes two arguments:" - -# ordered list -#: shell-novice/_episodes/05-loop.md:424 -msgid "1. an input file (containing the raw data)" -msgstr "1. an input file (containing the raw data)" - -# ordered list -#: shell-novice/_episodes/05-loop.md:425 -msgid "2. an output file (to store the calculated statistics)" -msgstr "2. an output file (to store the calculated statistics)" - -#: shell-novice/_episodes/05-loop.md:427 -msgid "" -"Since she's still learning how to use the shell,\n" -"she decides to build up the required commands in stages.\n" -"Her first step is to make sure that she can select the right input files --- remember,\n" -"these are ones whose names end in 'A' or 'B', rather than 'Z'. Starting from her home directory, Nelle types:" -msgstr "" -"Since she's still learning how to use the shell,\n" -"she decides to build up the required commands in stages.\n" -"Her first step is to make sure that she can select the right input files --- remember,\n" -"these are ones whose names end in 'A' or 'B', rather than 'Z'. Starting from her home directory, Nelle types:" - -# code block -#: shell-novice/_episodes/05-loop.md:432 -msgid "" -"~~~\n" -"$ cd north-pacific-gyre/2012-07-03\n" -"$ for datafile in NENE*[AB].txt\n" -"> do\n" -"> echo $datafile\n" -"> done\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd north-pacific-gyre/2012-07-03\n" -"$ for datafile in NENE*[AB].txt\n" -"> do\n" -"> echo $datafile\n" -"> done\n" -"~~~" - -# code block -#: shell-novice/_episodes/05-loop.md:441 -msgid "" -"~~~\n" -"NENE01729A.txt\n" -"NENE01729B.txt\n" -"NENE01736A.txt\n" -"...\n" -"NENE02043A.txt\n" -"NENE02043B.txt\n" -"~~~" -msgstr "" -"~~~\n" -"NENE01729A.txt\n" -"NENE01729B.txt\n" -"NENE01736A.txt\n" -"...\n" -"NENE02043A.txt\n" -"NENE02043B.txt\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:451 -msgid "" -"Her next step is to decide\n" -"what to call the files that the `goostats` analysis program will create.\n" -"Prefixing each input file's name with \"stats\" seems simple,\n" -"so she modifies her loop to do that:" -msgstr "" -"Her next step is to decide\n" -"what to call the files that the `goostats` analysis program will create.\n" -"Prefixing each input file's name with \"stats\" seems simple,\n" -"so she modifies her loop to do that:" - -# code block -#: shell-novice/_episodes/05-loop.md:456 -msgid "" -"~~~\n" -"$ for datafile in NENE*[AB].txt\n" -"> do\n" -"> echo $datafile stats-$datafile\n" -"> done\n" -"~~~" -msgstr "" -"~~~\n" -"$ for datafile in NENE*[AB].txt\n" -"> do\n" -"> echo $datafile stats-$datafile\n" -"> done\n" -"~~~" - -# code block -#: shell-novice/_episodes/05-loop.md:464 -msgid "" -"~~~\n" -"NENE01729A.txt stats-NENE01729A.txt\n" -"NENE01729B.txt stats-NENE01729B.txt\n" -"NENE01736A.txt stats-NENE01736A.txt\n" -"...\n" -"NENE02043A.txt stats-NENE02043A.txt\n" -"NENE02043B.txt stats-NENE02043B.txt\n" -"~~~" -msgstr "" -"~~~\n" -"NENE01729A.txt stats-NENE01729A.txt\n" -"NENE01729B.txt stats-NENE01729B.txt\n" -"NENE01736A.txt stats-NENE01736A.txt\n" -"...\n" -"NENE02043A.txt stats-NENE02043A.txt\n" -"NENE02043B.txt stats-NENE02043B.txt\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:474 -msgid "" -"She hasn't actually run `goostats` yet,\n" -"but now she's sure she can select the right files and generate the right output filenames." -msgstr "" -"She hasn't actually run `goostats` yet,\n" -"but now she's sure she can select the right files and generate the right output filenames." - -#: shell-novice/_episodes/05-loop.md:477 -msgid "" -"Typing in commands over and over again is becoming tedious,\n" -"though,\n" -"and Nelle is worried about making mistakes,\n" -"so instead of re-entering her loop,\n" -"she presses the up arrow.\n" -"In response,\n" -"the shell redisplays the whole loop on one line\n" -"(using semi-colons to separate the pieces):" -msgstr "" -"Typing in commands over and over again is becoming tedious,\n" -"though,\n" -"and Nelle is worried about making mistakes,\n" -"so instead of re-entering her loop,\n" -"she presses the up arrow.\n" -"In response,\n" -"the shell redisplays the whole loop on one line\n" -"(using semi-colons to separate the pieces):" - -# code block -#: shell-novice/_episodes/05-loop.md:486 -msgid "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do echo $datafile stats-$datafile; done\n" -"~~~" -msgstr "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do echo $datafile stats-$datafile; done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:491 -msgid "" -"Using the left arrow key,\n" -"Nelle backs up and changes the command `echo` to `bash goostats`:" -msgstr "" -"Using the left arrow key,\n" -"Nelle backs up and changes the command `echo` to `bash goostats`:" - -# code block -#: shell-novice/_episodes/05-loop.md:494 -msgid "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do bash goostats $datafile stats-$datafile; done\n" -"~~~" -msgstr "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do bash goostats $datafile stats-$datafile; done\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:499 -msgid "" -"When she presses Enter,\n" -"the shell runs the modified command.\n" -"However, nothing appears to happen --- there is no output.\n" -"After a moment, Nelle realizes that since her script doesn't print anything to the screen any longer,\n" -"she has no idea whether it is running, much less how quickly.\n" -"She kills the running command by typing `Ctrl-C`,\n" -"uses up-arrow to repeat the command,\n" -"and edits it to read:" -msgstr "" -"When she presses Enter,\n" -"the shell runs the modified command.\n" -"However, nothing appears to happen --- there is no output.\n" -"After a moment, Nelle realizes that since her script doesn't print anything to the screen any longer,\n" -"she has no idea whether it is running, much less how quickly.\n" -"She kills the running command by typing `Ctrl-C`,\n" -"uses up-arrow to repeat the command,\n" -"and edits it to read:" - -# code block -#: shell-novice/_episodes/05-loop.md:508 -msgid "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do echo $datafile; bash goostats $datafile stats-$datafile; done\n" -"~~~" -msgstr "" -"~~~\n" -"$ for datafile in NENE*[AB].txt; do echo $datafile; bash goostats $datafile stats-$datafile; done\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:513 -msgid "> ## Beginning and End" -msgstr "> ## Beginning and End" - -#: shell-novice/_episodes/05-loop.md:514 -msgid "" -">\n" -"> We can move to the beginning of a line in the shell by typing `Ctrl-a`\n" -"> and to the end using `Ctrl-e`." -msgstr "" -">\n" -"> We can move to the beginning of a line in the shell by typing `Ctrl-a`\n" -"> and to the end using `Ctrl-e`." - -#: shell-novice/_episodes/05-loop.md:519 -msgid "" -"When she runs her program now,\n" -"it produces one line of output every five seconds or so:" -msgstr "" -"When she runs her program now,\n" -"it produces one line of output every five seconds or so:" - -# code block -#: shell-novice/_episodes/05-loop.md:522 -msgid "" -"~~~\n" -"NENE01729A.txt\n" -"NENE01729B.txt\n" -"NENE01736A.txt\n" -"...\n" -"~~~" -msgstr "" -"~~~\n" -"NENE01729A.txt\n" -"NENE01729B.txt\n" -"NENE01736A.txt\n" -"...\n" -"~~~" - -#: shell-novice/_episodes/05-loop.md:530 -msgid "" -"1518 times 5 seconds,\n" -"divided by 60,\n" -"tells her that her script will take about two hours to run.\n" -"As a final check,\n" -"she opens another terminal window,\n" -"goes into `north-pacific-gyre/2012-07-03`,\n" -"and uses `cat stats-NENE01729B.txt`\n" -"to examine one of the output files.\n" -"It looks good,\n" -"so she decides to get some coffee and catch up on her reading." -msgstr "" -"1518 times 5 seconds,\n" -"divided by 60,\n" -"tells her that her script will take about two hours to run.\n" -"As a final check,\n" -"she opens another terminal window,\n" -"goes into `north-pacific-gyre/2012-07-03`,\n" -"and uses `cat stats-NENE01729B.txt`\n" -"to examine one of the output files.\n" -"It looks good,\n" -"so she decides to get some coffee and catch up on her reading." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:541 -msgid "> ## Those Who Know History Can Choose to Repeat It" -msgstr "> ## Those Who Know History Can Choose to Repeat It" - -#: shell-novice/_episodes/05-loop.md:542 -msgid "" -">\n" -"> Another way to repeat previous work is to use the `history` command to\n" -"> get a list of the last few hundred commands that have been executed, and\n" -"> then to use `!123` (where \"123\" is replaced by the command number) to\n" -"> repeat one of those commands. For example, if Nelle types this:\n" -">\n" -"> ~~~\n" -"> $ history | tail -n 5\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> 456 ls -l NENE0*.txt\n" -"> 457 rm stats-NENE01729B.txt.txt\n" -"> 458 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" -"> 459 ls -l NENE0*.txt\n" -"> 460 history\n" -"> ~~~" -msgstr "" -">\n" -"> Another way to repeat previous work is to use the `history` command to\n" -"> get a list of the last few hundred commands that have been executed, and\n" -"> then to use `!123` (where \"123\" is replaced by the command number) to\n" -"> repeat one of those commands. For example, if Nelle types this:\n" -">\n" -"> ~~~\n" -"> $ history | tail -n 5\n" -"> ~~~\n" -"> {: .language-bash}\n" -"> ~~~\n" -"> 456 ls -l NENE0*.txt\n" -"> 457 rm stats-NENE01729B.txt.txt\n" -"> 458 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" -"> 459 ls -l NENE0*.txt\n" -"> 460 history\n" -"> ~~~" - -#: shell-novice/_episodes/05-loop.md:560 -msgid "" -">\n" -"> then she can re-run `goostats` on `NENE01729B.txt` simply by typing\n" -"> `!458`." -msgstr "" -">\n" -"> then she can re-run `goostats` on `NENE01729B.txt` simply by typing\n" -"> `!458`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:565 -msgid "> ## Other History Commands" -msgstr "> ## Other History Commands" - -#: shell-novice/_episodes/05-loop.md:566 -msgid "" -">\n" -"> There are a number of other shortcut commands for getting at the history.\n" -">\n" -"> - `Ctrl-R` enters a history search mode \"reverse-i-search\" and finds the \n" -"> most recent command in your history that matches the text you enter next.\n" -"> Press `Ctrl-R` one or more additional times to search for earlier matches.\n" -"> - `!!` retrieves the immediately preceding command \n" -"> (you may or may not find this more convenient than using the up-arrow)\n" -"> - `!$` retrieves the last word of the last command.\n" -"> That's useful more often than you might expect: after\n" -"> `bash goostats NENE01729B.txt stats-NENE01729B.txt`, you can type\n" -"> `less !$` to look at the file `stats-NENE01729B.txt`, which is\n" -"> quicker than doing up-arrow and editing the command-line." -msgstr "" -">\n" -"> There are a number of other shortcut commands for getting at the history.\n" -">\n" -"> - `Ctrl-R` enters a history search mode \"reverse-i-search\" and finds the \n" -"> most recent command in your history that matches the text you enter next.\n" -"> Press `Ctrl-R` one or more additional times to search for earlier matches.\n" -"> - `!!` retrieves the immediately preceding command \n" -"> (you may or may not find this more convenient than using the up-arrow)\n" -"> - `!$` retrieves the last word of the last command.\n" -"> That's useful more often than you might expect: after\n" -"> `bash goostats NENE01729B.txt stats-NENE01729B.txt`, you can type\n" -"> `less !$` to look at the file `stats-NENE01729B.txt`, which is\n" -"> quicker than doing up-arrow and editing the command-line." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:581 -msgid "> ## Saving to a File in a Loop - Part One" -msgstr "> ## Saving to a File in a Loop - Part One" - -#: shell-novice/_episodes/05-loop.md:582 -msgid "" -">\n" -"> In the `data-shell/molecules` directory, what is the effect of this loop?\n" -">\n" -"> ~~~\n" -"> for alkanes in *.pdb\n" -"> do\n" -"> echo $alkanes\n" -"> cat $alkanes > alkanes.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb` and `propane.pdb`,\n" -"> and the text from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" -"> 2. Prints `cubane.pdb`, `ethane.pdb`, and `methane.pdb`, and the text from all three files would be\n" -"> concatenated and saved to a file called `alkanes.pdb`.\n" -"> 3. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and `pentane.pdb`, and the text\n" -"> from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" -"> 4. None of the above.\n" -">\n" -"> > ## Solution\n" -"> > 1. The text from each file in turn gets written to the `alkanes.pdb` file.\n" -"> > However, the file gets overwritten on each loop interation, so the final content of `alkanes.pdb`\n" -"> > is the text from the `propane.pdb` file." -msgstr "" -">\n" -"> In the `data-shell/molecules` directory, what is the effect of this loop?\n" -">\n" -"> ~~~\n" -"> for alkanes in *.pdb\n" -"> do\n" -"> echo $alkanes\n" -"> cat $alkanes > alkanes.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb` and `propane.pdb`,\n" -"> and the text from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" -"> 2. Prints `cubane.pdb`, `ethane.pdb`, and `methane.pdb`, and the text from all three files would be\n" -"> concatenated and saved to a file called `alkanes.pdb`.\n" -"> 3. Prints `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and `pentane.pdb`, and the text\n" -"> from `propane.pdb` will be saved to a file called `alkanes.pdb`.\n" -"> 4. None of the above.\n" -">\n" -"> > ## Solution\n" -"> > 1. The text from each file in turn gets written to the `alkanes.pdb` file.\n" -"> > However, the file gets overwritten on each loop interation, so the final content of `alkanes.pdb`\n" -"> > is the text from the `propane.pdb` file." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:609 -msgid "> ## Saving to a File in a Loop - Part Two" -msgstr "> ## Saving to a File in a Loop - Part Two" - -#: shell-novice/_episodes/05-loop.md:610 -msgid "" -">\n" -"> Also in the `data-shell/molecules` directory, what would be the output of the following loop?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -"> cat $datafile >> all.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and\n" -"> `pentane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" -"> 2. The text from `ethane.pdb` will be saved to a file called `all.pdb`.\n" -"> 3. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" -"> and `propane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" -"> 4. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" -"> and `propane.pdb` would be printed to the screen and saved to a file called `all.pdb`.\n" -">\n" -"> > ## Solution\n" -"> > 3 is the correct answer. `>>` appends to a file, rather than overwriting it with the redirected\n" -"> > output from a command.\n" -"> > Given the output from the `cat` command has been redirected, nothing is printed to the screen." -msgstr "" -">\n" -"> Also in the `data-shell/molecules` directory, what would be the output of the following loop?\n" -">\n" -"> ~~~\n" -"> for datafile in *.pdb\n" -"> do\n" -"> cat $datafile >> all.pdb\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> 1. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, and\n" -"> `pentane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" -"> 2. The text from `ethane.pdb` will be saved to a file called `all.pdb`.\n" -"> 3. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" -"> and `propane.pdb` would be concatenated and saved to a file called `all.pdb`.\n" -"> 4. All of the text from `cubane.pdb`, `ethane.pdb`, `methane.pdb`, `octane.pdb`, `pentane.pdb`\n" -"> and `propane.pdb` would be printed to the screen and saved to a file called `all.pdb`.\n" -">\n" -"> > ## Solution\n" -"> > 3 is the correct answer. `>>` appends to a file, rather than overwriting it with the redirected\n" -"> > output from a command.\n" -"> > Given the output from the `cat` command has been redirected, nothing is printed to the screen." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:636 -msgid "> ## Doing a Dry Run" -msgstr "> ## Doing a Dry Run" - -#: shell-novice/_episodes/05-loop.md:637 -msgid "" -">\n" -"> A loop is a way to do many things at once --- or to make many mistakes at\n" -"> once if it does the wrong thing. One way to check what a loop *would* do\n" -"> is to `echo` the commands it would run instead of actually running them.\n" -"> \n" -"> Suppose we want to preview the commands the following loop will execute\n" -"> without actually running those commands:\n" -">\n" -"> ~~~\n" -"> for file in *.pdb\n" -"> do\n" -"> analyze $file > analyzed-$file\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> What is the difference between the two loops below, and which one would we\n" -"> want to run?\n" -">\n" -"> ~~~\n" -"> # Version 1\n" -"> for file in *.pdb\n" -"> do\n" -"> echo analyze $file > analyzed-$file\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Version 2\n" -"> for file in *.pdb\n" -"> do\n" -"> echo \"analyze $file > analyzed-$file\"\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > The second version is the one we want to run.\n" -"> > This prints to screen everything enclosed in the quote marks, expanding the\n" -"> > loop variable name because we have prefixed it with a dollar sign.\n" -"> >\n" -"> > The first version redirects the output from the command `echo analyze $file` to\n" -"> > a file, `analyzed-$file`. A series of files is generated: `analyzed-cubane.pdb`,\n" -"> > `analyzed-ethane.pdb` etc.\n" -"> > \n" -"> > Try both versions for yourself to see the output! Be sure to open the \n" -"> > `analyzed-*.pdb` files to view their contents." -msgstr "" -">\n" -"> A loop is a way to do many things at once --- or to make many mistakes at\n" -"> once if it does the wrong thing. One way to check what a loop *would* do\n" -"> is to `echo` the commands it would run instead of actually running them.\n" -"> \n" -"> Suppose we want to preview the commands the following loop will execute\n" -"> without actually running those commands:\n" -">\n" -"> ~~~\n" -"> for file in *.pdb\n" -"> do\n" -"> analyze $file > analyzed-$file\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> What is the difference between the two loops below, and which one would we\n" -"> want to run?\n" -">\n" -"> ~~~\n" -"> # Version 1\n" -"> for file in *.pdb\n" -"> do\n" -"> echo analyze $file > analyzed-$file\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Version 2\n" -"> for file in *.pdb\n" -"> do\n" -"> echo \"analyze $file > analyzed-$file\"\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > The second version is the one we want to run.\n" -"> > This prints to screen everything enclosed in the quote marks, expanding the\n" -"> > loop variable name because we have prefixed it with a dollar sign.\n" -"> >\n" -"> > The first version redirects the output from the command `echo analyze $file` to\n" -"> > a file, `analyzed-$file`. A series of files is generated: `analyzed-cubane.pdb`,\n" -"> > `analyzed-ethane.pdb` etc.\n" -"> > \n" -"> > Try both versions for yourself to see the output! Be sure to open the \n" -"> > `analyzed-*.pdb` files to view their contents." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/05-loop.md:688 -msgid "> ## Nested Loops" -msgstr "> ## Nested Loops" - -#: shell-novice/_episodes/05-loop.md:689 -msgid "" -">\n" -"> Suppose we want to set up up a directory structure to organize\n" -"> some experiments measuring reaction rate constants with different compounds\n" -"> *and* different temperatures. What would be the\n" -"> result of the following code:\n" -">\n" -"> ~~~\n" -"> for species in cubane ethane methane\n" -"> do\n" -"> for temperature in 25 30 37 40\n" -"> do\n" -"> mkdir $species-$temperature\n" -"> done\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > We have a nested loop, i.e. contained within another loop, so for each species\n" -"> > in the outer loop, the inner loop (the nested loop) iterates over the list of\n" -"> > temperatures, and creates a new directory for each combination.\n" -"> >\n" -"> > Try running the code for yourself to see which directories are created!" -msgstr "" -">\n" -"> Suppose we want to set up up a directory structure to organize\n" -"> some experiments measuring reaction rate constants with different compounds\n" -"> *and* different temperatures. What would be the\n" -"> result of the following code:\n" -">\n" -"> ~~~\n" -"> for species in cubane ethane methane\n" -"> do\n" -"> for temperature in 25 30 37 40\n" -"> do\n" -"> mkdir $species-$temperature\n" -"> done\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > We have a nested loop, i.e. contained within another loop, so for each species\n" -"> > in the outer loop, the inner loop (the nested loop) iterates over the list of\n" -"> > temperatures, and creates a new directory for each combination.\n" -"> >\n" -"> > Try running the code for yourself to see which directories are created!" - -# Front Matter -#: shell-novice/_episodes/06-script.md:1 -msgid "" -"---\n" -"title: \"Shell Scripts\"\n" -"teaching: 30\n" -"exercises: 15\n" -"questions:\n" -"- \"How can I save and re-use commands?\"\n" -"objectives:\n" -"- \"Write a shell script that runs a command or series of commands for a fixed set of files.\"\n" -"- \"Run a shell script from the command line.\"\n" -"- \"Write a shell script that operates on a set of files defined by the user on the command line.\"\n" -"- \"Create pipelines that include shell scripts you, and others, have written.\"\n" -"keypoints:\n" -"- \"Save commands in files (usually called shell scripts) for re-use.\"\n" -"- \"`bash filename` runs the commands saved in a file.\"\n" -"- \"`$@` refers to all of a shell script's command-line arguments.\"\n" -"- \"`$1`, `$2`, etc., refer to the first command-line argument, the second command-line argument, etc.\"\n" -"- \"Place variables in quotes if the values might have spaces in them.\"\n" -"- \"Letting users decide what files to process is more flexible and more consistent with built-in Unix commands.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Shell Scripts\"\n" -"teaching: 30\n" -"exercises: 15\n" -"questions:\n" -"- \"How can I save and re-use commands?\"\n" -"objectives:\n" -"- \"Write a shell script that runs a command or series of commands for a fixed set of files.\"\n" -"- \"Run a shell script from the command line.\"\n" -"- \"Write a shell script that operates on a set of files defined by the user on the command line.\"\n" -"- \"Create pipelines that include shell scripts you, and others, have written.\"\n" -"keypoints:\n" -"- \"Save commands in files (usually called shell scripts) for re-use.\"\n" -"- \"`bash filename` runs the commands saved in a file.\"\n" -"- \"`$@` refers to all of a shell script's command-line arguments.\"\n" -"- \"`$1`, `$2`, etc., refer to the first command-line argument, the second command-line argument, etc.\"\n" -"- \"Place variables in quotes if the values might have spaces in them.\"\n" -"- \"Letting users decide what files to process is more flexible and more consistent with built-in Unix commands.\"\n" -"---" - -#: shell-novice/_episodes/06-script.md:21 -msgid "" -"We are finally ready to see what makes the shell such a powerful programming environment.\n" -"We are going to take the commands we repeat frequently and save them in files\n" -"so that we can re-run all those operations again later by typing a single command.\n" -"For historical reasons,\n" -"a bunch of commands saved in a file is usually called a **shell script**,\n" -"but make no mistake:\n" -"these are actually small programs." -msgstr "" -"We are finally ready to see what makes the shell such a powerful programming environment.\n" -"We are going to take the commands we repeat frequently and save them in files\n" -"so that we can re-run all those operations again later by typing a single command.\n" -"For historical reasons,\n" -"a bunch of commands saved in a file is usually called a **shell script**,\n" -"but make no mistake:\n" -"these are actually small programs." - -#: shell-novice/_episodes/06-script.md:29 -msgid "" -"Let's start by going back to `molecules/` and creating a new file, `middle.sh` which will\n" -"become our shell script:" -msgstr "" -"Let's start by going back to `molecules/` and creating a new file, `middle.sh` which will\n" -"become our shell script:" - -# code block -#: shell-novice/_episodes/06-script.md:32 -msgid "" -"~~~\n" -"$ cd molecules\n" -"$ nano middle.sh\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd molecules\n" -"$ nano middle.sh\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:38 -msgid "" -"The command `nano middle.sh` opens the file `middle.sh` within the text editor \"nano\"\n" -"(which runs within the shell).\n" -"If the file does not exist, it will be created.\n" -"We can use the text editor to directly edit the file -- we'll simply insert the following line:" -msgstr "" -"The command `nano middle.sh` opens the file `middle.sh` within the text editor \"nano\"\n" -"(which runs within the shell).\n" -"If the file does not exist, it will be created.\n" -"We can use the text editor to directly edit the file -- we'll simply insert the following line:" - -# code block -#: shell-novice/_episodes/06-script.md:43 -msgid "" -"~~~\n" -"head -n 15 octane.pdb | tail -n 5\n" -"~~~" -msgstr "" -"~~~\n" -"head -n 15 octane.pdb | tail -n 5\n" -"~~~" - -# SC/DC Template label -#: shell-novice/_episodes/06-script.md:46 -#: shell-novice/_episodes/06-script.md:362 -msgid "{: .source}" -msgstr "{: .source}" - -#: shell-novice/_episodes/06-script.md:48 -msgid "" -"This is a variation on the pipe we constructed earlier:\n" -"it selects lines 11-15 of the file `octane.pdb`.\n" -"Remember, we are *not* running it as a command just yet:\n" -"we are putting the commands in a file." -msgstr "" -"This is a variation on the pipe we constructed earlier:\n" -"it selects lines 11-15 of the file `octane.pdb`.\n" -"Remember, we are *not* running it as a command just yet:\n" -"we are putting the commands in a file." - -#: shell-novice/_episodes/06-script.md:53 -msgid "" -"Then we save the file (`Ctrl-O` in nano),\n" -" and exit the text editor (`Ctrl-X` in nano).\n" -"Check that the directory `molecules` now contains a file called `middle.sh`." -msgstr "" -"Then we save the file (`Ctrl-O` in nano),\n" -" and exit the text editor (`Ctrl-X` in nano).\n" -"Check that the directory `molecules` now contains a file called `middle.sh`." - -#: shell-novice/_episodes/06-script.md:57 -msgid "" -"Once we have saved the file,\n" -"we can ask the shell to execute the commands it contains.\n" -"Our shell is called `bash`, so we run the following command:" -msgstr "" -"Once we have saved the file,\n" -"we can ask the shell to execute the commands it contains.\n" -"Our shell is called `bash`, so we run the following command:" - -# code block -#: shell-novice/_episodes/06-script.md:61 -msgid "" -"~~~\n" -"$ bash middle.sh\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash middle.sh\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:66 -#: shell-novice/_episodes/06-script.md:117 -msgid "" -"~~~\n" -"ATOM 9 H 1 -4.502 0.681 0.785 1.00 0.00\n" -"ATOM 10 H 1 -5.254 -0.243 -0.537 1.00 0.00\n" -"ATOM 11 H 1 -4.357 1.252 -0.895 1.00 0.00\n" -"ATOM 12 H 1 -3.009 -0.741 -1.467 1.00 0.00\n" -"ATOM 13 H 1 -3.172 -1.337 0.206 1.00 0.00\n" -"~~~" -msgstr "" -"~~~\n" -"ATOM 9 H 1 -4.502 0.681 0.785 1.00 0.00\n" -"ATOM 10 H 1 -5.254 -0.243 -0.537 1.00 0.00\n" -"ATOM 11 H 1 -4.357 1.252 -0.895 1.00 0.00\n" -"ATOM 12 H 1 -3.009 -0.741 -1.467 1.00 0.00\n" -"ATOM 13 H 1 -3.172 -1.337 0.206 1.00 0.00\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:75 -msgid "" -"Sure enough,\n" -"our script's output is exactly what we would get if we ran that pipeline directly." -msgstr "" -"Sure enough,\n" -"our script's output is exactly what we would get if we ran that pipeline directly." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:78 -msgid "> ## Text vs. Whatever" -msgstr "> ## Text vs. Whatever" - -#: shell-novice/_episodes/06-script.md:79 -msgid "" -">\n" -"> We usually call programs like Microsoft Word or LibreOffice Writer \"text\n" -"> editors\", but we need to be a bit more careful when it comes to\n" -"> programming. By default, Microsoft Word uses `.docx` files to store not\n" -"> only text, but also formatting information about fonts, headings, and so\n" -"> on. This extra information isn't stored as characters, and doesn't mean\n" -"> anything to tools like `head`: they expect input files to contain\n" -"> nothing but the letters, digits, and punctuation on a standard computer\n" -"> keyboard. When editing programs, therefore, you must either use a plain\n" -"> text editor, or be careful to save files as plain text." -msgstr "" -">\n" -"> We usually call programs like Microsoft Word or LibreOffice Writer \"text\n" -"> editors\", but we need to be a bit more careful when it comes to\n" -"> programming. By default, Microsoft Word uses `.docx` files to store not\n" -"> only text, but also formatting information about fonts, headings, and so\n" -"> on. This extra information isn't stored as characters, and doesn't mean\n" -"> anything to tools like `head`: they expect input files to contain\n" -"> nothing but the letters, digits, and punctuation on a standard computer\n" -"> keyboard. When editing programs, therefore, you must either use a plain\n" -"> text editor, or be careful to save files as plain text." - -#: shell-novice/_episodes/06-script.md:91 -msgid "" -"What if we want to select lines from an arbitrary file?\n" -"We could edit `middle.sh` each time to change the filename,\n" -"but that would probably take longer than just retyping the command.\n" -"Instead, let's edit `middle.sh` and make it more versatile:" -msgstr "" -"What if we want to select lines from an arbitrary file?\n" -"We could edit `middle.sh` each time to change the filename,\n" -"but that would probably take longer than just retyping the command.\n" -"Instead, let's edit `middle.sh` and make it more versatile:" - -# code block -#: shell-novice/_episodes/06-script.md:96 -#: shell-novice/_episodes/06-script.md:154 -#: shell-novice/_episodes/06-script.md:201 -msgid "" -"~~~\n" -"$ nano middle.sh\n" -"~~~" -msgstr "" -"~~~\n" -"$ nano middle.sh\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:101 -msgid "Now, within \"nano\", replace the text `octane.pdb` with the special variable called `$1`:" -msgstr "Now, within \"nano\", replace the text `octane.pdb` with the special variable called `$1`:" - -# code block -#: shell-novice/_episodes/06-script.md:103 -msgid "" -"~~~\n" -"head -n 15 \"$1\" | tail -n 5\n" -"~~~" -msgstr "" -"~~~\n" -"head -n 15 \"$1\" | tail -n 5\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:108 -msgid "" -"Inside a shell script,\n" -"`$1` means \"the first filename (or other argument) on the command line\".\n" -"We can now run our script like this:" -msgstr "" -"Inside a shell script,\n" -"`$1` means \"the first filename (or other argument) on the command line\".\n" -"We can now run our script like this:" - -# code block -#: shell-novice/_episodes/06-script.md:112 -msgid "" -"~~~\n" -"$ bash middle.sh octane.pdb\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash middle.sh octane.pdb\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:126 -msgid "or on a different file like this:" -msgstr "or on a different file like this:" - -# code block -#: shell-novice/_episodes/06-script.md:128 -msgid "" -"~~~\n" -"$ bash middle.sh pentane.pdb\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash middle.sh pentane.pdb\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:133 -#: shell-novice/_episodes/06-script.md:171 -msgid "" -"~~~\n" -"ATOM 9 H 1 1.324 0.350 -1.332 1.00 0.00\n" -"ATOM 10 H 1 1.271 1.378 0.122 1.00 0.00\n" -"ATOM 11 H 1 -0.074 -0.384 1.288 1.00 0.00\n" -"ATOM 12 H 1 -0.048 -1.362 -0.205 1.00 0.00\n" -"ATOM 13 H 1 -1.183 0.500 -1.412 1.00 0.00\n" -"~~~" -msgstr "" -"~~~\n" -"ATOM 9 H 1 1.324 0.350 -1.332 1.00 0.00\n" -"ATOM 10 H 1 1.271 1.378 0.122 1.00 0.00\n" -"ATOM 11 H 1 -0.074 -0.384 1.288 1.00 0.00\n" -"ATOM 12 H 1 -0.048 -1.362 -0.205 1.00 0.00\n" -"ATOM 13 H 1 -1.183 0.500 -1.412 1.00 0.00\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:142 -msgid "> ## Double-Quotes Around Arguments" -msgstr "> ## Double-Quotes Around Arguments" - -#: shell-novice/_episodes/06-script.md:143 -msgid "" -">\n" -"> For the same reason that we put the loop variable inside double-quotes,\n" -"> in case the filename happens to contain any spaces,\n" -"> we surround `$1` with double-quotes." -msgstr "" -">\n" -"> For the same reason that we put the loop variable inside double-quotes,\n" -"> in case the filename happens to contain any spaces,\n" -"> we surround `$1` with double-quotes." - -#: shell-novice/_episodes/06-script.md:149 -msgid "" -"We still need to edit `middle.sh` each time we want to adjust the range of lines,\n" -"though.\n" -"Let's fix that by using the special variables `$2` and `$3` for the\n" -"number of lines to be passed to `head` and `tail` respectively:" -msgstr "" -"We still need to edit `middle.sh` each time we want to adjust the range of lines,\n" -"though.\n" -"Let's fix that by using the special variables `$2` and `$3` for the\n" -"number of lines to be passed to `head` and `tail` respectively:" - -# code block -#: shell-novice/_episodes/06-script.md:159 -msgid "" -"~~~\n" -"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" -"~~~" -msgstr "" -"~~~\n" -"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:164 -msgid "We can now run:" -msgstr "We can now run:" - -# code block -#: shell-novice/_episodes/06-script.md:166 -msgid "" -"~~~\n" -"$ bash middle.sh pentane.pdb 15 5\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash middle.sh pentane.pdb 15 5\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:180 -msgid "" -"By changing the arguments to our command we can change our script's\n" -"behaviour:" -msgstr "" -"By changing the arguments to our command we can change our script's\n" -"behaviour:" - -# code block -#: shell-novice/_episodes/06-script.md:183 -msgid "" -"~~~\n" -"$ bash middle.sh pentane.pdb 20 5\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash middle.sh pentane.pdb 20 5\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:188 -msgid "" -"~~~\n" -"ATOM 14 H 1 -1.259 1.420 0.112 1.00 0.00\n" -"ATOM 15 H 1 -2.608 -0.407 1.130 1.00 0.00\n" -"ATOM 16 H 1 -2.540 -1.303 -0.404 1.00 0.00\n" -"ATOM 17 H 1 -3.393 0.254 -0.321 1.00 0.00\n" -"TER 18 1\n" -"~~~" -msgstr "" -"~~~\n" -"ATOM 14 H 1 -1.259 1.420 0.112 1.00 0.00\n" -"ATOM 15 H 1 -2.608 -0.407 1.130 1.00 0.00\n" -"ATOM 16 H 1 -2.540 -1.303 -0.404 1.00 0.00\n" -"ATOM 17 H 1 -3.393 0.254 -0.321 1.00 0.00\n" -"TER 18 1\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:197 -msgid "" -"This works,\n" -"but it may take the next person who reads `middle.sh` a moment to figure out what it does.\n" -"We can improve our script by adding some **comments** at the top:" -msgstr "" -"This works,\n" -"but it may take the next person who reads `middle.sh` a moment to figure out what it does.\n" -"We can improve our script by adding some **comments** at the top:" - -# code block -#: shell-novice/_episodes/06-script.md:206 -msgid "" -"~~~\n" -"# Select lines from the middle of a file.\n" -"# Usage: bash middle.sh filename end_line num_lines\n" -"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" -"~~~" -msgstr "" -"~~~\n" -"# Select lines from the middle of a file.\n" -"# Usage: bash middle.sh filename end_line num_lines\n" -"head -n \"$2\" \"$1\" | tail -n \"$3\"\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:213 -msgid "" -"A comment starts with a `#` character and runs to the end of the line.\n" -"The computer ignores comments,\n" -"but they're invaluable for helping people (including your future self) understand and use scripts.\n" -"The only caveat is that each time you modify the script,\n" -"you should check that the comment is still accurate:\n" -"an explanation that sends the reader in the wrong direction is worse than none at all." -msgstr "" -"A comment starts with a `#` character and runs to the end of the line.\n" -"The computer ignores comments,\n" -"but they're invaluable for helping people (including your future self) understand and use scripts.\n" -"The only caveat is that each time you modify the script,\n" -"you should check that the comment is still accurate:\n" -"an explanation that sends the reader in the wrong direction is worse than none at all." - -#: shell-novice/_episodes/06-script.md:220 -msgid "" -"What if we want to process many files in a single pipeline?\n" -"For example, if we want to sort our `.pdb` files by length, we would type:" -msgstr "" -"What if we want to process many files in a single pipeline?\n" -"For example, if we want to sort our `.pdb` files by length, we would type:" - -#: shell-novice/_episodes/06-script.md:228 -msgid "" -"because `wc -l` lists the number of lines in the files\n" -"(recall that `wc` stands for 'word count', adding the `-l` flag means 'count lines' instead)\n" -"and `sort -n` sorts things numerically.\n" -"We could put this in a file,\n" -"but then it would only ever sort a list of `.pdb` files in the current directory.\n" -"If we want to be able to get a sorted list of other kinds of files,\n" -"we need a way to get all those names into the script.\n" -"We can't use `$1`, `$2`, and so on\n" -"because we don't know how many files there are.\n" -"Instead, we use the special variable `$@`,\n" -"which means,\n" -"\"All of the command-line arguments to the shell script.\"\n" -"We also should put `$@` inside double-quotes\n" -"to handle the case of arguments containing spaces\n" -"(`\"$@\"` is equivalent to `\"$1\"` `\"$2\"` ...)\n" -"Here's an example:" -msgstr "" -"because `wc -l` lists the number of lines in the files\n" -"(recall that `wc` stands for 'word count', adding the `-l` flag means 'count lines' instead)\n" -"and `sort -n` sorts things numerically.\n" -"We could put this in a file,\n" -"but then it would only ever sort a list of `.pdb` files in the current directory.\n" -"If we want to be able to get a sorted list of other kinds of files,\n" -"we need a way to get all those names into the script.\n" -"We can't use `$1`, `$2`, and so on\n" -"because we don't know how many files there are.\n" -"Instead, we use the special variable `$@`,\n" -"which means,\n" -"\"All of the command-line arguments to the shell script.\"\n" -"We also should put `$@` inside double-quotes\n" -"to handle the case of arguments containing spaces\n" -"(`\"$@\"` is equivalent to `\"$1\"` `\"$2\"` ...)\n" -"Here's an example:" - -# code block -#: shell-novice/_episodes/06-script.md:245 -msgid "" -"~~~\n" -"$ nano sorted.sh\n" -"~~~" -msgstr "" -"~~~\n" -"$ nano sorted.sh\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:250 -msgid "" -"~~~\n" -"# Sort filenames by their length.\n" -"# Usage: bash sorted.sh one_or_more_filenames\n" -"wc -l \"$@\" | sort -n\n" -"~~~" -msgstr "" -"~~~\n" -"# Sort filenames by their length.\n" -"# Usage: bash sorted.sh one_or_more_filenames\n" -"wc -l \"$@\" | sort -n\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:257 -msgid "" -"~~~\n" -"$ bash sorted.sh *.pdb ../creatures/*.dat\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash sorted.sh *.pdb ../creatures/*.dat\n" -"~~~" - -# code block -#: shell-novice/_episodes/06-script.md:262 -msgid "" -"~~~\n" -"9 methane.pdb\n" -"12 ethane.pdb\n" -"15 propane.pdb\n" -"20 cubane.pdb\n" -"21 pentane.pdb\n" -"30 octane.pdb\n" -"163 ../creatures/basilisk.dat\n" -"163 ../creatures/unicorn.dat\n" -"~~~" -msgstr "" -"~~~\n" -"9 methane.pdb\n" -"12 ethane.pdb\n" -"15 propane.pdb\n" -"20 cubane.pdb\n" -"21 pentane.pdb\n" -"30 octane.pdb\n" -"163 ../creatures/basilisk.dat\n" -"163 ../creatures/unicorn.dat\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:274 -msgid "> ## List Unique Species" -msgstr "> ## List Unique Species" - -#: shell-novice/_episodes/06-script.md:275 -msgid "" -">\n" -"> Leah has several hundred data files, each of which is formatted like this:\n" -">\n" -"> ~~~\n" -"> 2013-11-05,deer,5\n" -"> 2013-11-05,rabbit,22\n" -"> 2013-11-05,raccoon,7\n" -"> 2013-11-06,rabbit,19\n" -"> 2013-11-06,deer,2\n" -"> 2013-11-06,fox,1\n" -"> 2013-11-07,rabbit,18\n" -"> 2013-11-07,bear,1\n" -"> ~~~" -msgstr "" -">\n" -"> Leah has several hundred data files, each of which is formatted like this:\n" -">\n" -"> ~~~\n" -"> 2013-11-05,deer,5\n" -"> 2013-11-05,rabbit,22\n" -"> 2013-11-05,raccoon,7\n" -"> 2013-11-06,rabbit,19\n" -"> 2013-11-06,deer,2\n" -"> 2013-11-06,fox,1\n" -"> 2013-11-07,rabbit,18\n" -"> 2013-11-07,bear,1\n" -"> ~~~" - -#: shell-novice/_episodes/06-script.md:289 -msgid "" -">\n" -"> An example of this type of file is given in `data-shell/data/animal-counts/animals.txt`.\n" -"> \n" -"> Write a shell script called `species.sh` that takes any number of\n" -"> filenames as command-line arguments, and uses `cut`, `sort`, and\n" -"> `uniq` to print a list of the unique species appearing in each of\n" -"> those files separately.\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > # Script to find unique species in csv files where species is the second data field\n" -"> > # This script accepts any number of file names as command line arguments\n" -"> >\n" -"> > # Loop over all files\n" -"> > for file in $@ \n" -"> > do\n" -"> > \techo \"Unique species in $file:\"\n" -"> > \t# Extract species names\n" -"> > \tcut -d , -f 2 $file | sort | uniq\n" -"> > done\n" -"> > ```\n" -"> > {: .source}" -msgstr "" -">\n" -"> An example of this type of file is given in `data-shell/data/animal-counts/animals.txt`.\n" -"> \n" -"> Write a shell script called `species.sh` that takes any number of\n" -"> filenames as command-line arguments, and uses `cut`, `sort`, and\n" -"> `uniq` to print a list of the unique species appearing in each of\n" -"> those files separately.\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > # Script to find unique species in csv files where species is the second data field\n" -"> > # This script accepts any number of file names as command line arguments\n" -"> >\n" -"> > # Loop over all files\n" -"> > for file in $@ \n" -"> > do\n" -"> > \techo \"Unique species in $file:\"\n" -"> > \t# Extract species names\n" -"> > \tcut -d , -f 2 $file | sort | uniq\n" -"> > done\n" -"> > ```\n" -"> > {: .source}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:315 -msgid "> ## Why Isn't It Doing Anything?" -msgstr "> ## Why Isn't It Doing Anything?" - -#: shell-novice/_episodes/06-script.md:316 -msgid "" -">\n" -"> What happens if a script is supposed to process a bunch of files, but we\n" -"> don't give it any filenames? For example, what if we type:\n" -">\n" -"> ~~~\n" -"> $ bash sorted.sh\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> but don't say `*.dat` (or anything else)? In this case, `$@` expands to\n" -"> nothing at all, so the pipeline inside the script is effectively:\n" -">\n" -"> ~~~\n" -"> $ wc -l | sort -n\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Since it doesn't have any filenames, `wc` assumes it is supposed to\n" -"> process standard input, so it just sits there and waits for us to give\n" -"> it some data interactively. From the outside, though, all we see is it\n" -"> sitting there: the script doesn't appear to do anything." -msgstr "" -">\n" -"> What happens if a script is supposed to process a bunch of files, but we\n" -"> don't give it any filenames? For example, what if we type:\n" -">\n" -"> ~~~\n" -"> $ bash sorted.sh\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> but don't say `*.dat` (or anything else)? In this case, `$@` expands to\n" -"> nothing at all, so the pipeline inside the script is effectively:\n" -">\n" -"> ~~~\n" -"> $ wc -l | sort -n\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Since it doesn't have any filenames, `wc` assumes it is supposed to\n" -"> process standard input, so it just sits there and waits for us to give\n" -"> it some data interactively. From the outside, though, all we see is it\n" -"> sitting there: the script doesn't appear to do anything." - -#: shell-novice/_episodes/06-script.md:340 -msgid "" -"Suppose we have just run a series of commands that did something useful --- for example,\n" -"that created a graph we'd like to use in a paper.\n" -"We'd like to be able to re-create the graph later if we need to,\n" -"so we want to save the commands in a file.\n" -"Instead of typing them in again\n" -"(and potentially getting them wrong)\n" -"we can do this:" -msgstr "" -"Suppose we have just run a series of commands that did something useful --- for example,\n" -"that created a graph we'd like to use in a paper.\n" -"We'd like to be able to re-create the graph later if we need to,\n" -"so we want to save the commands in a file.\n" -"Instead of typing them in again\n" -"(and potentially getting them wrong)\n" -"we can do this:" - -# code block -#: shell-novice/_episodes/06-script.md:348 -msgid "" -"~~~\n" -"$ history | tail -n 5 > redo-figure-3.sh\n" -"~~~" -msgstr "" -"~~~\n" -"$ history | tail -n 5 > redo-figure-3.sh\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:353 -msgid "The file `redo-figure-3.sh` now contains:" -msgstr "The file `redo-figure-3.sh` now contains:" - -# code block -#: shell-novice/_episodes/06-script.md:355 -msgid "" -"~~~\n" -"297 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" -"298 bash goodiff stats-NENE01729B.txt /data/validated/01729.txt > 01729-differences.txt\n" -"299 cut -d ',' -f 2-3 01729-differences.txt > 01729-time-series.txt\n" -"300 ygraph --format scatter --color bw --borders none 01729-time-series.txt figure-3.png\n" -"301 history | tail -n 5 > redo-figure-3.sh\n" -"~~~" -msgstr "" -"~~~\n" -"297 bash goostats NENE01729B.txt stats-NENE01729B.txt\n" -"298 bash goodiff stats-NENE01729B.txt /data/validated/01729.txt > 01729-differences.txt\n" -"299 cut -d ',' -f 2-3 01729-differences.txt > 01729-time-series.txt\n" -"300 ygraph --format scatter --color bw --borders none 01729-time-series.txt figure-3.png\n" -"301 history | tail -n 5 > redo-figure-3.sh\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:364 -msgid "" -"After a moment's work in an editor to remove the serial numbers on the commands,\n" -"and to remove the final line where we called the `history` command,\n" -"we have a completely accurate record of how we created that figure." -msgstr "" -"After a moment's work in an editor to remove the serial numbers on the commands,\n" -"and to remove the final line where we called the `history` command,\n" -"we have a completely accurate record of how we created that figure." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:368 -msgid "> ## Why Record Commands in the History Before Running Them?" -msgstr "> ## Why Record Commands in the History Before Running Them?" - -#: shell-novice/_episodes/06-script.md:369 -msgid "" -">\n" -"> If you run the command:\n" -">\n" -"> ~~~\n" -"> $ history | tail -n 5 > recent.sh\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> the last command in the file is the `history` command itself, i.e.,\n" -"> the shell has added `history` to the command log before actually\n" -"> running it. In fact, the shell *always* adds commands to the log\n" -"> before running them. Why do you think it does this?\n" -">\n" -"> > ## Solution\n" -"> > If a command causes something to crash or hang, it might be useful\n" -"> > to know what that command was, in order to investigate the problem.\n" -"> > Were the command only be recorded after running it, we would not\n" -"> > have a record of the last command run in the event of a crash." -msgstr "" -">\n" -"> If you run the command:\n" -">\n" -"> ~~~\n" -"> $ history | tail -n 5 > recent.sh\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> the last command in the file is the `history` command itself, i.e.,\n" -"> the shell has added `history` to the command log before actually\n" -"> running it. In fact, the shell *always* adds commands to the log\n" -"> before running them. Why do you think it does this?\n" -">\n" -"> > ## Solution\n" -"> > If a command causes something to crash or hang, it might be useful\n" -"> > to know what that command was, in order to investigate the problem.\n" -"> > Were the command only be recorded after running it, we would not\n" -"> > have a record of the last command run in the event of a crash." - -#: shell-novice/_episodes/06-script.md:390 -msgid "" -"In practice, most people develop shell scripts by running commands at the shell prompt a few times\n" -"to make sure they're doing the right thing,\n" -"then saving them in a file for re-use.\n" -"This style of work allows people to recycle\n" -"what they discover about their data and their workflow with one call to `history`\n" -"and a bit of editing to clean up the output\n" -"and save it as a shell script." -msgstr "" -"In practice, most people develop shell scripts by running commands at the shell prompt a few times\n" -"to make sure they're doing the right thing,\n" -"then saving them in a file for re-use.\n" -"This style of work allows people to recycle\n" -"what they discover about their data and their workflow with one call to `history`\n" -"and a bit of editing to clean up the output\n" -"and save it as a shell script." - -# header -#: shell-novice/_episodes/06-script.md:398 -msgid "## Nelle's Pipeline: Creating a Script" -msgstr "## Nelle's Pipeline: Creating a Script" - -#: shell-novice/_episodes/06-script.md:400 -msgid "" -"Nelle's supervisor insisted that all her analytics must be reproducible. The easiest way to capture all the steps is in a script.\n" -"She runs the editor and writes the following:" -msgstr "" -"Nelle's supervisor insisted that all her analytics must be reproducible. The easiest way to capture all the steps is in a script.\n" -"She runs the editor and writes the following:" - -# code block -#: shell-novice/_episodes/06-script.md:403 -msgid "" -"~~~\n" -"# Calculate stats for data files.\n" -"for datafile in \"$@\"\n" -"do\n" -" echo $datafile\n" -" bash goostats $datafile stats-$datafile\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"# Calculate stats for data files.\n" -"for datafile in \"$@\"\n" -"do\n" -" echo $datafile\n" -" bash goostats $datafile stats-$datafile\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:413 -msgid "" -"She saves this in a file called `do-stats.sh`\n" -"so that she can now re-do the first stage of her analysis by typing:" -msgstr "" -"She saves this in a file called `do-stats.sh`\n" -"so that she can now re-do the first stage of her analysis by typing:" - -# code block -#: shell-novice/_episodes/06-script.md:416 -msgid "" -"~~~\n" -"$ bash do-stats.sh NENE*[AB].txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash do-stats.sh NENE*[AB].txt\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:421 -msgid "She can also do this:" -msgstr "She can also do this:" - -# code block -#: shell-novice/_episodes/06-script.md:423 -msgid "" -"~~~\n" -"$ bash do-stats.sh NENE*[AB].txt | wc -l\n" -"~~~" -msgstr "" -"~~~\n" -"$ bash do-stats.sh NENE*[AB].txt | wc -l\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:428 -msgid "" -"so that the output is just the number of files processed\n" -"rather than the names of the files that were processed." -msgstr "" -"so that the output is just the number of files processed\n" -"rather than the names of the files that were processed." - -#: shell-novice/_episodes/06-script.md:431 -msgid "" -"One thing to note about Nelle's script is that\n" -"it lets the person running it decide what files to process.\n" -"She could have written it as:" -msgstr "" -"One thing to note about Nelle's script is that\n" -"it lets the person running it decide what files to process.\n" -"She could have written it as:" - -# code block -#: shell-novice/_episodes/06-script.md:435 -msgid "" -"~~~\n" -"# Calculate stats for Site A and Site B data files.\n" -"for datafile in NENE*[AB].txt\n" -"do\n" -" echo $datafile\n" -" bash goostats $datafile stats-$datafile\n" -"done\n" -"~~~" -msgstr "" -"~~~\n" -"# Calculate stats for Site A and Site B data files.\n" -"for datafile in NENE*[AB].txt\n" -"do\n" -" echo $datafile\n" -" bash goostats $datafile stats-$datafile\n" -"done\n" -"~~~" - -#: shell-novice/_episodes/06-script.md:445 -msgid "" -"The advantage is that this always selects the right files:\n" -"she doesn't have to remember to exclude the 'Z' files.\n" -"The disadvantage is that it *always* selects just those files --- she can't run it on all files\n" -"(including the 'Z' files),\n" -"or on the 'G' or 'H' files her colleagues in Antarctica are producing,\n" -"without editing the script.\n" -"If she wanted to be more adventurous,\n" -"she could modify her script to check for command-line arguments,\n" -"and use `NENE*[AB].txt` if none were provided.\n" -"Of course, this introduces another tradeoff between flexibility and complexity." -msgstr "" -"The advantage is that this always selects the right files:\n" -"she doesn't have to remember to exclude the 'Z' files.\n" -"The disadvantage is that it *always* selects just those files --- she can't run it on all files\n" -"(including the 'Z' files),\n" -"or on the 'G' or 'H' files her colleagues in Antarctica are producing,\n" -"without editing the script.\n" -"If she wanted to be more adventurous,\n" -"she could modify her script to check for command-line arguments,\n" -"and use `NENE*[AB].txt` if none were provided.\n" -"Of course, this introduces another tradeoff between flexibility and complexity." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:456 -msgid "> ## Variables in Shell Scripts" -msgstr "> ## Variables in Shell Scripts" - -#: shell-novice/_episodes/06-script.md:457 -msgid "" -">\n" -"> In the `molecules` directory, imagine you have a shell script called `script.sh` containing the\n" -"> following commands:\n" -">\n" -"> ~~~\n" -"> head -n $2 $1\n" -"> tail -n $3 $1\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> While you are in the `molecules` directory, you type the following command:\n" -">\n" -"> ~~~\n" -"> bash script.sh '*.pdb' 1 1\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Which of the following outputs would you expect to see?\n" -">\n" -"> 1. All of the lines between the first and the last lines of each file ending in `.pdb`\n" -"> in the `molecules` directory\n" -"> 2. The first and the last line of each file ending in `.pdb` in the `molecules` directory\n" -"> 3. The first and the last line of each file in the `molecules` directory\n" -"> 4. An error because of the quotes around `*.pdb`\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 2. \n" -"> >\n" -"> > The special variables $1, $2 and $3 represent the command line arguments given to the\n" -"> > script, such that the commands run are:\n" -"> >\n" -"> > ```\n" -"> > $ head -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > $ tail -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > The shell does not expand `'*.pdb'` because it is enclosed by quote marks.\n" -"> > As such, the first argument to the script is `'*.pdb'` which gets expanded within the\n" -"> > script by `head` and `tail`." -msgstr "" -">\n" -"> In the `molecules` directory, imagine you have a shell script called `script.sh` containing the\n" -"> following commands:\n" -">\n" -"> ~~~\n" -"> head -n $2 $1\n" -"> tail -n $3 $1\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> While you are in the `molecules` directory, you type the following command:\n" -">\n" -"> ~~~\n" -"> bash script.sh '*.pdb' 1 1\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Which of the following outputs would you expect to see?\n" -">\n" -"> 1. All of the lines between the first and the last lines of each file ending in `.pdb`\n" -"> in the `molecules` directory\n" -"> 2. The first and the last line of each file ending in `.pdb` in the `molecules` directory\n" -"> 3. The first and the last line of each file in the `molecules` directory\n" -"> 4. An error because of the quotes around `*.pdb`\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 2. \n" -"> >\n" -"> > The special variables $1, $2 and $3 represent the command line arguments given to the\n" -"> > script, such that the commands run are:\n" -"> >\n" -"> > ```\n" -"> > $ head -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > $ tail -n 1 cubane.pdb ethane.pdb octane.pdb pentane.pdb propane.pdb\n" -"> > ```\n" -"> > {: .language-bash}\n" -"> > The shell does not expand `'*.pdb'` because it is enclosed by quote marks.\n" -"> > As such, the first argument to the script is `'*.pdb'` which gets expanded within the\n" -"> > script by `head` and `tail`." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:499 -msgid "> ## Find the Longest File With a Given Extension" -msgstr "> ## Find the Longest File With a Given Extension" - -#: shell-novice/_episodes/06-script.md:500 -msgid "" -">\n" -"> Write a shell script called `longest.sh` that takes the name of a\n" -"> directory and a filename extension as its arguments, and prints\n" -"> out the name of the file with the most lines in that directory\n" -"> with that extension. For example:\n" -">\n" -"> ~~~\n" -"> $ bash longest.sh /tmp/data pdb\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> would print the name of the `.pdb` file in `/tmp/data` that has\n" -"> the most lines.\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > # Shell script which takes two arguments: \n" -"> > # 1. a directory name\n" -"> > # 2. a file extension\n" -"> > # and prints the name of the file in that directory\n" -"> > # with the most lines which matches the file extension.\n" -"> > \n" -"> > wc -l $1/*.$2 | sort -n | tail -n 2 | head -n 1\n" -"> > ```\n" -"> > {: .source}" -msgstr "" -">\n" -"> Write a shell script called `longest.sh` that takes the name of a\n" -"> directory and a filename extension as its arguments, and prints\n" -"> out the name of the file with the most lines in that directory\n" -"> with that extension. For example:\n" -">\n" -"> ~~~\n" -"> $ bash longest.sh /tmp/data pdb\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> would print the name of the `.pdb` file in `/tmp/data` that has\n" -"> the most lines.\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > # Shell script which takes two arguments: \n" -"> > # 1. a directory name\n" -"> > # 2. a file extension\n" -"> > # and prints the name of the file in that directory\n" -"> > # with the most lines which matches the file extension.\n" -"> > \n" -"> > wc -l $1/*.$2 | sort -n | tail -n 2 | head -n 1\n" -"> > ```\n" -"> > {: .source}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:529 -msgid "> ## Script Reading Comprehension" -msgstr "> ## Script Reading Comprehension" - -#: shell-novice/_episodes/06-script.md:530 -msgid "" -">\n" -"> For this question, consider the `data-shell/molecules` directory once again.\n" -"> This contains a number of `.pdb` files in addition to any other files you\n" -"> may have created.\n" -"> Explain what a script called `example.sh` would do when run as\n" -"> `bash example.sh *.pdb` if it contained the following lines:\n" -">\n" -"> ~~~\n" -"> # Script 1\n" -"> echo *.*\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Script 2\n" -"> for filename in $1 $2 $3\n" -"> do\n" -"> cat $filename\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Script 3\n" -"> echo $@.pdb\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solutions\n" -"> > Script 1 would print out a list of all files containing a dot in their name.\n" -"> >\n" -"> > Script 2 would print the contents of the first 3 files matching the file extension.\n" -"> > The shell expands the wildcard before passing the arguments to the `example.sh` script.\n" -"> > \n" -"> > Script 3 would print all the arguments to the script (i.e. all the `.pdb` files),\n" -"> > followed by `.pdb`.\n" -"> > ```\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb.pdb\n" -"> > ```\n" -"> > {: .output}" -msgstr "" -">\n" -"> For this question, consider the `data-shell/molecules` directory once again.\n" -"> This contains a number of `.pdb` files in addition to any other files you\n" -"> may have created.\n" -"> Explain what a script called `example.sh` would do when run as\n" -"> `bash example.sh *.pdb` if it contained the following lines:\n" -">\n" -"> ~~~\n" -"> # Script 1\n" -"> echo *.*\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Script 2\n" -"> for filename in $1 $2 $3\n" -"> do\n" -"> cat $filename\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> # Script 3\n" -"> echo $@.pdb\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solutions\n" -"> > Script 1 would print out a list of all files containing a dot in their name.\n" -"> >\n" -"> > Script 2 would print the contents of the first 3 files matching the file extension.\n" -"> > The shell expands the wildcard before passing the arguments to the `example.sh` script.\n" -"> > \n" -"> > Script 3 would print all the arguments to the script (i.e. all the `.pdb` files),\n" -"> > followed by `.pdb`.\n" -"> > ```\n" -"> > cubane.pdb ethane.pdb methane.pdb octane.pdb pentane.pdb propane.pdb.pdb\n" -"> > ```\n" -"> > {: .output}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/06-script.md:573 -msgid "> ## Debugging Scripts" -msgstr "> ## Debugging Scripts" - -#: shell-novice/_episodes/06-script.md:574 -msgid "" -">\n" -"> Suppose you have saved the following script in a file called `do-errors.sh`\n" -"> in Nelle's `north-pacific-gyre/2012-07-03` directory:\n" -">\n" -"> ~~~\n" -"> # Calculate stats for data files.\n" -"> for datafile in \"$@\"\n" -"> do\n" -"> echo $datfile\n" -"> bash goostats $datafile stats-$datafile\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> When you run it:\n" -">\n" -"> ~~~\n" -"> $ bash do-errors.sh NENE*[AB].txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> the output is blank.\n" -"> To figure out why, re-run the script using the `-x` option:\n" -">\n" -"> ~~~\n" -"> bash -x do-errors.sh NENE*[AB].txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> What is the output showing you?\n" -"> Which line is responsible for the error?\n" -">\n" -"> > ## Solution\n" -"> > The `-x` flag causes `bash` to run in debug mode.\n" -"> > This prints out each command as it is run, which will help you to locate errors.\n" -"> > In this example, we can see that `echo` isn't printing anything. We have made a typo\n" -"> > in the loop variable name, and the variable `datfile` doesn't exist, hence returning\n" -"> > an empty string." -msgstr "" -">\n" -"> Suppose you have saved the following script in a file called `do-errors.sh`\n" -"> in Nelle's `north-pacific-gyre/2012-07-03` directory:\n" -">\n" -"> ~~~\n" -"> # Calculate stats for data files.\n" -"> for datafile in \"$@\"\n" -"> do\n" -"> echo $datfile\n" -"> bash goostats $datafile stats-$datafile\n" -"> done\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> When you run it:\n" -">\n" -"> ~~~\n" -"> $ bash do-errors.sh NENE*[AB].txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> the output is blank.\n" -"> To figure out why, re-run the script using the `-x` option:\n" -">\n" -"> ~~~\n" -"> bash -x do-errors.sh NENE*[AB].txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> What is the output showing you?\n" -"> Which line is responsible for the error?\n" -">\n" -"> > ## Solution\n" -"> > The `-x` flag causes `bash` to run in debug mode.\n" -"> > This prints out each command as it is run, which will help you to locate errors.\n" -"> > In this example, we can see that `echo` isn't printing anything. We have made a typo\n" -"> > in the loop variable name, and the variable `datfile` doesn't exist, hence returning\n" -"> > an empty string." - -# Front Matter -#: shell-novice/_episodes/07-find.md:1 -msgid "" -"---\n" -"title: \"Finding Things\"\n" -"teaching: 25\n" -"exercises: 20\n" -"questions:\n" -"- \"How can I find files?\"\n" -"- \"How can I find things in files?\"\n" -"objectives:\n" -"- \"Use `grep` to select lines from text files that match simple patterns.\"\n" -"- \"Use `find` to find files whose names match simple patterns.\"\n" -"- \"Use the output of one command as the command-line argument(s) to another command.\"\n" -"- \"Explain what is meant by 'text' and 'binary' files, and why many common tools don't handle the latter well.\"\n" -"keypoints:\n" -"- \"`find` finds files with specific properties that match patterns.\"\n" -"- \"`grep` selects lines in files that match patterns.\"\n" -"- \"`--help` is a flag supported by many bash commands, and programs that can be run from within Bash, to display more information on how to use these commands or programs.\"\n" -"- \"`man command` displays the manual page for a given command.\"\n" -"- \"`$(command)` inserts a command's output in place.\"\n" -"---" -msgstr "" -"---\n" -"title: \"Finding Things\"\n" -"teaching: 25\n" -"exercises: 20\n" -"questions:\n" -"- \"How can I find files?\"\n" -"- \"How can I find things in files?\"\n" -"objectives:\n" -"- \"Use `grep` to select lines from text files that match simple patterns.\"\n" -"- \"Use `find` to find files whose names match simple patterns.\"\n" -"- \"Use the output of one command as the command-line argument(s) to another command.\"\n" -"- \"Explain what is meant by 'text' and 'binary' files, and why many common tools don't handle the latter well.\"\n" -"keypoints:\n" -"- \"`find` finds files with specific properties that match patterns.\"\n" -"- \"`grep` selects lines in files that match patterns.\"\n" -"- \"`--help` is a flag supported by many bash commands, and programs that can be run from within Bash, to display more information on how to use these commands or programs.\"\n" -"- \"`man command` displays the manual page for a given command.\"\n" -"- \"`$(command)` inserts a command's output in place.\"\n" -"---" - -#: shell-novice/_episodes/07-find.md:21 -msgid "" -"In the same way that many of us now use \"Google\" as a \n" -"verb meaning \"to find\", Unix programmers often use the \n" -"word \"grep\".\n" -"\"grep\" is a contraction of \"global/regular expression/print\",\n" -"a common sequence of operations in early Unix text editors.\n" -"It is also the name of a very useful command-line program." -msgstr "" -"In the same way that many of us now use \"Google\" as a \n" -"verb meaning \"to find\", Unix programmers often use the \n" -"word \"grep\".\n" -"\"grep\" is a contraction of \"global/regular expression/print\",\n" -"a common sequence of operations in early Unix text editors.\n" -"It is also the name of a very useful command-line program." - -#: shell-novice/_episodes/07-find.md:28 -msgid "" -"`grep` finds and prints lines in files that match a pattern.\n" -"For our examples,\n" -"we will use a file that contains three haikus taken from a\n" -"1998 competition in *Salon* magazine. For this set of examples,\n" -"we're going to be working in the writing subdirectory:" -msgstr "" -"`grep` finds and prints lines in files that match a pattern.\n" -"For our examples,\n" -"we will use a file that contains three haikus taken from a\n" -"1998 competition in *Salon* magazine. For this set of examples,\n" -"we're going to be working in the writing subdirectory:" - -# code block -#: shell-novice/_episodes/07-find.md:34 -msgid "" -"~~~\n" -"$ cd\n" -"$ cd Desktop/data-shell/writing\n" -"$ cat haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ cd\n" -"$ cd Desktop/data-shell/writing\n" -"$ cat haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:41 -msgid "" -"~~~\n" -"The Tao that is seen\n" -"Is not the true Tao, until\n" -"You bring fresh toner.\n" -"\n" -"With searching comes loss\n" -"and the presence of absence:\n" -"\"My Thesis\" not found.\n" -"\n" -"Yesterday it worked\n" -"Today it is not working\n" -"Software is like that.\n" -"~~~" -msgstr "" -"~~~\n" -"The Tao that is seen\n" -"Is not the true Tao, until\n" -"You bring fresh toner.\n" -"\n" -"With searching comes loss\n" -"and the presence of absence:\n" -"\"My Thesis\" not found.\n" -"\n" -"Yesterday it worked\n" -"Today it is not working\n" -"Software is like that.\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:56 -msgid "> ## Forever, or Five Years" -msgstr "> ## Forever, or Five Years" - -#: shell-novice/_episodes/07-find.md:57 -msgid "" -">\n" -"> We haven't linked to the original haikus because they don't appear to be on *Salon*'s site any longer.\n" -"> As [Jeff Rothenberg said](http://www.clir.org/pubs/archives/ensuring.pdf),\n" -"> \"Digital information lasts forever --- or five years, whichever comes first.\"\n" -"> Luckily, popular content often [has backups](http://wiki.c2.com/?ComputerErrorHaiku)." -msgstr "" -">\n" -"> We haven't linked to the original haikus because they don't appear to be on *Salon*'s site any longer.\n" -"> As [Jeff Rothenberg said](http://www.clir.org/pubs/archives/ensuring.pdf),\n" -"> \"Digital information lasts forever --- or five years, whichever comes first.\"\n" -"> Luckily, popular content often [has backups](http://wiki.c2.com/?ComputerErrorHaiku)." - -#: shell-novice/_episodes/07-find.md:64 -msgid "Let's find lines that contain the word \"not\":" -msgstr "Let's find lines that contain the word \"not\":" - -# code block -#: shell-novice/_episodes/07-find.md:66 -msgid "" -"~~~\n" -"$ grep not haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep not haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:71 -msgid "" -"~~~\n" -"Is not the true Tao, until\n" -"\"My Thesis\" not found\n" -"Today it is not working\n" -"~~~" -msgstr "" -"~~~\n" -"Is not the true Tao, until\n" -"\"My Thesis\" not found\n" -"Today it is not working\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:78 -msgid "Here, `not` is the pattern we're searching for. The grep command searches through the file, looking for matches to the pattern specified. To use it type `grep`, then the pattern we're searching for and finally the name of the file (or files) we're searching in." -msgstr "Here, `not` is the pattern we're searching for. The grep command searches through the file, looking for matches to the pattern specified. To use it type `grep`, then the pattern we're searching for and finally the name of the file (or files) we're searching in." - -#: shell-novice/_episodes/07-find.md:80 -msgid "The output is the three lines in the file that contain the letters \"not\"." -msgstr "The output is the three lines in the file that contain the letters \"not\"." - -#: shell-novice/_episodes/07-find.md:82 -msgid "Let's try a different pattern: \"The\"." -msgstr "Let's try a different pattern: \"The\"." - -# code block -#: shell-novice/_episodes/07-find.md:84 -msgid "" -"~~~\n" -"$ grep The haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep The haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:89 -msgid "" -"~~~\n" -"The Tao that is seen\n" -"\"My Thesis\" not found.\n" -"~~~" -msgstr "" -"~~~\n" -"The Tao that is seen\n" -"\"My Thesis\" not found.\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:95 -msgid "" -"This time,\n" -"two lines that include the letters \"The\" are outputted.\n" -"However, one instance of those letters is contained within a larger word,\n" -"\"Thesis\"." -msgstr "" -"This time,\n" -"two lines that include the letters \"The\" are outputted.\n" -"However, one instance of those letters is contained within a larger word,\n" -"\"Thesis\"." - -#: shell-novice/_episodes/07-find.md:100 -msgid "" -"To restrict matches to lines containing the word \"The\" on its own,\n" -"we can give `grep` with the `-w` flag.\n" -"This will limit matches to word boundaries." -msgstr "" -"To restrict matches to lines containing the word \"The\" on its own,\n" -"we can give `grep` with the `-w` flag.\n" -"This will limit matches to word boundaries." - -# code block -#: shell-novice/_episodes/07-find.md:104 -msgid "" -"~~~\n" -"$ grep -w The haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -w The haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:109 -msgid "" -"~~~\n" -"The Tao that is seen\n" -"~~~" -msgstr "" -"~~~\n" -"The Tao that is seen\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:114 -msgid "" -"Note that a \"word boundary\" includes the start and end of a line, so not\n" -"just letters surrounded by spaces. \n" -"Sometimes we don't\n" -"want to search for a single word, but a phrase. This is also easy to do with\n" -"`grep` by putting the phrase in quotes." -msgstr "" -"Note that a \"word boundary\" includes the start and end of a line, so not\n" -"just letters surrounded by spaces. \n" -"Sometimes we don't\n" -"want to search for a single word, but a phrase. This is also easy to do with\n" -"`grep` by putting the phrase in quotes." - -# code block -#: shell-novice/_episodes/07-find.md:120 -msgid "" -"~~~\n" -"$ grep -w \"is not\" haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -w \"is not\" haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:125 -msgid "" -"~~~\n" -"Today it is not working\n" -"~~~" -msgstr "" -"~~~\n" -"Today it is not working\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:130 -msgid "" -"We've now seen that you don't have to have quotes around single words,\n" -"but it is useful to use quotes when searching for multiple words.\n" -"It also helps to make it easier to distinguish between the search term or phrase\n" -"and the file being searched.\n" -"We will use quotes in the remaining examples." -msgstr "" -"We've now seen that you don't have to have quotes around single words,\n" -"but it is useful to use quotes when searching for multiple words.\n" -"It also helps to make it easier to distinguish between the search term or phrase\n" -"and the file being searched.\n" -"We will use quotes in the remaining examples." - -#: shell-novice/_episodes/07-find.md:136 -msgid "Another useful option is `-n`, which numbers the lines that match:" -msgstr "Another useful option is `-n`, which numbers the lines that match:" - -# code block -#: shell-novice/_episodes/07-find.md:138 -msgid "" -"~~~\n" -"$ grep -n \"it\" haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -n \"it\" haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:143 -msgid "" -"~~~\n" -"5:With searching comes loss\n" -"9:Yesterday it worked\n" -"10:Today it is not working\n" -"~~~" -msgstr "" -"~~~\n" -"5:With searching comes loss\n" -"9:Yesterday it worked\n" -"10:Today it is not working\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:150 -msgid "Here, we can see that lines 5, 9, and 10 contain the letters \"it\"." -msgstr "Here, we can see that lines 5, 9, and 10 contain the letters \"it\"." - -#: shell-novice/_episodes/07-find.md:152 -msgid "" -"We can combine options (i.e. flags) as we do with other Unix commands.\n" -"For example, let's find the lines that contain the word \"the\". We can combine\n" -"the option `-w` to find the lines that contain the word \"the\" and `-n` to number the lines that match:" -msgstr "" -"We can combine options (i.e. flags) as we do with other Unix commands.\n" -"For example, let's find the lines that contain the word \"the\". We can combine\n" -"the option `-w` to find the lines that contain the word \"the\" and `-n` to number the lines that match:" - -# code block -#: shell-novice/_episodes/07-find.md:156 -msgid "" -"~~~\n" -"$ grep -n -w \"the\" haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -n -w \"the\" haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:161 -msgid "" -"~~~\n" -"2:Is not the true Tao, until\n" -"6:and the presence of absence:\n" -"~~~" -msgstr "" -"~~~\n" -"2:Is not the true Tao, until\n" -"6:and the presence of absence:\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:167 -msgid "Now we want to use the option `-i` to make our search case-insensitive:" -msgstr "Now we want to use the option `-i` to make our search case-insensitive:" - -# code block -#: shell-novice/_episodes/07-find.md:169 -msgid "" -"~~~\n" -"$ grep -n -w -i \"the\" haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -n -w -i \"the\" haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:174 -msgid "" -"~~~\n" -"1:The Tao that is seen\n" -"2:Is not the true Tao, until\n" -"6:and the presence of absence:\n" -"~~~" -msgstr "" -"~~~\n" -"1:The Tao that is seen\n" -"2:Is not the true Tao, until\n" -"6:and the presence of absence:\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:181 -msgid "" -"Now, we want to use the option `-v` to invert our search, i.e., we want to output\n" -"the lines that do not contain the word \"the\"." -msgstr "" -"Now, we want to use the option `-v` to invert our search, i.e., we want to output\n" -"the lines that do not contain the word \"the\"." - -# code block -#: shell-novice/_episodes/07-find.md:184 -msgid "" -"~~~\n" -"$ grep -n -w -v \"the\" haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep -n -w -v \"the\" haiku.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:189 -msgid "" -"~~~\n" -"1:The Tao that is seen\n" -"3:You bring fresh toner.\n" -"4:\n" -"5:With searching comes loss\n" -"7:\"My Thesis\" not found.\n" -"8:\n" -"9:Yesterday it worked\n" -"10:Today it is not working\n" -"11:Software is like that.\n" -"~~~" -msgstr "" -"~~~\n" -"1:The Tao that is seen\n" -"3:You bring fresh toner.\n" -"4:\n" -"5:With searching comes loss\n" -"7:\"My Thesis\" not found.\n" -"8:\n" -"9:Yesterday it worked\n" -"10:Today it is not working\n" -"11:Software is like that.\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:202 -msgid "`grep` has lots of other options. To find out what they are, we can type:" -msgstr "`grep` has lots of other options. To find out what they are, we can type:" - -# code block -#: shell-novice/_episodes/07-find.md:204 -msgid "" -"~~~\n" -"$ grep --help\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep --help\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:209 -msgid "" -"~~~\n" -"Usage: grep [OPTION]... PATTERN [FILE]...\n" -"Search for PATTERN in each FILE or standard input.\n" -"PATTERN is, by default, a basic regular expression (BRE).\n" -"Example: grep -i 'hello world' menu.h main.c\n" -"\n" -"Regexp selection and interpretation:\n" -" -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n" -" -F, --fixed-strings PATTERN is a set of newline-separated fixed strings\n" -" -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n" -" -P, --perl-regexp PATTERN is a Perl regular expression\n" -" -e, --regexp=PATTERN use PATTERN for matching\n" -" -f, --file=FILE obtain PATTERN from FILE\n" -" -i, --ignore-case ignore case distinctions\n" -" -w, --word-regexp force PATTERN to match only whole words\n" -" -x, --line-regexp force PATTERN to match only whole lines\n" -" -z, --null-data a data line ends in 0 byte, not newline\n" -"\n" -"Miscellaneous:\n" -"... ... ...\n" -"~~~" -msgstr "" -"~~~\n" -"Usage: grep [OPTION]... PATTERN [FILE]...\n" -"Search for PATTERN in each FILE or standard input.\n" -"PATTERN is, by default, a basic regular expression (BRE).\n" -"Example: grep -i 'hello world' menu.h main.c\n" -"\n" -"Regexp selection and interpretation:\n" -" -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n" -" -F, --fixed-strings PATTERN is a set of newline-separated fixed strings\n" -" -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n" -" -P, --perl-regexp PATTERN is a Perl regular expression\n" -" -e, --regexp=PATTERN use PATTERN for matching\n" -" -f, --file=FILE obtain PATTERN from FILE\n" -" -i, --ignore-case ignore case distinctions\n" -" -w, --word-regexp force PATTERN to match only whole words\n" -" -x, --line-regexp force PATTERN to match only whole lines\n" -" -z, --null-data a data line ends in 0 byte, not newline\n" -"\n" -"Miscellaneous:\n" -"... ... ...\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:232 -msgid "> ## Using `grep`" -msgstr "> ## Using `grep`" - -#: shell-novice/_episodes/07-find.md:233 -msgid "" -">\n" -"> Which command would result in the following output:\n" -">\n" -"> ~~~\n" -"> and the presence of absence:\n" -"> ~~~" -msgstr "" -">\n" -"> Which command would result in the following output:\n" -">\n" -"> ~~~\n" -"> and the presence of absence:\n" -"> ~~~" - -#: shell-novice/_episodes/07-find.md:240 -msgid "" -">\n" -"> 1. `grep \"of\" haiku.txt`\n" -"> 2. `grep -E \"of\" haiku.txt`\n" -"> 3. `grep -w \"of\" haiku.txt`\n" -"> 4. `grep -i \"of\" haiku.txt`\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 3, because the `-w` flag looks only for whole-word matches.\n" -"> > The other options will all match \"of\" when part of another word." -msgstr "" -">\n" -"> 1. `grep \"of\" haiku.txt`\n" -"> 2. `grep -E \"of\" haiku.txt`\n" -"> 3. `grep -w \"of\" haiku.txt`\n" -"> 4. `grep -i \"of\" haiku.txt`\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 3, because the `-w` flag looks only for whole-word matches.\n" -"> > The other options will all match \"of\" when part of another word." - -#: shell-novice/_episodes/07-find.md:253 -msgid "" -">\n" -"> `grep`'s real power doesn't come from its options, though; it comes from\n" -"> the fact that patterns can include wildcards. (The technical name for\n" -"> these is **regular expressions**, which\n" -"> is what the \"re\" in \"grep\" stands for.) Regular expressions are both complex\n" -"> and powerful; if you want to do complex searches, please look at the lesson\n" -"> on [our website](http://v4.software-carpentry.org/regexp/index.html). As a taster, we can\n" -"> find lines that have an 'o' in the second position like this:\n" -">\n" -"> ~~~\n" -"> $ grep -E '^.o' haiku.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> You bring fresh toner.\n" -"> Today it is not working\n" -"> Software is like that.\n" -"> ~~~" -msgstr "" -">\n" -"> `grep`'s real power doesn't come from its options, though; it comes from\n" -"> the fact that patterns can include wildcards. (The technical name for\n" -"> these is **regular expressions**, which\n" -"> is what the \"re\" in \"grep\" stands for.) Regular expressions are both complex\n" -"> and powerful; if you want to do complex searches, please look at the lesson\n" -"> on [our website](http://v4.software-carpentry.org/regexp/index.html). As a taster, we can\n" -"> find lines that have an 'o' in the second position like this:\n" -">\n" -"> ~~~\n" -"> $ grep -E '^.o' haiku.txt\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> ~~~\n" -"> You bring fresh toner.\n" -"> Today it is not working\n" -"> Software is like that.\n" -"> ~~~" - -#: shell-novice/_episodes/07-find.md:273 -msgid "" -">\n" -"> We use the `-E` flag and put the pattern in quotes to prevent the shell\n" -"> from trying to interpret it. (If the pattern contained a `*`, for\n" -"> example, the shell would try to expand it before running `grep`.) The\n" -"> `^` in the pattern anchors the match to the start of the line. The `.`\n" -"> matches a single character (just like `?` in the shell), while the `o`\n" -"> matches an actual 'o'." -msgstr "" -">\n" -"> We use the `-E` flag and put the pattern in quotes to prevent the shell\n" -"> from trying to interpret it. (If the pattern contained a `*`, for\n" -"> example, the shell would try to expand it before running `grep`.) The\n" -"> `^` in the pattern anchors the match to the start of the line. The `.`\n" -"> matches a single character (just like `?` in the shell), while the `o`\n" -"> matches an actual 'o'." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:282 -msgid "> ## Tracking a Species" -msgstr "> ## Tracking a Species" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:284 -msgid "> Leah has several hundred " -msgstr "> Leah has several hundred " - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:285 -msgid "> data files saved in one directory, each of which is formatted like this:" -msgstr "> data files saved in one directory, each of which is formatted like this:" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:288 -msgid "> 2013-11-05,deer,5" -msgstr "> 2013-11-05,deer,5" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:289 -msgid "> 2013-11-05,rabbit,22" -msgstr "> 2013-11-05,rabbit,22" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:290 -msgid "> 2013-11-05,raccoon,7" -msgstr "> 2013-11-05,raccoon,7" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:291 -msgid "> 2013-11-06,rabbit,19" -msgstr "> 2013-11-06,rabbit,19" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:292 -msgid "> 2013-11-06,deer,2" -msgstr "> 2013-11-06,deer,2" - -#: shell-novice/_episodes/07-find.md:295 -msgid "" -">\n" -"> She wants to write a shell script that takes a species as the first command-line argument \n" -"> and a directory as the second argument. The script should return one file called `species.txt` \n" -"> containing a list of dates and the number of that species seen on each date.\n" -"> For example using the data shown above, `rabbits.txt` would contain:\n" -"> \n" -"> ~~~\n" -"> 2013-11-05,22\n" -"> 2013-11-06,19\n" -"> ~~~" -msgstr "" -">\n" -"> She wants to write a shell script that takes a species as the first command-line argument \n" -"> and a directory as the second argument. The script should return one file called `species.txt` \n" -"> containing a list of dates and the number of that species seen on each date.\n" -"> For example using the data shown above, `rabbits.txt` would contain:\n" -"> \n" -"> ~~~\n" -"> 2013-11-05,22\n" -"> 2013-11-06,19\n" -"> ~~~" - -#: shell-novice/_episodes/07-find.md:306 -msgid "" -">\n" -"> Put these commands and pipes in the right order to achieve this:\n" -"> \n" -"> ~~~\n" -"> cut -d : -f 2 \n" -"> > \n" -"> | \n" -"> grep -w $1 -r $2 \n" -"> | \n" -"> $1.txt \n" -"> cut -d , -f 1,3 \n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Hint: use `man grep` to look for how to grep text recursively in a directory\n" -"> and `man cut` to select more than one field in a line.\n" -">\n" -"> An example of such a file is provided in `data-shell/data/animal-counts/animals.txt`\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > You would call the script above like this:\n" -"> >\n" -"> > ```\n" -"> > $ bash count-species.sh bear .\n" -"> > ```\n" -"> > {: .language-bash}" -msgstr "" -">\n" -"> Put these commands and pipes in the right order to achieve this:\n" -"> \n" -"> ~~~\n" -"> cut -d : -f 2 \n" -"> > \n" -"> | \n" -"> grep -w $1 -r $2 \n" -"> | \n" -"> $1.txt \n" -"> cut -d , -f 1,3 \n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> Hint: use `man grep` to look for how to grep text recursively in a directory\n" -"> and `man cut` to select more than one field in a line.\n" -">\n" -"> An example of such a file is provided in `data-shell/data/animal-counts/animals.txt`\n" -">\n" -"> > ## Solution\n" -"> >\n" -"> > ```\n" -"> > grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > You would call the script above like this:\n" -"> >\n" -"> > ```\n" -"> > $ bash count-species.sh bear .\n" -"> > ```\n" -"> > {: .language-bash}" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:341 -msgid "> ## Little Women" -msgstr "> ## Little Women" - -#: shell-novice/_episodes/07-find.md:342 -msgid "" -">\n" -"> You and your friend, having just finished reading *Little Women* by\n" -"> Louisa May Alcott, are in an argument. Of the four sisters in the\n" -"> book, Jo, Meg, Beth, and Amy, your friend thinks that Jo was the\n" -"> most mentioned. You, however, are certain it was Amy. Luckily, you\n" -"> have a file `LittleWomen.txt` containing the full text of the novel\n" -"> (`data-shell/writing/data/LittleWomen.txt`).\n" -"> Using a `for` loop, how would you tabulate the number of times each\n" -"> of the four sisters is mentioned?\n" -">\n" -"> Hint: one solution might employ\n" -"> the commands `grep` and `wc` and a `|`, while another might utilize\n" -"> `grep` options.\n" -"> There is often more than one way to solve a programming task, so a\n" -"> particular solution is usually chosen based on a combination of\n" -"> yielding the correct result, elegance, readability, and speed.\n" -">\n" -"> > ## Solutions\n" -"> > ```\n" -"> > for sis in Jo Meg Beth Amy\n" -"> > do\n" -"> > \techo $sis:\n" -"> >\tgrep -ow $sis LittleWomen.txt | wc -l\n" -"> > done\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > Alternative, slightly inferior solution:\n" -"> > ```\n" -"> > for sis in Jo Meg Beth Amy\n" -"> > do\n" -"> > \techo $sis:\n" -"> >\tgrep -ocw $sis LittleWomen.txt\n" -"> > done\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > This solution is inferior because `grep -c` only reports the number of lines matched.\n" -"> > The total number of matches reported by this method will be lower if there is more\n" -"> > than one match per line." -msgstr "" -">\n" -"> You and your friend, having just finished reading *Little Women* by\n" -"> Louisa May Alcott, are in an argument. Of the four sisters in the\n" -"> book, Jo, Meg, Beth, and Amy, your friend thinks that Jo was the\n" -"> most mentioned. You, however, are certain it was Amy. Luckily, you\n" -"> have a file `LittleWomen.txt` containing the full text of the novel\n" -"> (`data-shell/writing/data/LittleWomen.txt`).\n" -"> Using a `for` loop, how would you tabulate the number of times each\n" -"> of the four sisters is mentioned?\n" -">\n" -"> Hint: one solution might employ\n" -"> the commands `grep` and `wc` and a `|`, while another might utilize\n" -"> `grep` options.\n" -"> There is often more than one way to solve a programming task, so a\n" -"> particular solution is usually chosen based on a combination of\n" -"> yielding the correct result, elegance, readability, and speed.\n" -">\n" -"> > ## Solutions\n" -"> > ```\n" -"> > for sis in Jo Meg Beth Amy\n" -"> > do\n" -"> > \techo $sis:\n" -"> >\tgrep -ow $sis LittleWomen.txt | wc -l\n" -"> > done\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > Alternative, slightly inferior solution:\n" -"> > ```\n" -"> > for sis in Jo Meg Beth Amy\n" -"> > do\n" -"> > \techo $sis:\n" -"> >\tgrep -ocw $sis LittleWomen.txt\n" -"> > done\n" -"> > ```\n" -"> > {: .source}\n" -"> >\n" -"> > This solution is inferior because `grep -c` only reports the number of lines matched.\n" -"> > The total number of matches reported by this method will be lower if there is more\n" -"> > than one match per line." - -#: shell-novice/_episodes/07-find.md:385 -msgid "" -"While `grep` finds lines in files,\n" -"the `find` command finds files themselves.\n" -"Again,\n" -"it has a lot of options;\n" -"to show how the simplest ones work, we'll use the directory tree shown below." -msgstr "" -"While `grep` finds lines in files,\n" -"the `find` command finds files themselves.\n" -"Again,\n" -"it has a lot of options;\n" -"to show how the simplest ones work, we'll use the directory tree shown below." - -#: shell-novice/_episodes/07-find.md:391 -msgid "![File Tree for Find Example](../fig/find-file-tree.svg)" -msgstr "![File Tree for Find Example](../fig/find-file-tree.svg)" - -#: shell-novice/_episodes/07-find.md:393 -msgid "" -"Nelle's `writing` directory contains one file called `haiku.txt` and three subdirectories:\n" -"`thesis` (which contains a sadly empty file, `empty-draft.md`);\n" -"`data` (which contains three files `LittleWomen.txt`, `one.txt` and `two.txt`);\n" -"and a `tools` directory that contains the programs `format` and `stats`,\n" -"and a subdirectory called `old`, with a file `oldtool`." -msgstr "" -"Nelle's `writing` directory contains one file called `haiku.txt` and three subdirectories:\n" -"`thesis` (which contains a sadly empty file, `empty-draft.md`);\n" -"`data` (which contains three files `LittleWomen.txt`, `one.txt` and `two.txt`);\n" -"and a `tools` directory that contains the programs `format` and `stats`,\n" -"and a subdirectory called `old`, with a file `oldtool`." - -#: shell-novice/_episodes/07-find.md:399 -msgid "" -"For our first command,\n" -"let's run `find .`." -msgstr "" -"For our first command,\n" -"let's run `find .`." - -# code block -#: shell-novice/_episodes/07-find.md:402 -msgid "" -"~~~\n" -"$ find .\n" -"~~~" -msgstr "" -"~~~\n" -"$ find .\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:407 -msgid "" -"~~~\n" -".\n" -"./data\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"./tools\n" -"./tools/format\n" -"./tools/old\n" -"./tools/old/oldtool\n" -"./tools/stats\n" -"./haiku.txt\n" -"./thesis\n" -"./thesis/empty-draft.md\n" -"~~~" -msgstr "" -"~~~\n" -".\n" -"./data\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"./tools\n" -"./tools/format\n" -"./tools/old\n" -"./tools/old/oldtool\n" -"./tools/stats\n" -"./haiku.txt\n" -"./thesis\n" -"./thesis/empty-draft.md\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:424 -msgid "" -"As always,\n" -"the `.` on its own means the current working directory,\n" -"which is where we want our search to start.\n" -"`find`'s output is the names of every file **and** directory\n" -"under the current working directory.\n" -"This can seem useless at first but `find` has many options\n" -"to filter the output and in this lesson we will discover some \n" -"of them." -msgstr "" -"As always,\n" -"the `.` on its own means the current working directory,\n" -"which is where we want our search to start.\n" -"`find`'s output is the names of every file **and** directory\n" -"under the current working directory.\n" -"This can seem useless at first but `find` has many options\n" -"to filter the output and in this lesson we will discover some \n" -"of them." - -#: shell-novice/_episodes/07-find.md:433 -msgid "" -"The first option in our list is\n" -"`-type d` that means \"things that are directories\".\n" -"Sure enough,\n" -"`find`'s output is the names of the six directories in our little tree\n" -"(including `.`):" -msgstr "" -"The first option in our list is\n" -"`-type d` that means \"things that are directories\".\n" -"Sure enough,\n" -"`find`'s output is the names of the six directories in our little tree\n" -"(including `.`):" - -# code block -#: shell-novice/_episodes/07-find.md:439 -msgid "" -"~~~\n" -"$ find . -type d\n" -"~~~" -msgstr "" -"~~~\n" -"$ find . -type d\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:444 -msgid "" -"~~~\n" -"./\n" -"./data\n" -"./thesis\n" -"./tools\n" -"./tools/old\n" -"~~~" -msgstr "" -"~~~\n" -"./\n" -"./data\n" -"./thesis\n" -"./tools\n" -"./tools/old\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:453 -msgid "" -"Notice that the objects `find` finds are not listed in any particular order.\n" -"If we change `-type d` to `-type f`,\n" -"we get a listing of all the files instead:" -msgstr "" -"Notice that the objects `find` finds are not listed in any particular order.\n" -"If we change `-type d` to `-type f`,\n" -"we get a listing of all the files instead:" - -# code block -#: shell-novice/_episodes/07-find.md:457 -msgid "" -"~~~\n" -"$ find . -type f\n" -"~~~" -msgstr "" -"~~~\n" -"$ find . -type f\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:462 -msgid "" -"~~~\n" -"./haiku.txt\n" -"./tools/stats\n" -"./tools/old/oldtool\n" -"./tools/format\n" -"./thesis/empty-draft.md\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"~~~" -msgstr "" -"~~~\n" -"./haiku.txt\n" -"./tools/stats\n" -"./tools/old/oldtool\n" -"./tools/format\n" -"./thesis/empty-draft.md\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:474 -msgid "Now let's try matching by name:" -msgstr "Now let's try matching by name:" - -# code block -#: shell-novice/_episodes/07-find.md:476 -msgid "" -"~~~\n" -"$ find . -name *.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ find . -name *.txt\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:481 -msgid "" -"~~~\n" -"./haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"./haiku.txt\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:486 -msgid "" -"We expected it to find all the text files,\n" -"but it only prints out `./haiku.txt`.\n" -"The problem is that the shell expands wildcard characters like `*` *before* commands run.\n" -"Since `*.txt` in the current directory expands to `haiku.txt`,\n" -"the command we actually ran was:" -msgstr "" -"We expected it to find all the text files,\n" -"but it only prints out `./haiku.txt`.\n" -"The problem is that the shell expands wildcard characters like `*` *before* commands run.\n" -"Since `*.txt` in the current directory expands to `haiku.txt`,\n" -"the command we actually ran was:" - -# code block -#: shell-novice/_episodes/07-find.md:492 -msgid "" -"~~~\n" -"$ find . -name haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ find . -name haiku.txt\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:497 -msgid "`find` did what we asked; we just asked for the wrong thing." -msgstr "`find` did what we asked; we just asked for the wrong thing." - -#: shell-novice/_episodes/07-find.md:499 -msgid "" -"To get what we want,\n" -"let's do what we did with `grep`:\n" -"put `*.txt` in single quotes to prevent the shell from expanding the `*` wildcard.\n" -"This way,\n" -"`find` actually gets the pattern `*.txt`, not the expanded filename `haiku.txt`:" -msgstr "" -"To get what we want,\n" -"let's do what we did with `grep`:\n" -"put `*.txt` in single quotes to prevent the shell from expanding the `*` wildcard.\n" -"This way,\n" -"`find` actually gets the pattern `*.txt`, not the expanded filename `haiku.txt`:" - -# code block -#: shell-novice/_episodes/07-find.md:505 -msgid "" -"~~~\n" -"$ find . -name '*.txt'\n" -"~~~" -msgstr "" -"~~~\n" -"$ find . -name '*.txt'\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:510 -msgid "" -"~~~\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"./haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"./data/one.txt\n" -"./data/LittleWomen.txt\n" -"./data/two.txt\n" -"./haiku.txt\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:518 -msgid "> ## Listing vs. Finding" -msgstr "> ## Listing vs. Finding" - -#: shell-novice/_episodes/07-find.md:519 -msgid "" -">\n" -"> `ls` and `find` can be made to do similar things given the right options,\n" -"> but under normal circumstances,\n" -"> `ls` lists everything it can,\n" -"> while `find` searches for things with certain properties and shows them." -msgstr "" -">\n" -"> `ls` and `find` can be made to do similar things given the right options,\n" -"> but under normal circumstances,\n" -"> `ls` lists everything it can,\n" -"> while `find` searches for things with certain properties and shows them." - -#: shell-novice/_episodes/07-find.md:526 -msgid "" -"As we said earlier,\n" -"the command line's power lies in combining tools.\n" -"We've seen how to do that with pipes;\n" -"let's look at another technique.\n" -"As we just saw,\n" -"`find . -name '*.txt'` gives us a list of all text files in or below the current directory.\n" -"How can we combine that with `wc -l` to count the lines in all those files?" -msgstr "" -"As we said earlier,\n" -"the command line's power lies in combining tools.\n" -"We've seen how to do that with pipes;\n" -"let's look at another technique.\n" -"As we just saw,\n" -"`find . -name '*.txt'` gives us a list of all text files in or below the current directory.\n" -"How can we combine that with `wc -l` to count the lines in all those files?" - -#: shell-novice/_episodes/07-find.md:534 -msgid "The simplest way is to put the `find` command inside `$()`:" -msgstr "The simplest way is to put the `find` command inside `$()`:" - -# code block -#: shell-novice/_episodes/07-find.md:536 -msgid "" -"~~~\n" -"$ wc -l $(find . -name '*.txt')\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l $(find . -name '*.txt')\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:541 -msgid "" -"~~~\n" -"11 ./haiku.txt\n" -"300 ./data/two.txt\n" -"21022 ./data/LittleWomen.txt\n" -"70 ./data/one.txt\n" -"21403 total\n" -"~~~" -msgstr "" -"~~~\n" -"11 ./haiku.txt\n" -"300 ./data/two.txt\n" -"21022 ./data/LittleWomen.txt\n" -"70 ./data/one.txt\n" -"21403 total\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:550 -msgid "" -"When the shell executes this command,\n" -"the first thing it does is run whatever is inside the `$()`.\n" -"It then replaces the `$()` expression with that command's output.\n" -"Since the output of `find` is the four filenames `./data/one.txt`, `./data/LittleWomen.txt`, `./data/two.txt`, and `./haiku.txt`,\n" -"the shell constructs the command:" -msgstr "" -"When the shell executes this command,\n" -"the first thing it does is run whatever is inside the `$()`.\n" -"It then replaces the `$()` expression with that command's output.\n" -"Since the output of `find` is the four filenames `./data/one.txt`, `./data/LittleWomen.txt`, `./data/two.txt`, and `./haiku.txt`,\n" -"the shell constructs the command:" - -# code block -#: shell-novice/_episodes/07-find.md:556 -msgid "" -"~~~\n" -"$ wc -l ./data/one.txt ./data/LittleWomen.txt ./data/two.txt ./haiku.txt\n" -"~~~" -msgstr "" -"~~~\n" -"$ wc -l ./data/one.txt ./data/LittleWomen.txt ./data/two.txt ./haiku.txt\n" -"~~~" - -#: shell-novice/_episodes/07-find.md:561 -msgid "" -"which is what we wanted.\n" -"This expansion is exactly what the shell does when it expands wildcards like `*` and `?`,\n" -"but lets us use any command we want as our own \"wildcard\"." -msgstr "" -"which is what we wanted.\n" -"This expansion is exactly what the shell does when it expands wildcards like `*` and `?`,\n" -"but lets us use any command we want as our own \"wildcard\"." - -#: shell-novice/_episodes/07-find.md:565 -msgid "" -"It's very common to use `find` and `grep` together.\n" -"The first finds files that match a pattern;\n" -"the second looks for lines inside those files that match another pattern.\n" -"Here, for example, we can find PDB files that contain iron atoms\n" -"by looking for the string \"FE\" in all the `.pdb` files above the current directory:" -msgstr "" -"It's very common to use `find` and `grep` together.\n" -"The first finds files that match a pattern;\n" -"the second looks for lines inside those files that match another pattern.\n" -"Here, for example, we can find PDB files that contain iron atoms\n" -"by looking for the string \"FE\" in all the `.pdb` files above the current directory:" - -# code block -#: shell-novice/_episodes/07-find.md:571 -msgid "" -"~~~\n" -"$ grep \"FE\" $(find .. -name '*.pdb')\n" -"~~~" -msgstr "" -"~~~\n" -"$ grep \"FE\" $(find .. -name '*.pdb')\n" -"~~~" - -# code block -#: shell-novice/_episodes/07-find.md:576 -msgid "" -"~~~\n" -"../data/pdb/heme.pdb:ATOM 25 FE 1 -0.924 0.535 -0.518\n" -"~~~" -msgstr "" -"~~~\n" -"../data/pdb/heme.pdb:ATOM 25 FE 1 -0.924 0.535 -0.518\n" -"~~~" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:581 -msgid "> ## Matching and Subtracting" -msgstr "> ## Matching and Subtracting" - -#: shell-novice/_episodes/07-find.md:582 -msgid "" -">\n" -"> The `-v` flag to `grep` inverts pattern matching, so that only lines\n" -"> which do *not* match the pattern are printed. Given that, which of\n" -"> the following commands will find all files in `/data` whose names\n" -"> end in `s.txt` (e.g., `animals.txt` or `planets.txt`), but do\n" -"> *not* contain the word `net`?\n" -"> Once you have thought about your answer, you can test the commands in the `data-shell`\n" -"> directory.\n" -">\n" -"> 1. `find data -name '*s.txt' | grep -v net`\n" -"> 2. `find data -name *s.txt | grep -v net`\n" -"> 3. `grep -v \"temp\" $(find data -name '*s.txt')`\n" -"> 4. None of the above.\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 1. Putting the match expression in quotes prevents the shell\n" -"> > expanding it, so it gets passed to the `find` command.\n" -"> >\n" -"> > Option 2 is incorrect because the shell expands `*s.txt` instead of passing the wildcard\n" -"> > expression to `find`.\n" -"> >\n" -"> > Option 3 is incorrect because it searches the contents of the files for lines which\n" -"> > do not match \"temp\", rather than searching the file names." -msgstr "" -">\n" -"> The `-v` flag to `grep` inverts pattern matching, so that only lines\n" -"> which do *not* match the pattern are printed. Given that, which of\n" -"> the following commands will find all files in `/data` whose names\n" -"> end in `s.txt` (e.g., `animals.txt` or `planets.txt`), but do\n" -"> *not* contain the word `net`?\n" -"> Once you have thought about your answer, you can test the commands in the `data-shell`\n" -"> directory.\n" -">\n" -"> 1. `find data -name '*s.txt' | grep -v net`\n" -"> 2. `find data -name *s.txt | grep -v net`\n" -"> 3. `grep -v \"temp\" $(find data -name '*s.txt')`\n" -"> 4. None of the above.\n" -">\n" -"> > ## Solution\n" -"> > The correct answer is 1. Putting the match expression in quotes prevents the shell\n" -"> > expanding it, so it gets passed to the `find` command.\n" -"> >\n" -"> > Option 2 is incorrect because the shell expands `*s.txt` instead of passing the wildcard\n" -"> > expression to `find`.\n" -"> >\n" -"> > Option 3 is incorrect because it searches the contents of the files for lines which\n" -"> > do not match \"temp\", rather than searching the file names." - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:608 -msgid "> ## Binary Files" -msgstr "> ## Binary Files" - -#: shell-novice/_episodes/07-find.md:609 -msgid "" -">\n" -"> We have focused exclusively on finding things in text files. What if\n" -"> your data is stored as images, in databases, or in some other format?\n" -"> One option would be to extend tools like `grep` to handle those formats.\n" -"> This hasn't happened, and probably won't, because there are too many\n" -"> formats to support.\n" -">\n" -"> The second option is to convert the data to text, or extract the\n" -"> text-ish bits from the data. This is probably the most common approach,\n" -"> since it only requires people to build one tool per data format (to\n" -"> extract information). On the one hand, it makes simple things easy to\n" -"> do. On the negative side, complex things are usually impossible. For\n" -"> example, it's easy enough to write a program that will extract X and Y\n" -"> dimensions from image files for `grep` to play with, but how would you\n" -"> write something to find values in a spreadsheet whose cells contained\n" -"> formulas?\n" -">\n" -"> The third choice is to recognize that the shell and text processing have\n" -"> their limits, and to use another programming language.\n" -"> When the time comes to do this, don't be too hard on the shell: many\n" -"> modern programming languages have borrowed a lot of\n" -"> ideas from it, and imitation is also the sincerest form of praise." -msgstr "" -">\n" -"> We have focused exclusively on finding things in text files. What if\n" -"> your data is stored as images, in databases, or in some other format?\n" -"> One option would be to extend tools like `grep` to handle those formats.\n" -"> This hasn't happened, and probably won't, because there are too many\n" -"> formats to support.\n" -">\n" -"> The second option is to convert the data to text, or extract the\n" -"> text-ish bits from the data. This is probably the most common approach,\n" -"> since it only requires people to build one tool per data format (to\n" -"> extract information). On the one hand, it makes simple things easy to\n" -"> do. On the negative side, complex things are usually impossible. For\n" -"> example, it's easy enough to write a program that will extract X and Y\n" -"> dimensions from image files for `grep` to play with, but how would you\n" -"> write something to find values in a spreadsheet whose cells contained\n" -"> formulas?\n" -">\n" -"> The third choice is to recognize that the shell and text processing have\n" -"> their limits, and to use another programming language.\n" -"> When the time comes to do this, don't be too hard on the shell: many\n" -"> modern programming languages have borrowed a lot of\n" -"> ideas from it, and imitation is also the sincerest form of praise." - -#: shell-novice/_episodes/07-find.md:633 -msgid "" -"The Unix shell is older than most of the people who use it. It has\n" -"survived so long because it is one of the most productive programming\n" -"environments ever created --- maybe even *the* most productive. Its syntax\n" -"may be cryptic, but people who have mastered it can experiment with\n" -"different commands interactively, then use what they have learned to\n" -"automate their work. Graphical user interfaces may be better at the\n" -"first, but the shell is still unbeaten at the second. And as Alfred\n" -"North Whitehead wrote in 1911, \"Civilization advances by extending the\n" -"number of important operations which we can perform without thinking\n" -"about them.\"" -msgstr "" -"The Unix shell is older than most of the people who use it. It has\n" -"survived so long because it is one of the most productive programming\n" -"environments ever created --- maybe even *the* most productive. Its syntax\n" -"may be cryptic, but people who have mastered it can experiment with\n" -"different commands interactively, then use what they have learned to\n" -"automate their work. Graphical user interfaces may be better at the\n" -"first, but the shell is still unbeaten at the second. And as Alfred\n" -"North Whitehead wrote in 1911, \"Civilization advances by extending the\n" -"number of important operations which we can perform without thinking\n" -"about them.\"" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:644 -msgid "> ## `find` Pipeline Reading Comprehension" -msgstr "> ## `find` Pipeline Reading Comprehension" - -#: shell-novice/_episodes/07-find.md:645 -msgid "" -">\n" -"> Write a short explanatory comment for the following shell script:\n" -">\n" -"> ~~~\n" -"> wc -l $(find . -name '*.dat') | sort -n\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > 1. Find all files with a `.dat` extension in the current directory\n" -"> > 2. Count the number of lines each of these files contains\n" -"> > 3. Sort the output from step 2. numerically" -msgstr "" -">\n" -"> Write a short explanatory comment for the following shell script:\n" -">\n" -"> ~~~\n" -"> wc -l $(find . -name '*.dat') | sort -n\n" -"> ~~~\n" -"> {: .language-bash}\n" -">\n" -"> > ## Solution\n" -"> > 1. Find all files with a `.dat` extension in the current directory\n" -"> > 2. Count the number of lines each of these files contains\n" -"> > 3. Sort the output from step 2. numerically" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:660 -msgid "> ## Finding Files With Different Properties" -msgstr "> ## Finding Files With Different Properties" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:662 -msgid "> The `find` command can be given several other criteria known as \"tests\"" -msgstr "> The `find` command can be given several other criteria known as \"tests\"" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:663 -msgid "> to locate files with specific attributes, such as creation time, size," -msgstr "> to locate files with specific attributes, such as creation time, size," - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:664 -msgid "> permissions, or ownership. Use `man find` to explore these, and then" -msgstr "> permissions, or ownership. Use `man find` to explore these, and then" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:665 -msgid "> write a single command to find all files in or below the current directory" -msgstr "> write a single command to find all files in or below the current directory" - -# blockquote, which can be cascaded -#: shell-novice/_episodes/07-find.md:666 -msgid "> that were modified by the user `ahmed` in the last 24 hours." -msgstr "> that were modified by the user `ahmed` in the last 24 hours." - -#: shell-novice/_episodes/07-find.md:667 -msgid "" -">\n" -"> Hint 1: you will need to use three tests: `-type`, `-mtime`, and `-user`.\n" -">\n" -"> Hint 2: The value for `-mtime` will need to be negative---why?\n" -">\n" -"> > ## Solution\n" -"> > Assuming that Nelle’s home is our working directory we type:\n" -"> >\n" -"> > ~~~\n" -"> > $ find ./ -type f -mtime -1 -user ahmed\n" -"> > ~~~\n" -"> > {: .language-bash}" -msgstr "" -">\n" -"> Hint 1: you will need to use three tests: `-type`, `-mtime`, and `-user`.\n" -">\n" -"> Hint 2: The value for `-mtime` will need to be negative---why?\n" -">\n" -"> > ## Solution\n" -"> > Assuming that Nelle’s home is our working directory we type:\n" -"> >\n" -"> > ~~~\n" -"> > $ find ./ -type f -mtime -1 -user ahmed\n" -"> > ~~~\n" -"> > {: .language-bash}" - -# Front Matter -#: shell-novice/_extras/about.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: About\n" -"permalink: /about/\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: About\n" -"permalink: /about/\n" -"---" - -#: shell-novice/_extras/about.md:6 -msgid "{% include carpentries.html %}" -msgstr "{% include carpentries.html %}" - -# Front Matter -#: shell-novice/_extras/discuss.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: \"Discussion\"\n" -"permalink: /discuss/\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: \"Discussion\"\n" -"permalink: /discuss/\n" -"---" - -# header -#: shell-novice/_extras/discuss.md:6 -msgid "## Alphabet Soup" -msgstr "## Alphabet Soup" - -#: shell-novice/_extras/discuss.md:8 -msgid "" -"If the command to find out who we are is `whoami`, the command to find\n" -"out where we are ought to be called `whereami`, so why is it `pwd`\n" -"instead? The usual answer is that in the early 1970s, when Unix was\n" -"first being developed, every keystroke counted: the devices of the day\n" -"were slow, and backspacing on a teletype was so painful that cutting the\n" -"number of keystrokes in order to cut the number of typing mistakes was\n" -"actually a win for usability. The reality is that commands were added to\n" -"Unix one by one, without any master plan, by people who were immersed in\n" -"its jargon. The result is as inconsistent as the roolz uv Inglish\n" -"speling, but we're stuck with it now." -msgstr "" -"If the command to find out who we are is `whoami`, the command to find\n" -"out where we are ought to be called `whereami`, so why is it `pwd`\n" -"instead? The usual answer is that in the early 1970s, when Unix was\n" -"first being developed, every keystroke counted: the devices of the day\n" -"were slow, and backspacing on a teletype was so painful that cutting the\n" -"number of keystrokes in order to cut the number of typing mistakes was\n" -"actually a win for usability. The reality is that commands were added to\n" -"Unix one by one, without any master plan, by people who were immersed in\n" -"its jargon. The result is as inconsistent as the roolz uv Inglish\n" -"speling, but we're stuck with it now." - -# header -#: shell-novice/_extras/discuss.md:19 -msgid "## Job Control Codes" -msgstr "## Job Control Codes" - -#: shell-novice/_extras/discuss.md:21 -msgid "" -"The shell accepts a few special commands that allow users to interact\n" -"with running processes or programs. You can enter each of these\n" -"\"control codes\" by holding down the `Ctrl` key and then pressing one\n" -"of the control characters. In other tutorials, you may see the term\n" -"`Control` or the `^` used to represent the `Ctrl` key (e.g. the\n" -"following are all equivalent `Ctrl-C`, `Ctrl+C`, `Control-C`, `Control+C`, `^C`)." -msgstr "" -"The shell accepts a few special commands that allow users to interact\n" -"with running processes or programs. You can enter each of these\n" -"\"control codes\" by holding down the `Ctrl` key and then pressing one\n" -"of the control characters. In other tutorials, you may see the term\n" -"`Control` or the `^` used to represent the `Ctrl` key (e.g. the\n" -"following are all equivalent `Ctrl-C`, `Ctrl+C`, `Control-C`, `Control+C`, `^C`)." - -# unordered list -#: shell-novice/_extras/discuss.md:28 -msgid "* `Ctrl-C`:" -msgstr "* `Ctrl-C`:" - -#: shell-novice/_extras/discuss.md:29 -msgid "" -" interrupts and cancels a running program.\n" -" This is useful if you want to cancel a command that is taking too long to execute." -msgstr "" -" interrupts and cancels a running program.\n" -" This is useful if you want to cancel a command that is taking too long to execute." - -# unordered list -#: shell-novice/_extras/discuss.md:32 -msgid "* `Ctrl-D`:" -msgstr "* `Ctrl-D`:" - -#: shell-novice/_extras/discuss.md:33 -msgid "" -" indicates the end of a file or stream of characters that you are entering on the command line.\n" -" For example, we saw earlier that the `wc` command counts lines, words, and characters in a file.\n" -" If we just type `wc` and hit the Enter key without providing a file name,\n" -" then `wc` will assume we want it to analyze all the stuff we type next.\n" -" After typing our magnum opus directly into the shell prompt,\n" -" we can then type Ctrl-D to tell `wc` that we're done and we'd like to see the results of the word count." -msgstr "" -" indicates the end of a file or stream of characters that you are entering on the command line.\n" -" For example, we saw earlier that the `wc` command counts lines, words, and characters in a file.\n" -" If we just type `wc` and hit the Enter key without providing a file name,\n" -" then `wc` will assume we want it to analyze all the stuff we type next.\n" -" After typing our magnum opus directly into the shell prompt,\n" -" we can then type Ctrl-D to tell `wc` that we're done and we'd like to see the results of the word count." - -# unordered list -#: shell-novice/_extras/discuss.md:40 -msgid "* `Ctrl-Z`:" -msgstr "* `Ctrl-Z`:" - -#: shell-novice/_extras/discuss.md:41 -msgid "" -" Suspends a process but does not terminate it.\n" -" You can then use the command `fg` to restart the job in the foreground." -msgstr "" -" Suspends a process but does not terminate it.\n" -" You can then use the command `fg` to restart the job in the foreground." - -#: shell-novice/_extras/discuss.md:44 -msgid "" -"For new shell users, these control codes can all appear to have\n" -"the same effect: they make things \"go away.\" But it is helpful to\n" -"understand the differences. In general, if something went wrong and\n" -"you just want to get your shell prompt back, it is better to use\n" -"`Ctrl-C`." -msgstr "" -"For new shell users, these control codes can all appear to have\n" -"the same effect: they make things \"go away.\" But it is helpful to\n" -"understand the differences. In general, if something went wrong and\n" -"you just want to get your shell prompt back, it is better to use\n" -"`Ctrl-C`." - -# header -#: shell-novice/_extras/discuss.md:50 -msgid "## Other Shells" -msgstr "## Other Shells" - -#: shell-novice/_extras/discuss.md:52 -msgid "" -"Before Bash became popular in the end of nineties, scientists widely\n" -"used (and some still use) another shell, C-shell, or Csh. Bash and Csh\n" -"have similar feature sets, but their syntax rules are different and\n" -"this makes them incompatible with each other. A few other shells have\n" -"appeared since, including ksh, zsh, and a number of others; they are\n" -"mostly compatible with Bash, and Bash is the default shell on most\n" -"modern implementations of Unix (including most packages that provide\n" -"Unix-like tools for Windows) but if you get strange errors in shell\n" -"scripts written by colleagues, check to see which shell they were\n" -"written for." -msgstr "" -"Before Bash became popular in the end of nineties, scientists widely\n" -"used (and some still use) another shell, C-shell, or Csh. Bash and Csh\n" -"have similar feature sets, but their syntax rules are different and\n" -"this makes them incompatible with each other. A few other shells have\n" -"appeared since, including ksh, zsh, and a number of others; they are\n" -"mostly compatible with Bash, and Bash is the default shell on most\n" -"modern implementations of Unix (including most packages that provide\n" -"Unix-like tools for Windows) but if you get strange errors in shell\n" -"scripts written by colleagues, check to see which shell they were\n" -"written for." - -# header -#: shell-novice/_extras/discuss.md:63 -msgid "## Bash Configurations" -msgstr "## Bash Configurations" - -#: shell-novice/_extras/discuss.md:65 -msgid "" -"Want to customize paths, environment variables, aliases,\n" -"and other behaviors of your shell?\n" -"This excellent blog post \"[Bash Configurations Demystified][bash-demystified]\"\n" -"from Dalton Hubble\n" -"covers tips, tricks, and how to avoid dangers." -msgstr "" -"Want to customize paths, environment variables, aliases,\n" -"and other behaviors of your shell?\n" -"This excellent blog post \"[Bash Configurations Demystified][bash-demystified]\"\n" -"from Dalton Hubble\n" -"covers tips, tricks, and how to avoid dangers." - -#: shell-novice/_extras/discuss.md:71 -msgid "[bash-demystified]: https://blog.dghubble.io/post/.bashprofile-.profile-and-.bashrc-conventions/" -msgstr "[bash-demystified]: https://blog.dghubble.io/post/.bashprofile-.profile-and-.bashrc-conventions/" - -# Front Matter -#: shell-novice/_extras/figures.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: Figures\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: Figures\n" -"---" - -# inline html -#: shell-novice/_extras/figures.md:5 -msgid "" -"" -msgstr "" -"" - -#: shell-novice/_extras/figures.md:34 shell-novice/aio.md:31 -msgid "" -"{% comment %}\n" -"Create anchor for each one of the episodes.\n" -"{% endcomment %}\n" -"{% for episode in site.episodes %}\n" -"
\n" -"{% endfor %}" -msgstr "" -"{% comment %}\n" -"Create anchor for each one of the episodes.\n" -"{% endcomment %}\n" -"{% for episode in site.episodes %}\n" -"
\n" -"{% endfor %}" - -# Front Matter -#: shell-novice/_extras/guide.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: \"Instructor Notes\"\n" -"permalink: /guide/\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: \"Instructor Notes\"\n" -"permalink: /guide/\n" -"---" - -# unordered list -#: shell-novice/_extras/guide.md:6 -msgid "* Why do we learn to use the shell?" -msgstr "* Why do we learn to use the shell?" - -# unordered list -#: shell-novice/_extras/guide.md:7 -msgid " * Allows users to automate repetitive tasks" -msgstr " * Allows users to automate repetitive tasks" - -# unordered list -#: shell-novice/_extras/guide.md:8 -msgid " * And capture small data manipulation steps that are normally not recorded" -msgstr " * And capture small data manipulation steps that are normally not recorded" - -#: shell-novice/_extras/guide.md:9 -msgid "" -" to make research reproducible\n" -"* The Problem\n" -" * Running the same workflow on several samples can be unnecessarily labour intensive\n" -" * Manual manipulation of data files:\n" -" * is often not captured in documentation\n" -" * is hard to reproduce\n" -" * is hard to troubleshoot, review, or improve\n" -"* The Shell\n" -" * Workflows can be automated through the use of shell scripts\n" -" * Built-in commands allow for easy data manipulation (e.g. sort, grep, etc.)\n" -" * Every step can be captured in the shell script and allow reproducibility and easy troubleshooting" -msgstr "" -" to make research reproducible\n" -"* The Problem\n" -" * Running the same workflow on several samples can be unnecessarily labour intensive\n" -" * Manual manipulation of data files:\n" -" * is often not captured in documentation\n" -" * is hard to reproduce\n" -" * is hard to troubleshoot, review, or improve\n" -"* The Shell\n" -" * Workflows can be automated through the use of shell scripts\n" -" * Built-in commands allow for easy data manipulation (e.g. sort, grep, etc.)\n" -" * Every step can be captured in the shell script and allow reproducibility and easy troubleshooting" - -# header -#: shell-novice/_extras/guide.md:21 -msgid "## Overall" -msgstr "## Overall" - -#: shell-novice/_extras/guide.md:23 -msgid "" -"Many people have questioned whether we should still teach the shell.\n" -"After all,\n" -"anyone who wants to rename several thousand data files\n" -"can easily do so interactively in the Python interpreter,\n" -"and anyone who's doing serious data analysis\n" -"is probably going to do most of their work inside the IPython Notebook or R Studio.\n" -"So why teach the shell?" -msgstr "" -"Many people have questioned whether we should still teach the shell.\n" -"After all,\n" -"anyone who wants to rename several thousand data files\n" -"can easily do so interactively in the Python interpreter,\n" -"and anyone who's doing serious data analysis\n" -"is probably going to do most of their work inside the IPython Notebook or R Studio.\n" -"So why teach the shell?" - -#: shell-novice/_extras/guide.md:31 -msgid "" -"The first answer is,\n" -"\"Because so much else depends on it.\"\n" -"Installing software,\n" -"configuring your default editor,\n" -"and controlling remote machines frequently assume a basic familiarity with the shell,\n" -"and with related ideas like standard input and output.\n" -"Many tools also use its terminology\n" -"(for example, the `%ls` and `%cd` magic commands in IPython)." -msgstr "" -"The first answer is,\n" -"\"Because so much else depends on it.\"\n" -"Installing software,\n" -"configuring your default editor,\n" -"and controlling remote machines frequently assume a basic familiarity with the shell,\n" -"and with related ideas like standard input and output.\n" -"Many tools also use its terminology\n" -"(for example, the `%ls` and `%cd` magic commands in IPython)." - -#: shell-novice/_extras/guide.md:40 -msgid "" -"The second answer is,\n" -"\"Because it's an easy way to introduce some fundamental ideas about how to use computers.\"\n" -"As we teach people how to use the Unix shell,\n" -"we teach them that they should get the computer to repeat things\n" -"(via tab completion,\n" -"`!` followed by a command number,\n" -"and `for` loops)\n" -"rather than repeating things themselves.\n" -"We also teach them to take things they've discovered they do frequently\n" -"and save them for later re-use\n" -"(via shell scripts),\n" -"to give things sensible names,\n" -"and to write a little bit of documentation\n" -"(like comment at the top of shell scripts)\n" -"to make their future selves' lives better." -msgstr "" -"The second answer is,\n" -"\"Because it's an easy way to introduce some fundamental ideas about how to use computers.\"\n" -"As we teach people how to use the Unix shell,\n" -"we teach them that they should get the computer to repeat things\n" -"(via tab completion,\n" -"`!` followed by a command number,\n" -"and `for` loops)\n" -"rather than repeating things themselves.\n" -"We also teach them to take things they've discovered they do frequently\n" -"and save them for later re-use\n" -"(via shell scripts),\n" -"to give things sensible names,\n" -"and to write a little bit of documentation\n" -"(like comment at the top of shell scripts)\n" -"to make their future selves' lives better." - -#: shell-novice/_extras/guide.md:56 -msgid "" -"The third answer is,\n" -"\"Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.\"\n" -"Familiarity with the shell is very useful for remote accessing machines,\n" -"using high-performance computing infrastructure,\n" -"and running new specialist tools in many disciplines.\n" -"We do not teach HPC or domain-specific skills here\n" -"but lay the groundwork for further development of these skills.\n" -"In particular,\n" -"understanding the syntax of commands, flags, and help systems is useful for domain specific tools\n" -"and understanding the file system (and how to navigate it) is useful for remote access." -msgstr "" -"The third answer is,\n" -"\"Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.\"\n" -"Familiarity with the shell is very useful for remote accessing machines,\n" -"using high-performance computing infrastructure,\n" -"and running new specialist tools in many disciplines.\n" -"We do not teach HPC or domain-specific skills here\n" -"but lay the groundwork for further development of these skills.\n" -"In particular,\n" -"understanding the syntax of commands, flags, and help systems is useful for domain specific tools\n" -"and understanding the file system (and how to navigate it) is useful for remote access." - -#: shell-novice/_extras/guide.md:67 -msgid "" -"Finally,\n" -"and perhaps most importantly,\n" -"teaching people the shell lets us teach them\n" -"to think about programming in terms of function composition.\n" -"In the case of the shell,\n" -"this takes the form of pipelines rather than nested function calls,\n" -"but the core idea of \"small pieces, loosely joined\" is the same." -msgstr "" -"Finally,\n" -"and perhaps most importantly,\n" -"teaching people the shell lets us teach them\n" -"to think about programming in terms of function composition.\n" -"In the case of the shell,\n" -"this takes the form of pipelines rather than nested function calls,\n" -"but the core idea of \"small pieces, loosely joined\" is the same." - -#: shell-novice/_extras/guide.md:75 -msgid "" -"All of this material can be covered in three hours\n" -"as long as learners using Windows do not run into roadblocks such as:" -msgstr "" -"All of this material can be covered in three hours\n" -"as long as learners using Windows do not run into roadblocks such as:" - -# unordered list -#: shell-novice/_extras/guide.md:78 -msgid "* not being able to figure out where their home directory is" -msgstr "* not being able to figure out where their home directory is" - -#: shell-novice/_extras/guide.md:79 -msgid "" -" (particularly if they're using Cygwin);\n" -"* not being able to run a plain text editor;\n" -" and\n" -"* the shell refusing to run scripts that include DOS line endings." -msgstr "" -" (particularly if they're using Cygwin);\n" -"* not being able to run a plain text editor;\n" -" and\n" -"* the shell refusing to run scripts that include DOS line endings." - -# header -#: shell-novice/_extras/guide.md:84 -msgid "## Preparing to Teach" -msgstr "## Preparing to Teach" - -# unordered list -#: shell-novice/_extras/guide.md:86 -msgid "* Use the `data` directory for in-workshop exercises and live coding examples." -msgstr "* Use the `data` directory for in-workshop exercises and live coding examples." - -#: shell-novice/_extras/guide.md:87 -msgid "" -" You can clone the shell-novice directory or use the `Download ZIP`\n" -" button on the right to get the entire [repository](https://github.com/swcarpentry/shell-novice). We also now provide\n" -" a zip file of the `data` directory that can be downloaded on its own\n" -" from the repository by right-click + save or see the [\"setup\"]({{ page.root }}/setup/) page on the lesson website for more details. " -msgstr "" -" You can clone the shell-novice directory or use the `Download ZIP`\n" -" button on the right to get the entire [repository](https://github.com/swcarpentry/shell-novice). We also now provide\n" -" a zip file of the `data` directory that can be downloaded on its own\n" -" from the repository by right-click + save or see the [\"setup\"]({{ page.root }}/setup/) page on the lesson website for more details. " - -# unordered list -#: shell-novice/_extras/guide.md:92 -msgid "* Website: various practices have been used." -msgstr "* Website: various practices have been used." - -# unordered list -#: shell-novice/_extras/guide.md:93 -msgid " * Option 1: Can give links to learners before the lesson so they can follow along," -msgstr " * Option 1: Can give links to learners before the lesson so they can follow along," - -#: shell-novice/_extras/guide.md:94 -msgid "" -" catch up,\n" -"\tand see exercises (particularly if you're following the lesson content without many changes).\n" -" * Option 2: Don't show the website to the learners during the lesson, as it can be distracting:\n" -" students may read instead of listen, and having another window open is an additional cognitive load.\n" -"\t* In any case, make sure to point to website as a post-workshop reference." -msgstr "" -" catch up,\n" -"\tand see exercises (particularly if you're following the lesson content without many changes).\n" -" * Option 2: Don't show the website to the learners during the lesson, as it can be distracting:\n" -" students may read instead of listen, and having another window open is an additional cognitive load.\n" -"\t* In any case, make sure to point to website as a post-workshop reference." - -# unordered list -#: shell-novice/_extras/guide.md:100 -msgid "* Content:" -msgstr "* Content:" - -#: shell-novice/_extras/guide.md:101 -msgid "" -" Unless you have a truly generous amount of time (4+ hours),\n" -" it is likely that you will not cover ALL the material in this lesson in a single half-day session.\n" -" Plan ahead on what you might skip, what you really want to emphasize, etc." -msgstr "" -" Unless you have a truly generous amount of time (4+ hours),\n" -" it is likely that you will not cover ALL the material in this lesson in a single half-day session.\n" -" Plan ahead on what you might skip, what you really want to emphasize, etc." - -# unordered list -#: shell-novice/_extras/guide.md:105 -msgid "* Exercises:" -msgstr "* Exercises:" - -#: shell-novice/_extras/guide.md:106 -msgid "" -" Think in advance about how you might want to handle exercises during the lesson.\n" -" How are you assigning them (website, slide, handout)?\n" -" Do you want everyone to try it and then you show the solution?\n" -" Have a learner show the solution?\n" -" Have groups each do a different exercise and present their solutions?" -msgstr "" -" Think in advance about how you might want to handle exercises during the lesson.\n" -" How are you assigning them (website, slide, handout)?\n" -" Do you want everyone to try it and then you show the solution?\n" -" Have a learner show the solution?\n" -" Have groups each do a different exercise and present their solutions?" - -# unordered list -#: shell-novice/_extras/guide.md:112 -msgid "* `reference.md` can be printed out and given to students as a reference, your choice." -msgstr "* `reference.md` can be printed out and given to students as a reference, your choice." - -# unordered list -#: shell-novice/_extras/guide.md:114 -msgid "* Other preparation:" -msgstr "* Other preparation:" - -#: shell-novice/_extras/guide.md:115 -msgid "" -" Feel free to add your own examples or side comments,\n" -" but know that it shouldn't be necessary:\n" -" the topics and commands can be taught as given on the lesson pages.\n" -" If you think there is a place where the lesson is lacking,\n" -" feel free to file an issue or submit a pull request." -msgstr "" -" Feel free to add your own examples or side comments,\n" -" but know that it shouldn't be necessary:\n" -" the topics and commands can be taught as given on the lesson pages.\n" -" If you think there is a place where the lesson is lacking,\n" -" feel free to file an issue or submit a pull request." - -# header -#: shell-novice/_extras/guide.md:121 -msgid "## Teaching Notes" -msgstr "## Teaching Notes" - -# unordered list -#: shell-novice/_extras/guide.md:123 -msgid "* Super cool online resource!" -msgstr "* Super cool online resource!" - -#: shell-novice/_extras/guide.md:124 -msgid "" -" will dissect any shell command you type in\n" -" and display help text for each piece. Additional nice manual tool could be with short very descriptive manuals for shell commands, useful especially on Windows while using Git BASH where `man` could not work." -msgstr "" -" will dissect any shell command you type in\n" -" and display help text for each piece. Additional nice manual tool could be with short very descriptive manuals for shell commands, useful especially on Windows while using Git BASH where `man` could not work." - -# unordered list -#: shell-novice/_extras/guide.md:127 -msgid "* Another super cool online resource is ," -msgstr "* Another super cool online resource is ," - -#: shell-novice/_extras/guide.md:128 -msgid " which will check shell scripts (both uploaded and typed in) for common errors." -msgstr " which will check shell scripts (both uploaded and typed in) for common errors." - -# unordered list -#: shell-novice/_extras/guide.md:130 -msgid "* Resources for \"splitting\" your shell so that recent commands" -msgstr "* Resources for \"splitting\" your shell so that recent commands" - -#: shell-novice/_extras/guide.md:131 -msgid " remain in view: ." -msgstr " remain in view: ." - -# unordered list -#: shell-novice/_extras/guide.md:133 -msgid "* Running a text editor from the command line can be" -msgstr "* Running a text editor from the command line can be" - -#: shell-novice/_extras/guide.md:134 -msgid "" -" the biggest stumbling block during the entire lesson:\n" -" many will try to run the same editor as the instructor\n" -" (which may leave them trapped in the awful nether hell that is Vim),\n" -" or will not know how to navigate to the right directory\n" -" to save their file,\n" -" or will run a word processor rather than a plain text editor.\n" -" The quickest way past these problems is to have more knowledgeable learners\n" -" help those who need it." -msgstr "" -" the biggest stumbling block during the entire lesson:\n" -" many will try to run the same editor as the instructor\n" -" (which may leave them trapped in the awful nether hell that is Vim),\n" -" or will not know how to navigate to the right directory\n" -" to save their file,\n" -" or will run a word processor rather than a plain text editor.\n" -" The quickest way past these problems is to have more knowledgeable learners\n" -" help those who need it." - -# unordered list -#: shell-novice/_extras/guide.md:143 -msgid "* Introducing and navigating the filesystem in the shell (covered in" -msgstr "* Introducing and navigating the filesystem in the shell (covered in" - -#: shell-novice/_extras/guide.md:144 -msgid " [Navigating Files and Directories]({{ page.root }}/02-filedir/) section) can be confusing. You may have both terminal and GUI file explorer open side by side so learners can see the content and file structure while they're using terminal to navigate the system." -msgstr " [Navigating Files and Directories]({{ page.root }}/02-filedir/) section) can be confusing. You may have both terminal and GUI file explorer open side by side so learners can see the content and file structure while they're using terminal to navigate the system." - -# unordered list -#: shell-novice/_extras/guide.md:146 -msgid "* Tab completion sounds like a small thing: it isn't." -msgstr "* Tab completion sounds like a small thing: it isn't." - -#: shell-novice/_extras/guide.md:147 -msgid "" -" Re-running old commands using `!123` or `!wc`\n" -" isn't a small thing either,\n" -" and neither are wildcard expansion and `for` loops.\n" -" Each one is an opportunity to repeat one of the big ideas of Software Carpentry:\n" -" if the computer *can* repeat it,\n" -" some programmer somewhere will almost certainly have built\n" -" some way for the computer *to* repeat it." -msgstr "" -" Re-running old commands using `!123` or `!wc`\n" -" isn't a small thing either,\n" -" and neither are wildcard expansion and `for` loops.\n" -" Each one is an opportunity to repeat one of the big ideas of Software Carpentry:\n" -" if the computer *can* repeat it,\n" -" some programmer somewhere will almost certainly have built\n" -" some way for the computer *to* repeat it." - -# unordered list -#: shell-novice/_extras/guide.md:155 -msgid "* Building up a pipeline with four or five stages," -msgstr "* Building up a pipeline with four or five stages," - -#: shell-novice/_extras/guide.md:156 -msgid "" -" then putting it in a shell script for re-use\n" -" and calling that script inside a `for` loop,\n" -" is a great opportunity to show how\n" -" \"seven plus or minus two\"\n" -" connects to programming.\n" -" Once we have figured out how to do something moderately complicated,\n" -" we make it re-usable and give it a name\n" -" so that it only takes up one slot in working memory\n" -" rather than several.\n" -" It is also a good opportunity to talk about exploratory programming:\n" -" rather than designing a program up front,\n" -" we can do a few useful things\n" -" and then retroactively decide which are worth encapsulating\n" -" for future re-use." -msgstr "" -" then putting it in a shell script for re-use\n" -" and calling that script inside a `for` loop,\n" -" is a great opportunity to show how\n" -" \"seven plus or minus two\"\n" -" connects to programming.\n" -" Once we have figured out how to do something moderately complicated,\n" -" we make it re-usable and give it a name\n" -" so that it only takes up one slot in working memory\n" -" rather than several.\n" -" It is also a good opportunity to talk about exploratory programming:\n" -" rather than designing a program up front,\n" -" we can do a few useful things\n" -" and then retroactively decide which are worth encapsulating\n" -" for future re-use." - -# unordered list -#: shell-novice/_extras/guide.md:171 -msgid "* If everything is going well, you can drive home the point that file" -msgstr "* If everything is going well, you can drive home the point that file" - -#: shell-novice/_extras/guide.md:172 -msgid "" -" extensions are essentially there to help computers (and human\n" -" readers) understand file content and are not a requirement of files\n" -" (covered briefly in [Navigating Files and Directories]({{ page.root }}/02-filedir/)).\n" -" This can be done in the [Pipes and Filters]({{ page.root }}/04-pipefilter/) section by showing that you\n" -" can redirect standard output to a file without the .txt extension\n" -" (e.g., lengths), and that the resulting file is still a perfectly usable text file.\n" -" Make the point that if double-clicked in the GUI, the computer will\n" -" probably ask you what you want to do." -msgstr "" -" extensions are essentially there to help computers (and human\n" -" readers) understand file content and are not a requirement of files\n" -" (covered briefly in [Navigating Files and Directories]({{ page.root }}/02-filedir/)).\n" -" This can be done in the [Pipes and Filters]({{ page.root }}/04-pipefilter/) section by showing that you\n" -" can redirect standard output to a file without the .txt extension\n" -" (e.g., lengths), and that the resulting file is still a perfectly usable text file.\n" -" Make the point that if double-clicked in the GUI, the computer will\n" -" probably ask you what you want to do." - -# unordered list -#: shell-novice/_extras/guide.md:181 -msgid "* We have to leave out many important things because of time constraints," -msgstr "* We have to leave out many important things because of time constraints," - -#: shell-novice/_extras/guide.md:182 -msgid "" -" including file permissions, job control, and SSH.\n" -" If learners already understand the basic material,\n" -" this can be covered instead using the online lessons as guidelines.\n" -" These limitations also have follow-on consequences:" -msgstr "" -" including file permissions, job control, and SSH.\n" -" If learners already understand the basic material,\n" -" this can be covered instead using the online lessons as guidelines.\n" -" These limitations also have follow-on consequences:" - -# unordered list -#: shell-novice/_extras/guide.md:187 -msgid "* It's hard to discuss `#!` (shebang) without first discussing" -msgstr "* It's hard to discuss `#!` (shebang) without first discussing" - -#: shell-novice/_extras/guide.md:188 -msgid "" -" permissions, which we don't do. `#!` is also [pretty\n" -" complicated][shebang], so even if we did discuss permissions, we\n" -" probably still wouldn't want to discuss `#!`." -msgstr "" -" permissions, which we don't do. `#!` is also [pretty\n" -" complicated][shebang], so even if we did discuss permissions, we\n" -" probably still wouldn't want to discuss `#!`." - -# unordered list -#: shell-novice/_extras/guide.md:192 -msgid "* Installing Bash and a reasonable set of Unix commands on Windows" -msgstr "* Installing Bash and a reasonable set of Unix commands on Windows" - -#: shell-novice/_extras/guide.md:193 -msgid "" -" always involves some fiddling and frustration.\n" -" Please see the latest set of installation guidelines for advice,\n" -" and try it out yourself *before* teaching a class." -msgstr "" -" always involves some fiddling and frustration.\n" -" Please see the latest set of installation guidelines for advice,\n" -" and try it out yourself *before* teaching a class." - -# unordered list -#: shell-novice/_extras/guide.md:197 -msgid "* On Windows machines" -msgstr "* On Windows machines" - -#: shell-novice/_extras/guide.md:198 -msgid "" -" if `nano` hasn't been properly installed with the\n" -" [Software Carpentry Windows Installer][windows-installer]\n" -" it is possible to use `notepad` as an alternative. There will be a GUI\n" -" interface and line endings are treated differently, but otherwise, for\n" -" the purposes of this lesson, `notepad` and `nano` can be used almost interchangeably." -msgstr "" -" if `nano` hasn't been properly installed with the\n" -" [Software Carpentry Windows Installer][windows-installer]\n" -" it is possible to use `notepad` as an alternative. There will be a GUI\n" -" interface and line endings are treated differently, but otherwise, for\n" -" the purposes of this lesson, `notepad` and `nano` can be used almost interchangeably." - -# unordered list -#: shell-novice/_extras/guide.md:204 -msgid "* On Windows, it appears that:" -msgstr "* On Windows, it appears that:" - -#: shell-novice/_extras/guide.md:206 -msgid "" -" ~~~\n" -" $ cd\n" -" $ cd Desktop\n" -" ~~~" -msgstr "" -" ~~~\n" -" $ cd\n" -" $ cd Desktop\n" -" ~~~" - -#: shell-novice/_extras/guide.md:212 -msgid "" -" will always put someone on their desktop.\n" -" Have them create the example directory for the shell exercises there\n" -" so that they can find it easily\n" -" and watch it evolve." -msgstr "" -" will always put someone on their desktop.\n" -" Have them create the example directory for the shell exercises there\n" -" so that they can find it easily\n" -" and watch it evolve." - -# unordered list -#: shell-novice/_extras/guide.md:217 -msgid "* Stay within POSIX-compliant commands, as all the teaching materials do." -msgstr "* Stay within POSIX-compliant commands, as all the teaching materials do." - -#: shell-novice/_extras/guide.md:218 -msgid "" -" Your particular shell may have extensions beyond POSIX that are not available\n" -" on other machines, especially the default OSX bash and Windows bash emulators.\n" -" For example, POSIX `ls` does not have an `--ignore=` or `-I` option, and POSIX\n" -" `head` takes `-n 10` or `-10`, but not the long form of `--lines=10`." -msgstr "" -" Your particular shell may have extensions beyond POSIX that are not available\n" -" on other machines, especially the default OSX bash and Windows bash emulators.\n" -" For example, POSIX `ls` does not have an `--ignore=` or `-I` option, and POSIX\n" -" `head` takes `-n 10` or `-10`, but not the long form of `--lines=10`." - -# header -#: shell-novice/_extras/guide.md:223 -msgid "## Windows" -msgstr "## Windows" - -#: shell-novice/_extras/guide.md:225 -msgid "" -"Installing Bash and a reasonable set of Unix commands on Windows\n" -"always involves some fiddling and frustration.\n" -"Please see the latest set of installation guidelines for advice,\n" -"and try it out yourself *before* teaching a class.\n" -"Options we have explored include:" -msgstr "" -"Installing Bash and a reasonable set of Unix commands on Windows\n" -"always involves some fiddling and frustration.\n" -"Please see the latest set of installation guidelines for advice,\n" -"and try it out yourself *before* teaching a class.\n" -"Options we have explored include:" - -# ordered list -#: shell-novice/_extras/guide.md:231 -msgid "1. [msysGit](http://msysgit.github.io/) (also called \"Git Bash\")," -msgstr "1. [msysGit](http://msysgit.github.io/) (also called \"Git Bash\")," - -# ordered list -#: shell-novice/_extras/guide.md:232 -msgid "2. [Cygwin](http://www.cygwin.com/)," -msgstr "2. [Cygwin](http://www.cygwin.com/)," - -# ordered list -#: shell-novice/_extras/guide.md:233 -msgid "3. using a desktop virtual machine, and" -msgstr "3. using a desktop virtual machine, and" - -# ordered list -#: shell-novice/_extras/guide.md:234 -msgid "4. having learners connect to a remote Unix machine (typically a VM in the cloud)." -msgstr "4. having learners connect to a remote Unix machine (typically a VM in the cloud)." - -#: shell-novice/_extras/guide.md:236 -msgid "" -"Cygwin was the preferred option until mid-2013,\n" -"but once we started teaching Git,\n" -"msysGit proved to work better.\n" -"Desktop virtual machines and cloud-based VMs work well for technically sophisticated learners,\n" -"and can reduce installation and configuration at the start of the workshop,\n" -"but:" -msgstr "" -"Cygwin was the preferred option until mid-2013,\n" -"but once we started teaching Git,\n" -"msysGit proved to work better.\n" -"Desktop virtual machines and cloud-based VMs work well for technically sophisticated learners,\n" -"and can reduce installation and configuration at the start of the workshop,\n" -"but:" - -# ordered list -#: shell-novice/_extras/guide.md:243 -msgid "1. they don't work well on underpowered machines," -msgstr "1. they don't work well on underpowered machines," - -# ordered list -#: shell-novice/_extras/guide.md:244 -msgid "2. they're confusing for novices (because simple things like copy and paste work differently)," -msgstr "2. they're confusing for novices (because simple things like copy and paste work differently)," - -# ordered list -#: shell-novice/_extras/guide.md:245 -msgid "3. learners leave the workshop without a working environment on their operating system of choice, and" -msgstr "3. learners leave the workshop without a working environment on their operating system of choice, and" - -# ordered list -#: shell-novice/_extras/guide.md:246 -msgid "4. learners may show up without having downloaded the VM or the wireless will go down (or become congested) during the lesson." -msgstr "4. learners may show up without having downloaded the VM or the wireless will go down (or become congested) during the lesson." - -#: shell-novice/_extras/guide.md:248 -msgid "" -"Whatever you use,\n" -"please *test it yourself* on a Windows machine *before* your workshop:\n" -"things may always have changed behind your back since your last workshop.\n" -"And please also make use of our\n" -"[Software Carpentry Windows Installer][windows-installer]." -msgstr "" -"Whatever you use,\n" -"please *test it yourself* on a Windows machine *before* your workshop:\n" -"things may always have changed behind your back since your last workshop.\n" -"And please also make use of our\n" -"[Software Carpentry Windows Installer][windows-installer]." - -#: shell-novice/_extras/guide.md:254 -msgid "" -"[shebang]: http://www.in-ulm.de/~mascheck/various/shebang/\n" -"[windows-installer]: {{ site.swc_github }}/windows-installer" -msgstr "" -"[shebang]: http://www.in-ulm.de/~mascheck/various/shebang/\n" -"[windows-installer]: {{ site.swc_github }}/windows-installer" - -#: shell-novice/_includes/links.md:1 -msgid "" -"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" -"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" -"[concept-maps]: http://carpentries.github.io/instructor-training/05-memory/\n" -"[email]: mailto:lessons@software-carpentry.org\n" -"[contrib-covenant]: http://contributor-covenant.org/\n" -"[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md\n" -"[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html\n" -"[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html\n" -"[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html\n" -"[github-importer]: https://import.github.com/\n" -"[importer]: https://github.com/new/import\n" -"[jekyll-collection]: https://jekyllrb.com/docs/collections/\n" -"[jekyll-install]: https://jekyllrb.com/docs/installation/\n" -"[jekyll-windows]: http://jekyll-windows.juthilo.com/\n" -"[jekyll]: https://jekyllrb.com/\n" -"[jupyter]: https://jupyter.org/\n" -"[mit-license]: http://opensource.org/licenses/mit-license.html\n" -"[morea]: https://morea-framework.github.io/\n" -"[numfocus]: http://numfocus.org/\n" -"[osi]: http://opensource.org\n" -"[pandoc]: https://pandoc.org/\n" -"[paper-now]: https://github.com/PeerJ/paper-now\n" -"[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/\n" -"[pyyaml]: https://pypi.python.org/pypi/PyYAML\n" -"[r-markdown]: http://rmarkdown.rstudio.com/\n" -"[rstudio]: https://www.rstudio.com/\n" -"[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/\n" -"[ruby-installer]: http://rubyinstaller.org/\n" -"[rubygems]: https://rubygems.org/pages/download/\n" -"[styles]: https://github.com/swcarpentry/styles/\n" -"[training]: http://swcarpentry.github.io/instructor-training/\n" -"[workshop-repo]: {{ site.workshop_repo }}\n" -"[yaml]: http://yaml.org/\n" -"[coc]: https://software-carpentry.org/conduct/\n" -"[coc-reporting]: https://software-carpentry.org/CoC-reporting/" -msgstr "" -"[cc-by-human]: https://creativecommons.org/licenses/by/4.0/\n" -"[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode\n" -"[concept-maps]: http://carpentries.github.io/instructor-training/05-memory/\n" -"[email]: mailto:lessons@software-carpentry.org\n" -"[contrib-covenant]: http://contributor-covenant.org/\n" -"[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md\n" -"[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html\n" -"[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html\n" -"[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html\n" -"[github-importer]: https://import.github.com/\n" -"[importer]: https://github.com/new/import\n" -"[jekyll-collection]: https://jekyllrb.com/docs/collections/\n" -"[jekyll-install]: https://jekyllrb.com/docs/installation/\n" -"[jekyll-windows]: http://jekyll-windows.juthilo.com/\n" -"[jekyll]: https://jekyllrb.com/\n" -"[jupyter]: https://jupyter.org/\n" -"[mit-license]: http://opensource.org/licenses/mit-license.html\n" -"[morea]: https://morea-framework.github.io/\n" -"[numfocus]: http://numfocus.org/\n" -"[osi]: http://opensource.org\n" -"[pandoc]: https://pandoc.org/\n" -"[paper-now]: https://github.com/PeerJ/paper-now\n" -"[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/\n" -"[pyyaml]: https://pypi.python.org/pypi/PyYAML\n" -"[r-markdown]: http://rmarkdown.rstudio.com/\n" -"[rstudio]: https://www.rstudio.com/\n" -"[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/\n" -"[ruby-installer]: http://rubyinstaller.org/\n" -"[rubygems]: https://rubygems.org/pages/download/\n" -"[styles]: https://github.com/swcarpentry/styles/\n" -"[training]: http://swcarpentry.github.io/instructor-training/\n" -"[workshop-repo]: {{ site.workshop_repo }}\n" -"[yaml]: http://yaml.org/\n" -"[coc]: https://software-carpentry.org/conduct/\n" -"[coc-reporting]: https://software-carpentry.org/CoC-reporting/" - -# Front Matter -#: shell-novice/aio.md:1 -msgid "" -"---\n" -"layout: page \n" -"root: .\n" -"---" -msgstr "" -"---\n" -"layout: page \n" -"root: .\n" -"---" - -# inline html -#: shell-novice/aio.md:5 -msgid "" -"" -msgstr "" -"" - -# Front Matter -#: shell-novice/index.md:1 -msgid "" -"---\n" -"layout: lesson\n" -"root: .\n" -"---" -msgstr "" -"---\n" -"layout: lesson\n" -"root: .\n" -"---" - -#: shell-novice/index.md:6 -msgid "" -"The Unix shell has been around longer than most of its users have been alive.\n" -"It has survived so long because it's a power tool\n" -"that allows people to do complex things with just a few keystrokes.\n" -"More importantly,\n" -"it helps them combine existing programs in new ways\n" -"and automate repetitive tasks\n" -"so they aren't typing the same things over and over again.\n" -"Use of the shell is fundamental to using a wide range of other powerful tools \n" -"and computing resources (including \"high-performance computing\" supercomputers).\n" -"These lessons will start you on a path towards using these resources effectively." -msgstr "" -"Unixシェルは、ほとんどのユーザーが生きていたよりもずっと長くなっています。 \n" -"それは人々がちょうど少数のキーストロークで複雑なことをすることを可能にする電動工具であるので、\n" -"ずっと生き延びてきました。 さらに重要なことは、既存のプログラムを新しい方法で組み合わせ、\n" -"繰り返しの作業を自動化して、同じことを何度も繰り返し入力しないようにすることです。 \n" -"シェルの使用は、他の強力なツールやコンピューティングリソース\n" -"(「高性能コンピューティング」スーパーコンピュータを含む)を幅広く使用する上で基本的です。 \n" -"これらのレッスンは、これらのリソースを効果的に使用するための道を歩み始めます。" - -# blockquote, which can be cascaded -#: shell-novice/index.md:17 -msgid "> ## Prerequisites" -msgstr "> ## Prerequisites" - -#: shell-novice/index.md:18 -msgid "" -">\n" -"> This lesson guides you through the basics of file systems and the\n" -"> shell. If you have stored files on a computer at all and recognize\n" -"> the word “file” and either “directory” or “folder” (two common words\n" -"> for the same thing), you're ready for this lesson.\n" -">\n" -"> If you're already comfortable manipulating files and directories,\n" -"> searching for files with `grep` and `find`, and writing simple loops\n" -"> and scripts, you probably want to explore the next lesson: [shell-extras](swcarpentry.github.io/shell-extras)." -msgstr "" -"> このレッスンでは、ファイルシステムとシェルの基本について説明します。 \n" -"> コンピュータにファイルを保存して、「ファイル」という単語と「ディレクトリ」\n" -"> または「フォルダ」(同じことの2つの一般的な単語)を認識している場合は、\n" -"> このレッスンの準備が整いました。\n" -"> \n" -">ファイルやディレクトリを操作したり、grepとfindでファイルを検索したり、\n" -"> 単純なループやスクリプトを書いたりするのが快適であれば、\n" -"> おそらく次のレッスンを探そうと思っています:\n" -"> [shell-extras](swcarpentry.github.io/shell-extras)を実行します。" - -# SC/DC Template label -#: shell-novice/index.md:27 -msgid "{: .prereq}" -msgstr "{: .prereq}" - -# Front Matter -#: shell-novice/reference.md:1 -msgid "" -"---\n" -"layout: reference\n" -"permalink: /reference/\n" -"---" -msgstr "" -"---\n" -"layout: reference\n" -"permalink: /reference/\n" -"---" - -# header -#: shell-novice/reference.md:6 -msgid "## Summary of Basic Commands" -msgstr "## 基本コマンドのまとめ" - -#: shell-novice/reference.md:8 -msgid "" -"| Action | Files | Folders |\n" -"|-------------|-------|--------------|\n" -"| Inspect | ls | ls |\n" -"| View content| cat | ls |\n" -"| Navigate to | | cd |\n" -"| Move | mv | mv |\n" -"| Copy | cp | cp -r |\n" -"| Create | nano | mkdir |\n" -"| Delete | rm | rmdir, rm -r |" -msgstr "" -"| アクション | ファイル | フォルダ |\n" -"|-------------|-------|--------------|\n" -"| 検査 | ls | ls |\n" -"| コンテンツを表示| cat | ls |\n" -"| 移動 | | cd |\n" -"| 移動 | mv | mv |\n" -"| コピー | cp | cp -r |\n" -"| 作成 | nano | mkdir |\n" -"| 削除 | rm | rmdir, rm -r |" - -# header -#: shell-novice/reference.md:18 -msgid "## Filesystem hierarchy" -msgstr "## Filesystem hierarchy" - -#: shell-novice/reference.md:20 -msgid "" -"The following is an overview of a standard Unix filesystem.\n" -"The exact hierarchy depends on the platform,\n" -"so you may not see exactly the same files/directories on your computer:" -msgstr "" -"The following is an overview of a standard Unix filesystem.\n" -"The exact hierarchy depends on the platform,\n" -"so you may not see exactly the same files/directories on your computer:" - -#: shell-novice/reference.md:24 -msgid "![Linux filesystem hierarchy](../fig/standard-filesystem-hierarchy.svg)" -msgstr "![Linux filesystem hierarchy](../fig/standard-filesystem-hierarchy.svg)" - -# header -#: shell-novice/reference.md:26 -msgid "## Glossary" -msgstr "## Glossary" - -#: shell-novice/reference.md:28 -msgid "" -"{:auto_ids}\n" -"absolute path\n" -": A [path](#path) that refers to a particular location in a file system.\n" -" Absolute paths are usually written with respect to the file system's\n" -" [root directory](#root-directory),\n" -" and begin with either \"/\" (on Unix) or \"\\\\\" (on Microsoft Windows).\n" -" See also: [relative path](#relative-path)." -msgstr "" -"{:auto_ids}\n" -"absolute path\n" -": A [path](#path) that refers to a particular location in a file system.\n" -" Absolute paths are usually written with respect to the file system's\n" -" [root directory](#root-directory),\n" -" and begin with either \"/\" (on Unix) or \"\\\\\" (on Microsoft Windows).\n" -" See also: [relative path](#relative-path)." - -#: shell-novice/reference.md:36 -msgid "" -"argument\n" -": A value given to a function or program when it runs.\n" -" The term is often used interchangeably (and inconsistently) with [parameter](#parameter)." -msgstr "" -"argument\n" -": A value given to a function or program when it runs.\n" -" The term is often used interchangeably (and inconsistently) with [parameter](#parameter)." - -#: shell-novice/reference.md:40 -msgid "" -"command shell\n" -": See [shell](#shell)" -msgstr "" -"command shell\n" -": See [shell](#shell)" - -#: shell-novice/reference.md:43 -msgid "" -"command-line interface\n" -": A user interface based on typing commands,\n" -" usually at a [REPL](#read-evaluate-print-loop).\n" -" See also: [graphical user interface](#graphical-user-interface)." -msgstr "" -"command-line interface\n" -": A user interface based on typing commands,\n" -" usually at a [REPL](#read-evaluate-print-loop).\n" -" See also: [graphical user interface](#graphical-user-interface)." - -#: shell-novice/reference.md:48 -msgid "" -"comment\n" -": A remark in a program that is intended to help human readers understand what is going on,\n" -" but is ignored by the computer.\n" -" Comments in Python, R, and the Unix shell start with a `#` character and run to the end of the line;\n" -" comments in SQL start with `--`,\n" -" and other languages have other conventions." -msgstr "" -"comment\n" -": A remark in a program that is intended to help human readers understand what is going on,\n" -" but is ignored by the computer.\n" -" Comments in Python, R, and the Unix shell start with a `#` character and run to the end of the line;\n" -" comments in SQL start with `--`,\n" -" and other languages have other conventions." - -#: shell-novice/reference.md:56 -msgid "" -"current working directory\n" -": The directory that [relative paths](#relative-path) are calculated from;\n" -" equivalently,\n" -" the place where files referenced by name only are searched for.\n" -" Every [process](#process) has a current working directory.\n" -" The current working directory is usually referred to using the shorthand notation `.` (pronounced \"dot\")." -msgstr "" -"current working directory\n" -": The directory that [relative paths](#relative-path) are calculated from;\n" -" equivalently,\n" -" the place where files referenced by name only are searched for.\n" -" Every [process](#process) has a current working directory.\n" -" The current working directory is usually referred to using the shorthand notation `.` (pronounced \"dot\")." - -#: shell-novice/reference.md:63 -msgid "" -"file system\n" -": A set of files, directories, and I/O devices (such as keyboards and screens).\n" -" A file system may be spread across many physical devices,\n" -" or many file systems may be stored on a single physical device;\n" -" the [operating system](#operating-system) manages access." -msgstr "" -"file system\n" -": A set of files, directories, and I/O devices (such as keyboards and screens).\n" -" A file system may be spread across many physical devices,\n" -" or many file systems may be stored on a single physical device;\n" -" the [operating system](#operating-system) manages access." - -#: shell-novice/reference.md:69 -msgid "" -"filename extension\n" -": The portion of a file's name that comes after the final \".\" character.\n" -" By convention this identifies the file's type:\n" -" `.txt` means \"text file\", `.png` means \"Portable Network Graphics file\",\n" -" and so on. These conventions are not enforced by most operating systems:\n" -" it is perfectly possible (but confusing!) to name an MP3 sound file `homepage.html`.\n" -" Since many applications use filename extensions to identify the [MIME type](#mime-type) of the file,\n" -" misnaming files may cause those applications to fail." -msgstr "" -"filename extension\n" -": The portion of a file's name that comes after the final \".\" character.\n" -" By convention this identifies the file's type:\n" -" `.txt` means \"text file\", `.png` means \"Portable Network Graphics file\",\n" -" and so on. These conventions are not enforced by most operating systems:\n" -" it is perfectly possible (but confusing!) to name an MP3 sound file `homepage.html`.\n" -" Since many applications use filename extensions to identify the [MIME type](#mime-type) of the file,\n" -" misnaming files may cause those applications to fail." - -#: shell-novice/reference.md:78 -msgid "" -"filter\n" -": A program that transforms a stream of data.\n" -" Many Unix command-line tools are written as filters:\n" -" they read data from [standard input](#standard-input),\n" -" process it, and write the result to [standard output](#standard-output)." -msgstr "" -"filter\n" -": A program that transforms a stream of data.\n" -" Many Unix command-line tools are written as filters:\n" -" they read data from [standard input](#standard-input),\n" -" process it, and write the result to [standard output](#standard-output)." - -#: shell-novice/reference.md:84 -msgid "" -"flag\n" -": A terse way to specify an option or setting to a command-line program.\n" -" By convention Unix applications use a dash followed by a single letter,\n" -" such as `-v`, or two dashes followed by a word, such as `--verbose`,\n" -" while DOS applications use a slash, such as `/V`.\n" -" Depending on the application, a flag may be followed by a single argument, as in `-o /tmp/output.txt`." -msgstr "" -"flag\n" -": A terse way to specify an option or setting to a command-line program.\n" -" By convention Unix applications use a dash followed by a single letter,\n" -" such as `-v`, or two dashes followed by a word, such as `--verbose`,\n" -" while DOS applications use a slash, such as `/V`.\n" -" Depending on the application, a flag may be followed by a single argument, as in `-o /tmp/output.txt`." - -#: shell-novice/reference.md:91 -msgid "" -"for loop\n" -": A loop that is executed once for each value in some kind of set, list, or range.\n" -" See also: [while loop](#while-loop)." -msgstr "" -"for loop\n" -": A loop that is executed once for each value in some kind of set, list, or range.\n" -" See also: [while loop](#while-loop)." - -#: shell-novice/reference.md:95 -msgid "" -"graphical user interface\n" -": A user interface based on selecting items and actions from a graphical display,\n" -" usually controlled by using a mouse.\n" -" See also: [command-line interface](#command-line-interface)." -msgstr "" -"graphical user interface\n" -": A user interface based on selecting items and actions from a graphical display,\n" -" usually controlled by using a mouse.\n" -" See also: [command-line interface](#command-line-interface)." - -#: shell-novice/reference.md:100 -msgid "" -"home directory\n" -": The default directory associated with an account on a computer system.\n" -" By convention, all of a user's files are stored in or below her home directory." -msgstr "" -"home directory\n" -": The default directory associated with an account on a computer system.\n" -" By convention, all of a user's files are stored in or below her home directory." - -#: shell-novice/reference.md:104 -msgid "" -"loop\n" -": A set of instructions to be executed multiple times. Consists of a [loop body](#loop-body) and (usually) a\n" -" condition for exiting the loop. See also [for loop](#for-loop) and [while loop](#while-loop)." -msgstr "" -"loop\n" -": A set of instructions to be executed multiple times. Consists of a [loop body](#loop-body) and (usually) a\n" -" condition for exiting the loop. See also [for loop](#for-loop) and [while loop](#while-loop)." - -#: shell-novice/reference.md:108 -msgid "" -"loop body\n" -": The set of statements or commands that are repeated inside a [for loop](#for-loop)\n" -" or [while loop](#while-loop)." -msgstr "" -"loop body\n" -": The set of statements or commands that are repeated inside a [for loop](#for-loop)\n" -" or [while loop](#while-loop)." - -#: shell-novice/reference.md:112 -msgid "" -"MIME type\n" -": MIME (Multi-Purpose Internet Mail Extensions) types describe different file types for exchange on the Internet,\n" -" for example images, audio, and documents." -msgstr "" -"MIME type\n" -": MIME (Multi-Purpose Internet Mail Extensions) types describe different file types for exchange on the Internet,\n" -" for example images, audio, and documents." - -#: shell-novice/reference.md:116 -msgid "" -"operating system\n" -": Software that manages interactions between users, hardware, and software [processes](#process). Common\n" -" examples are Linux, OS X, and Windows." -msgstr "" -"operating system\n" -": Software that manages interactions between users, hardware, and software [processes](#process). Common\n" -" examples are Linux, OS X, and Windows." - -#: shell-novice/reference.md:120 -msgid "" -"orthogonal\n" -": To have meanings or behaviors that are independent of each other.\n" -" If a set of concepts or tools are orthogonal,\n" -" they can be combined in any way." -msgstr "" -"orthogonal\n" -": To have meanings or behaviors that are independent of each other.\n" -" If a set of concepts or tools are orthogonal,\n" -" they can be combined in any way." - -#: shell-novice/reference.md:125 -msgid "" -"parameter\n" -": A variable named in a function's declaration that is used to hold a value passed into the call.\n" -" The term is often used interchangeably (and inconsistently) with [argument](#argument)." -msgstr "" -"parameter\n" -": A variable named in a function's declaration that is used to hold a value passed into the call.\n" -" The term is often used interchangeably (and inconsistently) with [argument](#argument)." - -#: shell-novice/reference.md:129 -msgid "" -"parent directory\n" -": The directory that \"contains\" the one in question.\n" -" Every directory in a file system except the [root directory](#root-directory) has a parent.\n" -" A directory's parent is usually referred to using the shorthand notation `..` (pronounced \"dot dot\")." -msgstr "" -"parent directory\n" -": The directory that \"contains\" the one in question.\n" -" Every directory in a file system except the [root directory](#root-directory) has a parent.\n" -" A directory's parent is usually referred to using the shorthand notation `..` (pronounced \"dot dot\")." - -#: shell-novice/reference.md:134 -msgid "" -"path\n" -": A description that specifies the location of a file or directory within a [file system](#file-system).\n" -" See also: [absolute path](#absolute-path), [relative path](#relative-path)." -msgstr "" -"path\n" -": A description that specifies the location of a file or directory within a [file system](#file-system).\n" -" See also: [absolute path](#absolute-path), [relative path](#relative-path)." - -#: shell-novice/reference.md:139 -msgid "" -"pipe\n" -": A connection from the output of one program to the input of another.\n" -" When two or more programs are connected in this way, they are called a \"pipeline\"." -msgstr "" -"pipe\n" -": A connection from the output of one program to the input of another.\n" -" When two or more programs are connected in this way, they are called a \"pipeline\"." - -#: shell-novice/reference.md:143 -msgid "" -"process\n" -": A running instance of a program, containing code, variable values,\n" -" open files and network connections, and so on.\n" -" Processes are the \"actors\" that the [operating system](#operating-system) manages;\n" -" it typically runs each process for a few milliseconds at a time\n" -" to give the impression that they are executing simultaneously." -msgstr "" -"process\n" -": A running instance of a program, containing code, variable values,\n" -" open files and network connections, and so on.\n" -" Processes are the \"actors\" that the [operating system](#operating-system) manages;\n" -" it typically runs each process for a few milliseconds at a time\n" -" to give the impression that they are executing simultaneously." - -#: shell-novice/reference.md:151 -msgid "" -"prompt\n" -": A character or characters display by a [REPL](#read-evaluate-print-loop) to show that\n" -" it is waiting for its next command." -msgstr "" -"prompt\n" -": A character or characters display by a [REPL](#read-evaluate-print-loop) to show that\n" -" it is waiting for its next command." - -#: shell-novice/reference.md:155 -msgid "" -"quoting\n" -": (in the shell):\n" -" Using quotation marks of various kinds to prevent the shell from interpreting special characters.\n" -" For example, to pass the string `*.txt` to a program,\n" -" it is usually necessary to write it as `'*.txt'` (with single quotes)\n" -" so that the shell will not try to expand the `*` wildcard." -msgstr "" -"quoting\n" -": (in the shell):\n" -" Using quotation marks of various kinds to prevent the shell from interpreting special characters.\n" -" For example, to pass the string `*.txt` to a program,\n" -" it is usually necessary to write it as `'*.txt'` (with single quotes)\n" -" so that the shell will not try to expand the `*` wildcard." - -#: shell-novice/reference.md:162 -msgid "" -"read-evaluate-print loop\n" -": (REPL): A [command-line interface](#command-line-interface) that reads a command from the user,\n" -" executes it, prints the result, and waits for another command." -msgstr "" -"read-evaluate-print loop\n" -": (REPL): A [command-line interface](#command-line-interface) that reads a command from the user,\n" -" executes it, prints the result, and waits for another command." - -#: shell-novice/reference.md:166 -msgid "" -"redirect\n" -": To send a command's output to a file rather than to the screen or another command,\n" -" or equivalently to read a command's input from a file." -msgstr "" -"redirect\n" -": To send a command's output to a file rather than to the screen or another command,\n" -" or equivalently to read a command's input from a file." - -#: shell-novice/reference.md:170 -msgid "" -"regular expression\n" -": A pattern that specifies a set of character strings.\n" -" REs are most often used to find sequences of characters in strings." -msgstr "" -"regular expression\n" -": A pattern that specifies a set of character strings.\n" -" REs are most often used to find sequences of characters in strings." - -#: shell-novice/reference.md:174 -msgid "" -"relative path\n" -": A [path](#path) that specifies the location of a file or directory\n" -" with respect to the [current working directory](#current-working-directory).\n" -" Any path that does not begin with a separator character (\"/\" or \"\\\\\") is a relative path.\n" -" See also: [absolute path](#absolute-path)." -msgstr "" -"relative path\n" -": A [path](#path) that specifies the location of a file or directory\n" -" with respect to the [current working directory](#current-working-directory).\n" -" Any path that does not begin with a separator character (\"/\" or \"\\\\\") is a relative path.\n" -" See also: [absolute path](#absolute-path)." - -#: shell-novice/reference.md:180 -msgid "" -"root directory\n" -": The top-most directory in a [file system](#file-system).\n" -" Its name is \"/\" on Unix (including Linux and Mac OS X) and \"\\\\\" on Microsoft Windows." -msgstr "" -"root directory\n" -": The top-most directory in a [file system](#file-system).\n" -" Its name is \"/\" on Unix (including Linux and Mac OS X) and \"\\\\\" on Microsoft Windows." - -#: shell-novice/reference.md:184 -msgid "" -"shell\n" -": A [command-line interface](#cli) such as Bash (the Bourne-Again Shell)\n" -" or the Microsoft Windows DOS shell\n" -" that allows a user to interact with the [operating system](#operating-system)." -msgstr "" -"shell\n" -": A [command-line interface](#cli) such as Bash (the Bourne-Again Shell)\n" -" or the Microsoft Windows DOS shell\n" -" that allows a user to interact with the [operating system](#operating-system)." - -#: shell-novice/reference.md:189 -msgid "" -"shell script\n" -": A set of [shell](#shell) commands stored in a file for re-use.\n" -" A shell script is a program executed by the shell;\n" -" the name \"script\" is used for historical reasons." -msgstr "" -"shell script\n" -": A set of [shell](#shell) commands stored in a file for re-use.\n" -" A shell script is a program executed by the shell;\n" -" the name \"script\" is used for historical reasons." - -#: shell-novice/reference.md:195 -msgid "" -"standard input\n" -": A process's default input stream.\n" -" In interactive command-line applications,\n" -" it is typically connected to the keyboard;\n" -" in a [pipe](#pipe),\n" -" it receives data from the [standard output](#standard-output) of the preceding process." -msgstr "" -"standard input\n" -": A process's default input stream.\n" -" In interactive command-line applications,\n" -" it is typically connected to the keyboard;\n" -" in a [pipe](#pipe),\n" -" it receives data from the [standard output](#standard-output) of the preceding process." - -#: shell-novice/reference.md:203 -msgid "" -"standard output\n" -": A process's default output stream.\n" -" In interactive command-line applications,\n" -" data sent to standard output is displayed on the screen;\n" -" in a [pipe](#pipe),\n" -" it is passed to the [standard input](#standard-input) of the next process." -msgstr "" -"standard output\n" -": A process's default output stream.\n" -" In interactive command-line applications,\n" -" data sent to standard output is displayed on the screen;\n" -" in a [pipe](#pipe),\n" -" it is passed to the [standard input](#standard-input) of the next process." - -#: shell-novice/reference.md:211 -msgid "" -"sub-directory\n" -": A directory contained within another directory." -msgstr "" -"sub-directory\n" -": A directory contained within another directory." - -#: shell-novice/reference.md:214 -msgid "" -"tab completion\n" -": A feature provided by many interactive systems in which\n" -" pressing the Tab key triggers automatic completion of the current word or command." -msgstr "" -"tab completion\n" -": A feature provided by many interactive systems in which\n" -" pressing the Tab key triggers automatic completion of the current word or command." - -#: shell-novice/reference.md:218 -msgid "" -"variable\n" -": A name in a program that is associated with a value or a collection of values." -msgstr "" -"variable\n" -": A name in a program that is associated with a value or a collection of values." - -#: shell-novice/reference.md:221 -msgid "" -"while loop\n" -": A loop that keeps executing as long as some condition is true.\n" -" See also: [for loop](#for-loop)." -msgstr "" -"while loop\n" -": A loop that keeps executing as long as some condition is true.\n" -" See also: [for loop](#for-loop)." - -#: shell-novice/reference.md:225 -msgid "" -"wildcard\n" -": A character used in pattern matching.\n" -" In the Unix shell,\n" -" the wildcard `*` matches zero or more characters,\n" -" so that `*.txt` matches all files whose names end in `.txt`." -msgstr "" -"wildcard\n" -": A character used in pattern matching.\n" -" In the Unix shell,\n" -" the wildcard `*` matches zero or more characters,\n" -" so that `*.txt` matches all files whose names end in `.txt`." - -# header -#: shell-novice/reference.md:231 -msgid "## External references" -msgstr "## External references" - -# header -#: shell-novice/reference.md:233 -msgid "### Opening a terminal" -msgstr "### Opening a terminal" - -# unordered list -#: shell-novice/reference.md:234 -msgid "* [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)" -msgstr "* [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)" - -# unordered list -#: shell-novice/reference.md:235 -msgid "* [Git for Windows](https://git-for-windows.github.io/)" -msgstr "* [Git for Windows](https://git-for-windows.github.io/)" - -# unordered list -#: shell-novice/reference.md:236 -msgid "* [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)" -msgstr "* [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)" - -# unordered list -#: shell-novice/reference.md:237 -msgid "* [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)" -msgstr "* [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)" - -# unordered list -#: shell-novice/reference.md:238 -msgid "* [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)" -msgstr "* [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)" - -# unordered list -#: shell-novice/reference.md:239 -msgid "* [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" -msgstr "* [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" - -# header -#: shell-novice/reference.md:241 -msgid "### Manuals" -msgstr "### Manuals" - -# unordered list -#: shell-novice/reference.md:242 -msgid "* [GNU manuals](http://www.gnu.org/manual/manual.html)" -msgstr "* [GNU manuals](http://www.gnu.org/manual/manual.html)" - -# unordered list -#: shell-novice/reference.md:243 -msgid "* [Core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html)" -msgstr "* [Core GNU utilities](http://www.gnu.org/software/coreutils/manual/coreutils.html)" - -# header -#: shell-novice/reference.md:245 -msgid "### Miscellaneous" -msgstr "### Miscellaneous" - -# unordered list -#: shell-novice/reference.md:246 -msgid "* [North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre)" -msgstr "* [North Pacific Gyre](http://en.wikipedia.org/wiki/North_Pacific_Gyre)" - -# unordered list -#: shell-novice/reference.md:247 -msgid "* [Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch)" -msgstr "* [Great Pacific Garbage Patch](http://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch)" - -# unordered list -#: shell-novice/reference.md:248 -msgid "* ['Ensuring the longevity of digital information' by Jeff Rothenberg](http://www.clir.org/pubs/archives/ensuring.pdf)" -msgstr "* ['Ensuring the longevity of digital information' by Jeff Rothenberg](http://www.clir.org/pubs/archives/ensuring.pdf)" - -# unordered list -#: shell-novice/reference.md:249 -msgid "* [Computer error haikus](http://wiki.c2.com/?ComputerErrorHaiku)" -msgstr "* [Computer error haikus](http://wiki.c2.com/?ComputerErrorHaiku)" - -# Front Matter -#: shell-novice/setup.md:1 -msgid "" -"---\n" -"layout: page\n" -"title: Setup\n" -"root: .\n" -"---" -msgstr "" -"---\n" -"layout: page\n" -"title: Setup\n" -"root: .\n" -"---" - -#: shell-novice/setup.md:7 -msgid "You need to download some files to follow this lesson:" -msgstr "You need to download some files to follow this lesson:" - -# ordered list -#: shell-novice/setup.md:9 -msgid "1. Download [data-shell.zip]({{ page.root }}/data/data-shell.zip) and move the file to your Desktop." -msgstr "1. Download [data-shell.zip]({{ page.root }}/data/data-shell.zip) and move the file to your Desktop." - -# ordered list -#: shell-novice/setup.md:10 -msgid "2. Unzip/extract the file (ask your instructor if you need help with this step). You should end up with a new folder called **data-shell** on your Desktop." -msgstr "2. Unzip/extract the file (ask your instructor if you need help with this step). You should end up with a new folder called **data-shell** on your Desktop." - -# ordered list -#: shell-novice/setup.md:11 -msgid "3. Open a terminal and type `cd`, then press the Enter key. That last step will make sure you start with your home folder as your working directory." -msgstr "3. Open a terminal and type `cd`, then press the Enter key. That last step will make sure you start with your home folder as your working directory." - -#: shell-novice/setup.md:13 -msgid "In the lesson, you will find out how to access the data in this folder. " -msgstr "In the lesson, you will find out how to access the data in this folder. " - -# blockquote, which can be cascaded -#: shell-novice/setup.md:15 -msgid "> ## Where to type commands: How to open a new shell" -msgstr "> ## Where to type commands: How to open a new shell" - -# blockquote, which can be cascaded -#: shell-novice/setup.md:16 -msgid "> The `shell` is a program that enables us to send commands to the computer and receive output. It is also referred to as the `terminal` or `command line`." -msgstr "> The `shell` is a program that enables us to send commands to the computer and receive output. It is also referred to as the `terminal` or `command line`." - -#: shell-novice/setup.md:17 -msgid "" -">\n" -"> Some computers include a default Unix Shell program. \n" -"> The steps below describe some methods for identifying and opening a Unix Shell program if you already have one installed. \n" -"> There are also options for identifying and downloading a Unix Shell program, a Linux/UNIX emulator, or a program to access a UNIX server. \n" -">\n" -"> If none of the options below address your circumstances, try an online search for: UNIX shell [your computer model] [your operating system].\n" -">\n" -"> ### Linux\n" -"> The default shell for Linux operating systems is usually Bash.\n" -"> On most versions of Linux, it is accessible by running the Terminal program,\n" -"> which can be found via the applications menu or the search bar. \n" -"> If your machine is set up to use something other than bash, you can run it by opening a terminal and typing `bash`.\n" -">\n" -"> ### Mac OS\n" -"> For a Mac computer, the default Unix Shell is Bash,\n" -"> and it is available via the Terminal Utilities program within your Applications folder.\n" -">\n" -"> To open Terminal, try one or both of the following:\n" -"> * Go to your Applications. Within Applications, open the Utilities folder. Locate Terminal in the Utilities folder and open it.\n" -"> * Use the Mac ‘Spotlight’ computer search function. Search for: Terminal and press [Enter] - this will open Terminal.\n" -">\n" -"> #### Reference \n" -"> [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)\n" -">\n" -"> ### Windows\n" -"> Computers with Windows operating systems do not automatically have a Unix Shell program installed.\n" -"> In this lesson, we encourage you to use an emulator included in Git for Windows, \n" -"> which gives you access to both Bash shell commands and Git. \n" -"> If you are attending a SWC session, it is likely you have already received instructions on how to install Git for Windows.\n" -">\n" -"> Once installed, you can open a terminal by running the program Git Bash from the Windows start menu.\n" -">\n" -"> Other solutions are available for running Bash commands on Windows systems. \n" -"> There is now a Bash shell command-line tool available for Windows 10. \n" -"> Additionally, you can run Bash commands on a remote UNIX computer or server from your Windows machine. \n" -"> This can be done through a Secure Shell (SSH) client. \n" -"> One such client available for free for Windows computers is PuTTY. \n" -"> See the reference below for information on installing and using PuTTY, \n" -"> using the Windows 10 command-line tool, or installing and using a UNIX/Linux emulator.\n" -">\n" -"> #### Reference\n" -"> * [Git for Windows](https://git-for-windows.github.io/)\n" -"> * [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)\n" -"> * [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)\n" -"> * [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)\n" -"> * [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" -msgstr "" -">\n" -"> Some computers include a default Unix Shell program. \n" -"> The steps below describe some methods for identifying and opening a Unix Shell program if you already have one installed. \n" -"> There are also options for identifying and downloading a Unix Shell program, a Linux/UNIX emulator, or a program to access a UNIX server. \n" -">\n" -"> If none of the options below address your circumstances, try an online search for: UNIX shell [your computer model] [your operating system].\n" -">\n" -"> ### Linux\n" -"> The default shell for Linux operating systems is usually Bash.\n" -"> On most versions of Linux, it is accessible by running the Terminal program,\n" -"> which can be found via the applications menu or the search bar. \n" -"> If your machine is set up to use something other than bash, you can run it by opening a terminal and typing `bash`.\n" -">\n" -"> ### Mac OS\n" -"> For a Mac computer, the default Unix Shell is Bash,\n" -"> and it is available via the Terminal Utilities program within your Applications folder.\n" -">\n" -"> To open Terminal, try one or both of the following:\n" -"> * Go to your Applications. Within Applications, open the Utilities folder. Locate Terminal in the Utilities folder and open it.\n" -"> * Use the Mac ‘Spotlight’ computer search function. Search for: Terminal and press [Enter] - this will open Terminal.\n" -">\n" -"> #### Reference \n" -"> [How to Use Terminal on a Mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)\n" -">\n" -"> ### Windows\n" -"> Computers with Windows operating systems do not automatically have a Unix Shell program installed.\n" -"> In this lesson, we encourage you to use an emulator included in Git for Windows, \n" -"> which gives you access to both Bash shell commands and Git. \n" -"> If you are attending a SWC session, it is likely you have already received instructions on how to install Git for Windows.\n" -">\n" -"> Once installed, you can open a terminal by running the program Git Bash from the Windows start menu.\n" -">\n" -"> Other solutions are available for running Bash commands on Windows systems. \n" -"> There is now a Bash shell command-line tool available for Windows 10. \n" -"> Additionally, you can run Bash commands on a remote UNIX computer or server from your Windows machine. \n" -"> This can be done through a Secure Shell (SSH) client. \n" -"> One such client available for free for Windows computers is PuTTY. \n" -"> See the reference below for information on installing and using PuTTY, \n" -"> using the Windows 10 command-line tool, or installing and using a UNIX/Linux emulator.\n" -">\n" -"> #### Reference\n" -"> * [Git for Windows](https://git-for-windows.github.io/)\n" -"> * [How to Install Bash shell command-line tool on Windows 10](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10)\n" -"> * [Install and Use the Linux Bash Shell on Windows 10](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)\n" -"> * [Using the Windows 10 Bash Shell](https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/)\n" -"> * [Using a UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client (Putty)](http://faculty.smu.edu/reynolds/unixtut/windows.html)" From da5427515c2eca31424786894ff30f9e96024678 Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Wed, 29 Jul 2020 16:50:03 +0900 Subject: [PATCH 41/59] Update .gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 680c47ee..f4957a17 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,6 +22,5 @@ [submodule "po4gitbook"] path = po4gitbook url = https://github.com/swcarpentry-i18n/po4gitbook.git -[submodule "po/git-novice"] path = po/git-novice url = https://github.com/swcarpentry/git-novice.git From eb1cf7b7644e38575aa467aa8d2831c8a6cae34d Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Wed, 29 Jul 2020 16:52:42 +0900 Subject: [PATCH 42/59] Update .gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f4957a17..1729e17d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,5 +22,4 @@ [submodule "po4gitbook"] path = po4gitbook url = https://github.com/swcarpentry-i18n/po4gitbook.git - path = po/git-novice url = https://github.com/swcarpentry/git-novice.git From 4800328705db133b437d53ea4427407fa7caa085 Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Wed, 29 Jul 2020 16:52:49 +0900 Subject: [PATCH 43/59] Update .gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 1729e17d..f9be339e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,4 +22,3 @@ [submodule "po4gitbook"] path = po4gitbook url = https://github.com/swcarpentry-i18n/po4gitbook.git - url = https://github.com/swcarpentry/git-novice.git From 2227f8ca8f526a86798d22cf088b403062d0b36c Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Wed, 29 Jul 2020 17:15:07 +0900 Subject: [PATCH 44/59] revert changes not needed for translations --- po/git-novice | 1 - po/shell-novice.ja.mo | Bin 396995 -> 396265 bytes 2 files changed, 1 deletion(-) delete mode 160000 po/git-novice diff --git a/po/git-novice b/po/git-novice deleted file mode 160000 index 08b3bae1..00000000 --- a/po/git-novice +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 08b3bae10aa2b4ce96cffbbde533da2374c57d44 diff --git a/po/shell-novice.ja.mo b/po/shell-novice.ja.mo index 860ad344f8d48d08844b0e2d6d3dbd5398f9d6da..8d9c1b26f509cddb7e14fa0c8fdff9ee04aa90f8 100644 GIT binary patch delta 7496 zcmZA5d4Nt;AHeb7%spo?mXNKo490Gl83r@9$ugEEW0@EvsTql}gpln)-jpParHt(@ zVJMN93L#~UWQoS|GDK2Hyte55{_c7HdjI;|-+9hC_ndRjIrrRW=i+jg7nEB!w|pQw zM5IM+PiA9Y9Z$N4ieyH4GM{*7eNR@3NUs=A`Voi5dJ;pN-oTU2I3LsS5^mx5#D<9!ILNPwWeM`Zt=tBW}XxxVSRH?)@t0slZ802 zr6+x9kWKU?o!>KBdGb5y`&xVQ2Ie+Oj=1(2PoBZM-92f-?+mdeR7oquw9~ zC*lz-hFyDkQXKnX861w~@U39{0hT5H5)0#xSPD<$V|XJN7wPRuRpLNpE~<0U7OP=q z@P|2Al6Vt7f_pI>f5y^y0rdv=urh`{>q!Z$iA690wOl)V0(+pA8-d#Jw~+b*vWyGu z*&5WL{0g;)c^HpZPWz|68=i(*VF2~f%tyW9@?iS*pvN&l`c+KAARM4hDJD@JJ9@qlcVMn}%Z870RcjHMoig*WB!6xaR zRK(u+B#y;yxCOO=#WNU@NG{rOp)JhBp12%m;6r=`-|p{87Ct~7nb|LS@;d&ElhyKhyd%+vVKR?qcD+I z$9uAbAMQ>;GQKyB^^1+)b`5)Hrkixzu`U%}Lft1yz3bNXOQ;=Kjp=wA8(^zhZiGi+ zZQ`}qJ%kYqa8ZYZ=s9lvKa09iOh=s)JFzcb#%%16<$C-J>N6}g*A3}Y*ot@<_Qwra z6Ca=F$y{uWF?a%X4usElt0C|l7oXDOGgugBX0v>7;ZmMGE!^}WLy9#&Vh&*P3Qtn; z>`G4z#^vxx7{P?qp8UYG9`h*;r+oX*JlRJ)WE1sb{Fj~-z_y#+7X9>Aw&qaQU$3t{ z@hDJw2g?N?`_7Zc8S?nO?xm6Xz1#Z_<0@L-_@F0YRCE@LlmF5oPp*-E=cp&gY0$67 zJZXm8kMror_uzzk6x~jG@*?@Zz;{V6f69}iA*{cT&oDG3Og`($d2YNRpV>^07F_h? z2o-&C#gjOk@rNhhQo%P@=?U?)Yo5%)cdvW$6X_8*ctq558|!1%Ew_qx-liiowDTQL z{zd+Se|z#M8&2v&Rul72280{op0ci}k@H%xgpqT^qe~enfIZ6@`GUw)YPtN=>KZvi`iD_Q0{Pre21dr?)i@)ANFUV1$Ub^-97i%TA2c`8mkP?ZHZlcAx1l2P-)n0mhj?sz zBTs5Q9gROC{gaLSN_uFD@n6qZIvfA>ey58G$Xu3PR#zhrxKYiXMv9ZMdM_j8si1Lh zBNJ(PY9AwIx$%+bjlZm}WEiPMzRvxPMCc7)GD1r!RT5clh+io6e!`7o7L{6e^GJ2WS_T)Zl%O9QX^2cE{;&!O#gu$r!CZRUyJ=6|;j#|$F)DgRYTECg&mkUT0E;K_N z>J5@nGYmm(&B7s zLMtvZ*BOgiFb#EN2BTIGKrJ{QwI^#)dw3A_Xmts-!6EZp{)*U;I1Y7$2BN;~CSV-S z#LC=XzU87BUPP^^>U`rLM4F?%wUSYLJOTB_t5DC1dr*7yUu05C?FGg^a>Zal;wMo@ zq9f`YdJZFSLNI*^2DE3NaiQ)F{%|%J-$WhK!tXiD1+9k3q{m_}3}83RLw)x3-Z%bR zu_JaMUX1$kx`fZ;>kEza!3zsn|5~tBwkt3nb%-uwE4+s+UunL`_$Qv$$TF6hs6EcY z#<&o5&KyQPcw9$4s5Dz_{3F~{oKCzKH9eJgydL!yEn)q);9?C4_3<~-$31JTW>V-9TlW+ zGIENzcCL|lEbyg~lcYcSm630;!e&O4^nC0=Tym?Cjl=_S0CB`Nf2$A3TU_YuUbx-J zC-@!e2#na_w&3J%T!l;U3N3zdr;!m7;|5rFf1}X|U>}F*j%pu;4b1>rwdp`y5;9}zYM~(a!-#^BB zr=nRu@si^APfoBkW8FO0ke(;q?C*PuWlVYwE~8xDX6tjC9>e|C{MgX=HRL&~-O)kq@ol*`O+^6kVa#D#x1{_%Y# zrW4B_Mvg-U>i*IED(hccHi(N!xagXjTowK_GL{U}aX8u=Zf6{Wxx`CQpKbTQjI1Gk zF z{^xenhi+D%#6_fk^N-uv`m%_gBOZXOaX0GDI6TDq%X1Fu&bJqLaHG?x`ImauU;htL zM?T2}tp91X%UCKAsbsCc{x6}<+VWx6|MD4$6{)CT0V{8kUZbFuk8mBXCB1tgE9=k} zw*J9nQxPj6#Al0I8A`tVV%FbBx;|q4k>q?ZX4xBh4GM$~7vA9ct(m9SEe3U*)s zua~s`&Ni%+_5Z=xg8GP#mL{FwQ_5KXJ0Y86QV-_9ef*yEZjUn}7*XB|e<4VZ3RWiY z`}zng*C`*UU)B15FhoRJiQ|W*I1rCjxBmG)v6l5uyKQS*{~11A$I3JcR;^1d(8d^yrVPl;2UmAZmvND-C zrLpz5<{z6_{|l*jy!Bru&G0T2zJWz)=%fTInK-kVl?c-Bx3IE|^5t970Nk2rWfoL#V`Tst-%qms))?BJXG6Rab%ROjXk{MpB0NtVo9v!(nWwG% zNu1cp&5_s?>%XLS;RMo4bhiH1`!4FLN$XVCZlwhA{tPQ~ z@pOOde_9P6;3nfws12+#(E4w`ii6xEsD~-!uaapc9ET6K0l&ftL#*tiK;}^E9}uF4 zSvgHS8`tB|SFA)*pz?4lZxAPqa1|cF2gEx@vMl+1+pBKbwja%MBVL9{jO^txZq7uH zv;GEEd%Ts+lsh|~^{*KhO|br3>z9d4Dt=f^y1wVXK;4+G;jfrC$u)52WF}hyMrw+c zd!)C0%gP;YlsKJ9Mt$+`SQ$+j{g=UZt*d;pWM$S!U%n1uA`L{jb%s%dP*VviKu6^gHk;es90R`mgIs zE8R|a0CkW5VU^p+KFYDOg1F{t>mTcXK-wpN;!3=Qdv*OUUgIXyOCMX=#t*N3;+A3j zS~ecyGpHNPMbxb~X&oa#`~zzKQlDA>WAZ3w5f9y9C6?d4&)w{Aw9(2w(of+QT)D~m zr|k4xE5r0HFp&#AI9$Vmc1kK?{^>36Uk@sOR?|9qc@FA)EQ%dq>mJX*Ys0bNcLzGDkTv&(HLub_T- zEJUqnKUT#H7>NaUyS+auXb+4beKP6?%m&mCngggk58vbVfwEYaxCZLqcBy+<|61Ye zB$UNfSOd3XW&9NfVfbF_|0^~MHUFnr1&^ZUyN!Bme{7%izb87OZfqZ*eot&geKZHL zJpO?Z7`~r%tv#%>-`NJ!i2Gnq+=QL6`1fw_?uR;b`%!z+<$!yAPs9k~xu^}?h}x07 zprHp{dTp#kdJ1Yoh6aKcGf;;-2X)BuP){(Ig5F2{ka*+=CJk0X9kE!{k?4pz=?0^A zXlgKCj5-3JV+4MOb?_o;`9R4-?nbpSfrJ*Q6}^V_aTZ44cGQjK9O@1J30m$)w`0bj zmTQU4u{&x9=AxEcgbarZVSj`I(u#}HBn(8IWRp;bXgO+2zYTglX!#@Vk+jDq z{Qf@X;$iHD(~r8zbq3!fE_%!zy;k6C;%lf4oBR_mJ6-?txX@>{8ughTMxCAiU^>=2 zZvC&^EZj%Z7pcNm{W z5;r1We;ek11?Qul{|ASKNkE4iZSmBS9-JRyfQ*a#cZ{ydjJ3c delta 9443 zcmaLb37m~(-@x%d_k9gbk0L2Tj;)Acj9rqDy=W}iLqilsmZ<2=IY-KtWf(hy#+n(~ z27@U{NwP(SJn76vMU_Wu6YeY|b&^L{=)zV~(A*S_9oF3d0e&eGDG=9cp(7ZPc9 zpChyJcnwFo7Zyo~aU_LsR&7Vth)8@LM+OkSj&%t4sq08*d<}cxzi~J38`X2<0lZe< zk*Zj?p(7))XCp@@lJ0}Xj#MMuwuvJT;j{NUe!0erElnM{iHLO%IFhd6W{xbvfe$+J z1P%HX6L{aZg(F`Rzpteuw-TSx%8^Ngvs=>vY}Lk*f06DKZXz6R>&Pyg+s=`x*r~lE zck=!;wk3SEgWr*pMBLxek!&pSs3Xr)@Uc#g#FL;yydzt187{~8E{+t_j949|t0NWQ zJ}i&zQAc11w#U`o9O;Hvx;xT{_icJO(gKq(7T@vn(1wTaF$SCVbff`3jatD9dA)Y5P2~b zZzG(Jx8mCvjmNMQo<*(TDpthbumt-0Fa;Qgn(sj@i=9yOJ%ift08*Y`7Vw}wTZKB5 zn^Ajs92;X8wFl+CORu=NvOhH2QG@Nv{3F4^A^AJ#x^Ku2tjPhtan9koMeup$18ow4o! zM>^mntfehF%7YI5@2EYfI?%Ij#D`F~Sto3UYq34%BguFTb!4VI)}k)9_+_QF^msj z+z78nBe53Y&8X?mqps>Z620Bi1a(^`pl-JyPIWk6u!hST8qNN1Vc16F=us4FVS*#e zcu^;WBs}^G`xg_Zc@2B_HE+@Vh&3s&!c6a+=!h){FGuabmzaR1W;s$9UqBt|Cu)x)6O{ZB&VB27=xU13=I)Gzi=c>#b15NYNkg= z@*FuqLEnDmNPXP@jU)Rh;QA$cLOA=fBeU?mZyh;Be2=S45#`kW&XL-9=$f~Se*O;~ zp`ow-=*Y{YkNVY-k{meGe`7bX{vJnUdtb2jFwZ~OP^iSm2;#&6XS~i zODfz|+m*d!TpH)fLBf6Nx-tRpY2eB;#II`P$_Mn|*2b=kVPsA};K~ye(5a;>LCk1H zL8Oms?aDgBo7=kbke1WlwIi~uqbmi(H|gZs>$&n{uD#x4<6XbZW!oK!cjZ?q>fh6q z;w0?X%aw8zkl5RmmuUI)zOLL!#WxRd?Y62s*p=#}dlh|J;Zv@VRZa|X$ny#tnWRG~*G}dpr;I zw);Jj;P#oWJpmh`?%&5z51uKg`L?6pc85_Lb^-OoD>=)x2TdK+_kB>yACFaVb|mcI z&O-?zj-a;mJZb^Ip;l0Cw%3!os4ee+ntnJ|ML+6yLK_Mpb3VfRxl}&U^Qxk_M;B*dDIH8p&p@SlRaCb=6e>|Rg#RFJ{5H&x1yGR z5cMej0=1#H&sCY+nmlO1ts*{+nsF9tPt#Bf$VAQf5$fFMq4qFpo@+m?DxfyFF>3nm zSPzGzj?hZf51VaR9}i$fU0lEL&=l`Z@e1mVw-6qSdTUKW?eR9$ioZbpR+RZ(k7^-{ zS_Yziat+0z_&n-J1W|9%6!hV?Nc<`EYfCTkpcY!-Whjjru8BINEhBc0*cUqz|1|c( zOzeWUE%fGoFvb%OVmmyEdU;h?W4}Sw!(8b6)SVMYkWHD2>-B*{jXmvX1Oc1 zu@&l^jX^DV9qJE-^QimvzEszKIz5Uy0xzQ$bR2c0&ZDlKOQ@f6&I)fzN}z@-qIRe@ z&M3s?Q>8?DEIrus@&2VKbCz}5}4^@bGe6wpmu_oYnG9E(h zd8@6ibS69l^{73!&6RhF|9!hFX9>TX=}Kce%6{CD#fTC=akp3T#yzfV zBW(7%GKBY8+4iXSOO?00)m{H>S2psZKk5kFvd=q$^HB?I{EjPM(c<55GzDEe;7T{* z`@PSU5Z;OgzdGoR%oT1do!WYbTX zBi#LjD|1jj=Ike9GA<>Ua?+I_u-+;5I|bGFgiDI|Z9n5^#`jKp4f+0zxB9Q2Wg8RU z>T_38$v5^KmlOH!__r&QbpMY$&%P$XHPjxI3cE6m__8_PT&+R9eLCj4@*DAwvz@}%t?K7~cV!9jec3!k@jCWHr;w5L zI1u$@ELPaq?HPl5@+IKgR5TtneG}K%{l5@(c5^9X|AO&2YC(y25YPLI_ypkw zrD-^8AO$}p{?c8H2xgTt!k-Z2YI!3QdEc?3k#9-w|Ddw5e_+U}Vx&GVnp8FNG>*L2 z*zfx@)s5)a?icqNJBI}|jJ!g|y*246wvM4<-jBpec(fK%f#20OvV->}>o79-Ar>Qk zVw|y`>C@^O{e9t=C+iz&&5M%_jJ-6itHBVLHD;e8iV+ZX}ibO>qZ){*aOHh)-#0hLCV)8)J{g zO6`~%!tbFTFoQc7nMZgxh6%?%!lEPG;87!22%qodt&tO*jlHCvdW<0^elxz0vGK<4 znxAke;WxW@BUrYpk(+gHSMe}}9%OVg_GfqL9!63~m=>{VPh)@ioIw4H$b?=-e#Y%s z4LA2Tl7nYZhyJZT#{Mk-qOZ3|`}U&)ymy{3GKTjHQSX*p1~3wL@uKQLBa^T>-p-46 zQBTCvPa6B@wgw4CVrXFHK}IeS|JYMTN|3Jk5F>LjeyFiOt@5At7GsBJyavu6X6y$^ z@^EhoR$(X7&mUnV8uJs4-xhdvq>*~yx)u7nn{~z>;bj>B_mms)6LKR*MudK zjJ;%f1z1$Ps1S@CB&Y{d0v2GWkk`OQlUQs;7)rcO{H|$6ex#yp(^+Jcmp;?TIN~qP z@)|a9wy{4_znWv@dE(C`8~e%E%|F-h-6b*y^;0Q%p0W4+=lCP>-BXMt5#MP6+Xate zD{QgQ*rWFqTu!*|A|p}k?-QtBLZ_E{BlaWe(OrJIu|M%zVjIdWoXTQEfBO|=;9=`Z zBlpmQ8gZlkHF5O#94`mq1=0%rH-Zm`xCI=7U9jFJ)Tc}5`Zwn(p zcpYl`OIwZoF`2&2+lKA78;Rrn=cq??@f}7!!0osj13QiVTyM6^$Vj~fdhnpv?m;Yy zN3x9lbJ?f6jjSNUU313w;0)9sG;2_Mo`d?sRsPG&_{R#YKLZ`c4TYBvypiBnD?Pl9kn6t{E>&j z7)wM5b;!1&e!;vQ@g(XHUclS%C)5%9*Kuzos-P~qHmFn9FA^SyIs&hu50_&Nd;#JfW^X8Aed}Z(f!m+63jzG;9#K$ld zb?sb5M#wMaPI^Pw3U!h7!V35jYDmMWdkDXeeG7?9K4YXM z;heL4uwb>%jdaEJs1^T?-AT9Loag0#d!KZz&wJ;`*e{K|sQbTw2mKgK2zxzqa>ziq zD>lLnn2kB8+w=8YWB-zI7|#Mx#8aRfdS9VLVCG(L{aZ;rAw`HC+le$aD6M-NRL5z}hGm_bc^aj|i+F|qYy>eThcHf~bC;rt8tIrFM? z889Ys^pK&xo{7&Sjv3%<`nvnK$)u z_80f(WTk`y>EYm(aEO0%!=bcrXm>c6t^WtshJ%yB!KwCPYB)G299S3*PLmj)&zHX@ z5DqL42Uh$)sluW8;n2o#a8o$6E*wgwfZX)u1uLfiQB3&G&?}Mpf^%}Rm*#F<;Jw_^ zZARe(nN{n$qlfq}BrVF_u_GKv4hPAa5l*7!U^uYe)<4}geVJ|j6m23+558_|ULFqa z3c(M()*$k|>8)^#4uU4AQTm3Tfthe2{O%pg{?~F^QSi7Q20% z`u&HE?(d@%U;mia`jCDhg`6Am*X_z*xJSE|y}-6_bvQ679Eg;j`SspH?yW8U%kXC8 zWToZom_}Kbch3z6Ue|_ba~SqH7d9-&-9=d&!U4uVd45KDQz|nx-K{qH!N2sFk=5>Q zx$(c9xX`?CaLtVlrRSwGcsgwH4|ne9t2RGrlPTk;mfYD)@uq(^I{Gg|9n7?4(T)v& zshA$WoR&Lvu?}WZ;NcNt292s_`^}=r@Wl@rGj`O7>fzu<+l)DRQ>ja*B5xr>zM;Us zEz{OAEqB_yoIOjLMAxb1`&;n^>o5o4-nR_|JP z;GO=ztZ-c-f7%LxjJ!1q!bvZ)3iDES=53kBy0HuUkExH&*~`qnsw2#T^~NEzL`NgU zI-L{_Eei)%>k4Jz@5v4aR_QuruW4c?G2{=2c;a3bpG6|3rkmOxES*+a)`T96rHmc6t~#FB=odGwruS7~H~~F-gqr z(!UI8U`<}~3|6_f8Y5dgup#edTEvO=mlK28A~RJn1{wLAR^-m$MD#}9*6*DU47g73 z44OlN{H>fGOii|(GZu`V)J(&Atx(St@@HJoSz!nMtu`GYZ-s^QK|9RktdO+Ah(l2bBYd6autMNwjDaxMg z|ExDK{YIKKwj6JG=Gg7Vy#4u#sY9ElbBE+EVWIqQUm1qkcAz)iSirP!aX6UF=E&?E zD%>!Rb}x-&pru}sdL2?WQ@HH=IE~IYEOL--CW6k-b&Yj6ktfQ;PG|TS49nYDE Qw-xSHEpv0WY1r|903VwwH~;_u From 988f7ef7071a602c7ef45dc962f77aa353305a8d Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Tue, 11 Aug 2020 18:37:01 +0900 Subject: [PATCH 45/59] update parsing inputs --- wrapper.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 74f885d7..5bae465f 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -4,7 +4,7 @@ # sh wrapper.sh --repo make-novice --create # sh wrapper.sh --repo make-novice --import # sh wrapper.sh --repo make-novice --account GitHubUser --import -# sh wrapper.sh --repo r-novice-gapmnder --account swcarpentry-ja --import --webpages +# sh wrapper.sh --repo r-novice-gapminder --account swcarpentry-ja --import --webpages # create (implemented): subroutine to create new PO files from an English lesson not currently being translated # import (testing): subroutine to pull a lesson being translated from remote to make changes locally @@ -63,6 +63,7 @@ for op in "$@"; do remote_user=$git_user next=true fi + shift ;; -r|--repo) shift @@ -73,6 +74,7 @@ for op in "$@"; do all_repo=true next=true fi + shift ;; -w|--webpages) shift @@ -113,7 +115,7 @@ echo render webpages : $render #check if remote i18n repo exists root_dir=`git ls-remote https://github.com/${remote_user}/i18n.git | grep "ja" | wc -l` -echo i18 repo: $root_dir +echo i18n repo: $root_dir if [ $root_dir -eq 1 ]; then echo "remote found: https://github.com/${remote_user}/i18n.git" elif [ $root_dir -eq 0 ]; then @@ -126,8 +128,8 @@ else fi #check if remote repo exists -root_dir=`git ls-remote https://github.com/${remote_user}/${repo}.git | grep "ja" | wc -l` -echo i18 repo: $root_dir +root_dir=`git ls-remote https://github.com/${remote_user}/${repo}.git | grep "gh-pages" | wc -l` +echo $repo repo: $root_dir if [ $root_dir -eq 1 ]; then echo "remote found: https://github.com/${remote_user}/${repo}.git" elif [ $root_dir -eq 0 ]; then @@ -288,6 +290,7 @@ if [[ $import == true ]]; then #import submodules git submodule init + git submodule foreach 'git pull swc-ja' git submodule import echo "update local submodules" From f7431c7bae9206951906f653c58c21f37136fd49 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Tue, 11 Aug 2020 18:48:11 +0900 Subject: [PATCH 46/59] update PO files --- po/git-novice.ja.po | 2 +- po/python-novice-gapminder.ja.po | 2 +- po/python-novice-inflammation.ja.po | 2 +- po/r-novice-gapminder.ja.po | 2 +- po/r-novice-inflammation.ja.po | 2 +- po/shell-novice.ja.po | 2 +- po/sql-novice-survey.ja.po | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/po/git-novice.ja.po b/po/git-novice.ja.po index b24171f5..c6a81ce6 100644 --- a/po/git-novice.ja.po +++ b/po/git-novice.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Git Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the gitbook package. # Riku Takei , 2019, 2020. # diff --git a/po/python-novice-gapminder.ja.po b/po/python-novice-gapminder.ja.po index 1b86c7d5..3b692995 100644 --- a/po/python-novice-gapminder.ja.po +++ b/po/python-novice-gapminder.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Plotting and Programming in Python Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # diff --git a/po/python-novice-inflammation.ja.po b/po/python-novice-inflammation.ja.po index 25ccc694..36ec8f8b 100644 --- a/po/python-novice-inflammation.ja.po +++ b/po/python-novice-inflammation.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Programming with Python Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 2ebed21d..d7ccec54 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry R for Reproducible Scientific Analysis Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # diff --git a/po/r-novice-inflammation.ja.po b/po/r-novice-inflammation.ja.po index 65a57f07..23977967 100644 --- a/po/r-novice-inflammation.ja.po +++ b/po/r-novice-inflammation.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Programming with R Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # diff --git a/po/shell-novice.ja.po b/po/shell-novice.ja.po index 4c90a964..bda3f244 100644 --- a/po/shell-novice.ja.po +++ b/po/shell-novice.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Unix Shell Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # diff --git a/po/sql-novice-survey.ja.po b/po/sql-novice-survey.ja.po index bdd09e78..0480a21a 100644 --- a/po/sql-novice-survey.ja.po +++ b/po/sql-novice-survey.ja.po @@ -1,5 +1,5 @@ # Japanese translation of the Software Carpentry Using Databases and SQL Lesson -# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2020 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. # Software-Carpentry Japanese-Team , 2019, 2020. # From 91cc6b2df4bd23ea6b1467ac78b3f5a702e012d6 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Tue, 11 Aug 2020 18:49:49 +0900 Subject: [PATCH 47/59] fix syntax --- wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper.sh b/wrapper.sh index 5bae465f..9b006145 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -400,7 +400,7 @@ if [[ $render == true ]]; then year=`date +%Y` past_year=$(( $year-1 )) #replace past year with current year - sed -i '2s/$past_year/$year/g" po/*.po + sed -i "2s/$past_year/$year/g" po/*.po # append current year if different to previous year sed -i "4s/, ${past_year}\./, ${past_year}, ${year}./g" po/*po From 4474d472fe2974564b72b53e470ac84cd649bc67 Mon Sep 17 00:00:00 2001 From: Joel Nitta Date: Fri, 14 Aug 2020 17:06:49 +0900 Subject: [PATCH 48/59] Revise translation according to review comments --- po/r-novice-gapminder.ja.po | 96 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 9935219b..54ad5dd9 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -1112,7 +1112,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/01-rstudio-intro.md:130 msgid "## Using R as a calculator" -msgstr "## Rを計算機として使う" +msgstr "## Rを計算機としての使用" #: r-novice-gapminder/_episodes/01-rstudio-intro.md:132 msgid "The simplest thing you could do with R is do arithmetic:" @@ -8026,7 +8026,7 @@ msgid "" "variables in gapminder, what do you think the following will produce, and why?" msgstr "" "データフレームの次元について見てみることもできます。\n" -" `str(gapminder)` が、gapminderには、6変数について1704の標本があると言っていたことを念頭に置き、\n" +" `str(gapminder)` が、gapminderには、6変数について1704の観測値があると言っていたことを念頭に置き、\n" "以下から何が出てくると思いますか?それはなぜですか?" # code block @@ -10919,7 +10919,7 @@ msgstr "" ">\n" "> 以下の一般的なデータフレームの部分集合を作る際のエラーを修正しましょう:\n" ">\n" -"> 1. 1957年に集められた標本を抜き出す\n" +"> 1. 1957年に集められた観測値を抜き出す\n" ">\n" "> \n" "> ~~~\n" @@ -10965,7 +10965,7 @@ msgstr "" "> > 以下の一般的なデータフレームの部分集合を作る際のエラーを修正しましょう:\n" "\n" "> >\n" -"> > 1. 1957年に集められた標本を抜き出す\n" +"> > 1. 1957年に集められた観測値を抜き出す\n" "\n" "> >\n" "> > \n" @@ -15915,7 +15915,7 @@ msgid "" "additional arguments so we could filter by `year` and `country`:" msgstr "" "ここまでに、関数がコードをシンプルにするために使えるということをお伝えしました。\n" -"gapminder データセットを使って、人口の列と1人当たりのGDPの列を掛ける\n" +"gapminder データセットを使って、人口の列と1人当たりのGDP(国内総生産)の列を掛ける\n" "関数 `calcGDP` を定義し、更に、\n" "`year` と `country` でフィルターできる引数を追加で、定義しましたよね。" @@ -16060,7 +16060,7 @@ msgstr "" #: r-novice-gapminder/_episodes/12-plyr.md:115 msgid "We installed this package in an earlier challenge. Let's load it now:" -msgstr "このパッケージを、以前のチャレンジの中で、インストールしているので、ここでロードしてみましょう:" +msgstr "このパッケージを、以前のチャレンジで、インストールしましたので、ここでロードしてみましょう:" # code block #: r-novice-gapminder/_episodes/12-plyr.md:118 @@ -16124,7 +16124,7 @@ msgid "" "Note here that plyr's use of \"array\" is different to R's,\n" "an array in ply can include a vector or matrix." msgstr "" -"ここで、plyrの「array」の使用法は、Rの使用法を違うことに気をつけましょう。\n" +"ここで、plyrの「array」の使用法は、Rの使用法と違うことに気をつけましょう。\n" "plyのarrayは、ベクトルや行列も含めます。" #: r-novice-gapminder/_episodes/12-plyr.md:144 @@ -16153,7 +16153,7 @@ msgstr "" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:156 msgid "* The first letter of the function name gives the input type and the second gives the output type." -msgstr "* 関数の最初の文字が、入力型、次の文字が出力型を示します。" +msgstr "* 関数名の最初の文字が、入力型、次の文字が出力型を示します。" # unordered list #: r-novice-gapminder/_episodes/12-plyr.md:157 @@ -16240,8 +16240,8 @@ msgid "" msgstr "" "もうひとつの`data.frame`を出力します(2番目の文字は、**d**ですね)\n" "- 最初の引数は、使いたいdata.frameでしたね。つまり、ここでは、\n" -"gapminderデータです。そこに、`gdp` の列を加えるために、まず `calcGDP` を使いましょう。\n" -"- 次の引数は、分割基準を、つまり、ここでは「continent(大陸)」列です。\n" +"gapminderデータです。そこに、`gdp`(国内総生産) の列を加えるために、まず `calcGDP` を使いましょう。\n" +"- 次の引数は、分割基準を、つまり、ここでは「continent」(大陸)列です。\n" " 以前、分部集合に分けるときに使った値の名前ではなく、ここでは列の名前を使うことに気を付けましょう。Plyrが細かい実行上の詳細を、代わりに処理してくれますので。\n" "- 3番目の引数は、データのそれぞれのグループに当てはめる関数です。\n" " ここで、自分で短い関数を定義しておかなければなりません。\n" @@ -16260,7 +16260,7 @@ msgstr "" #: r-novice-gapminder/_episodes/12-plyr.md:207 msgid "What if we want a different type of output data structure?:" -msgstr "他のデータ構造型が良い場合は、どうすればよいでしょうか。" +msgstr "他のデータ構造型での出力が良い場合は、どうすればよいでしょうか。" # code block #: r-novice-gapminder/_episodes/12-plyr.md:210 @@ -16577,7 +16577,7 @@ msgid "" "To replace a for loop, put the code that was in the body of the `for` loop inside an anonymous function." msgstr "" "これらの関数は `for` ループの代わりに使えます(その方が、普通は早いです)。\n" -"forループを置き換えるために、 `for` ループの本体の中にあった名無し関数のコードを置きましょう。" +"そうするには、`for` ループの本体の中にあったコードを名無し関数に入れましょう。" # code block #: r-novice-gapminder/_episodes/12-plyr.md:373 @@ -16843,7 +16843,7 @@ msgid "" "do these operations using the normal base R operations:" msgstr "" "多くの研究者にとって、データフレームの操作は、多くのことを意味します。\n" -"よくあるのは、特定の標本(行)もしくは変数(列)の選択、 特定の変数でのデータのグループ化、\n" +"よくあるのは、特定の観測値(行)もしくは変数(列)の選択、 特定の変数でのデータのグループ化、\n" "更には要約する統計値の計算です。\n" "これらは、普通のRの基本操作で実行できます:" @@ -16936,8 +16936,8 @@ msgid "" "even find the `dplyr` grammar easier to read." msgstr "" "嬉しいことに、[`dplyr`](https://cran.r-project.org/web/packages/dplyr/dplyr.pdf)\n" -"パッケージには、データフレーム操作に、かなり使える関数がいくつもあります。\n" -"それを使うと、先ほどお伝えしたような繰り返しを減らし、エラーを起こす確率を減らし、\n" +"パッケージには、データフレーム操作に非常に役立つ関数がいくつもあります。\n" +"それを使うと、先ほどみたような繰り返しを減らし、エラーを起こす確率を減らし、\n" "タイピングする必要性さえも恐らく減らせます。\n" "更には、`dplyr` の書き方は、とても分かりやすいかもしれません。" @@ -17008,7 +17008,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:107 msgid "## Using select()" -msgstr "## select() を使う" +msgstr "## select() の使用" #: r-novice-gapminder/_episodes/13-dplyr.md:109 msgid "" @@ -17044,7 +17044,7 @@ msgid "" "using pipes." msgstr "" "もし `year_country_gdp` を開いたら、year、country 及び gdpPercap しかないでしょう。\n" -"上では、 '普通の' 書き方を使いましたが、`dplyr` の強みは、複数の関数を\n" +"これまでは、 '普通の' 書き方を使いましたが、`dplyr` の強みは、複数の関数を\n" "パイプを使って、組み合わせられることです。\n" "パイプの書き方は、これまでRで見てきたものとは、\n" "全く違いますので、上記でしたことをパイプを使って、やってみましょう。" @@ -17070,7 +17070,7 @@ msgid "" "encountered pipes before in the shell. In R, a pipe symbol is `%>%` while in the\n" "shell it is `|` but the concept is the same!" msgstr "" -"こう書いた理由を、お分かりいただくために、ひとつずつ御説明します。\n" +"こう書いた理由を理解しやすくするために、ひとつずつ見ていきましょう。\n" "始めに、gapminder データフレームを呼び出し、パイプの記号`%>%` を使って、\n" "次の `select()` 関数を使うステップに引き渡します。どのデータオブジェクトを\n" "`select()` 関数で使うかについては、前のパイプから分かるため、ここでは指定しません。\n" @@ -17080,7 +17080,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:141 msgid "## Using filter()" -msgstr "## filter() を使う" +msgstr "## filter() の使用" #: r-novice-gapminder/_episodes/13-dplyr.md:143 msgid "" @@ -17121,7 +17121,7 @@ msgid "" "> >{: .language-r}" msgstr "" ">\n" -"> アフリカの`lifeExp`、 `country` 及び `year` を持ち、他の国を含まないデータフレームを\n" +"> アフリカの`lifeExp`、 `country` 及び `year` を持ち、他の大陸を含まないデータフレームを\n" "> 作るコマンドをひとつ書いてみましょう(複数の行になっても、パイプを使っても大丈夫です)\n" "> データフレームには、何行ありますか。なぜそうなるのでしょうか。\n" ">\n" @@ -17142,7 +17142,7 @@ msgid "" "case. If we used 'select' first, filter would not be able to find the variable\n" "continent since we would have removed it in the previous step." msgstr "" -"その前に行ったように、gapminder データフレームを `filter()` 関数に引き渡し、\n" +"以前行ったように、gapminder データフレームを `filter()` 関数に引き渡し、\n" "フィルターされた バージョンのgapminder データフレームを、 `select()` 関数に引き渡します。\n" "**注意:** ここでは、操作手順がとても重要です。\n" "まず 'select' を使うと、その前のステップで、大陸の変数が削除されているため、\n" @@ -17151,7 +17151,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:178 msgid "## Using group_by() and summarize()" -msgstr "## group_by() と summarize() を使う" +msgstr "## group_by() と summarize() の使用" #: r-novice-gapminder/_episodes/13-dplyr.md:180 msgid "" @@ -17163,9 +17163,9 @@ msgid "" "could have used in filter." msgstr "" "ここでは、Rの基本的な機能を用いたエラーが起こりやすい繰り返し作業を減らすはずでした。\n" -"でも、まだそれが達成できていません。上記では、それぞれの大陸で繰り返さなければならないですね。\n" -"(上記の `continent==\"Europe\"` のように)条件にあった標本のみを引き渡す `filter()` の代わりに、\n" -"filterでも使える、それぞれの一意の条件を用いることが必須となる `group_by()` を使うこともできます。" +"でも、まだそれが達成できていません。上記では、それぞれの大陸ごとに同じことを繰り返さなければならないからです。\n" +"繰り返しを無くすために、(上記の `continent==\"Europe\"` のように)条件にあったデータのみを引き渡す `filter()` の代わりに、\n" +"filterでも使える、それぞれの一意の条件を元に一気にデータを分ける `group_by()` を使うこともできます。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:208 @@ -17249,7 +17249,7 @@ msgstr "![](../fig/13-dplyr-fig2.png)" # header #: r-novice-gapminder/_episodes/13-dplyr.md:247 msgid "## Using summarize()" -msgstr "## summarize() を使う" +msgstr "## summarize() の使用" #: r-novice-gapminder/_episodes/13-dplyr.md:249 msgid "" @@ -17477,7 +17477,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:363 msgid "That is already quite powerful, but it gets even better! You're not limited to defining 1 new variable in `summarize()`." -msgstr "これでも、かなり役に立ちますが、更にすごいのです。`summarize()` の中で新しく定義できる変数は、1つに限らないのです。" +msgstr "これでも、かなり役に立ちますが、更にすごいことに、`summarize()` の中で新しく定義できる変数は、1つに限らないのです。" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:366 @@ -17510,8 +17510,8 @@ msgid "" "A very common operation is to count the number of observations for each\n" "group. The `dplyr` package comes with two related functions that help with this." msgstr "" -"よくありがちな操作は、各グループの標本数の数を数えることです。\n" -"これに役立つ2つの関数が `dplyr` パッケージにあります。" +"よくありがちな操作は、各グループの観測値の数を数えることですが、\n" +"'dplyr' パッケージには、これに役立つ関数が2つあります。" #: r-novice-gapminder/_episodes/13-dplyr.md:381 msgid "" @@ -17520,7 +17520,7 @@ msgid "" "of one or more columns that contain the groups we are interested in, and we can\n" "optionally sort the results in descending order by adding `sort=TRUE`:" msgstr "" -"例えば、2002年のデータセットにある国数を確認したい場合、 `count()` 関数が使えます。\n" +"例えば、2002年のデータセットにある国の数を確認したい場合、 `count()` 関数が使えます。\n" "興味のあるグループのひとつかいくつかの行の名前を取り、\n" " `sort=TRUE` を加えることで、結果を降順に並べることもできます:" @@ -17570,7 +17570,7 @@ msgid "" "is useful. For instance, if we wanted to get the standard error of the life\n" "expectency per continent:" msgstr "" -"演算の際、標本数が必要な場合 `n()` 関数が使えます。\n" +"演算の際の観測値の数が必要な場合 `n()` 関数が使えます。\n" "例えば、大陸別平均余命の標準誤差を得たいとします:" # code block @@ -17668,7 +17668,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:462 msgid "## Using mutate()" -msgstr "## mutate() を使う" +msgstr "## mutate() の使用" #: r-novice-gapminder/_episodes/13-dplyr.md:464 msgid "We can also create new variables prior to (or even after) summarizing information using `mutate()`." @@ -17704,7 +17704,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:480 msgid "## Connect mutate with logical filtering: ifelse" -msgstr "## 論理フィルター ifelse とmutate をつなげる" +msgstr "## 論理フィルター ifelse とmutate の併用" #: r-novice-gapminder/_episodes/13-dplyr.md:482 msgid "" @@ -17713,11 +17713,11 @@ msgid "" "This easy-to-read statement is a fast and powerful way of discarding certain data (even though the overall dimension\n" "of the data frame will not change) or for updating values depending on this given condition." msgstr "" -"新しい変数を作る時、これに論理条件に付けることができます。\n" +"新しい変数を作る時、論理条件を付けることができます。\n" "似たような組み合わせの `mutate()` と `ifelse()` は、まさに必要な場面、つまり\n" "新しいものを作る時に、フィルターすることができます。\n" -"この簡単に読める宣言が、(データフレーム全体の次元を変えずに)あるデータを\n" -"捨てるための早くて役に立つ方法であり、\n" +"この簡単に読めるコードが、(データフレーム全体の次元を変えずに)あるデータを\n" +"排除するための早くて役に立つ方法であり、\n" "与えられた条件によって値を更新する方法なのです。" # code block @@ -17770,7 +17770,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/13-dplyr.md:511 msgid "## Combining `dplyr` and `ggplot2`" -msgstr "## `dplyr` と `ggplot2` を組み合わせる" +msgstr "## `dplyr` と `ggplot2` の併用" #: r-novice-gapminder/_episodes/13-dplyr.md:513 msgid "" @@ -17778,9 +17778,9 @@ msgid "" "a layer of facet panels using `ggplot2`. Here is the code we used (with some\n" "extra comments):" msgstr "" -"プロットのレッスンでは、 `ggplot2` を使って、小面パネルの層を加えることで、\n" +"プロットのレッスンでは、 `ggplot2` を使って、ファセットパネルの層を加えることで、\n" "複数パネルの図を示す方法を見ました。\n" -"次が、(いくつかコメントを付けた)使ったコードです:" +"以下が、(いくつかコメントを足してありますが)使用したコードです:" # code block #: r-novice-gapminder/_episodes/13-dplyr.md:518 @@ -17821,7 +17821,7 @@ msgid "" msgstr "" "このコードは、正しいプロットを作りますが、他に使い道のない、変数(`starts.with`\n" "及び `az.countries`)も作ります。 `dplyr` 関数のチェーンで、 `%>%` を使って、\n" -"データをパイプ流したように、 `ggplot()` へデータを引き渡すこともできます。\n" +"データをパイプしたように、 `ggplot()` へデータを引き渡すこともできます。\n" "なぜならば `%>%` は、関数の最初の引数を置き換えるため、\n" " `ggplot()` 関数の中の、 `data =` 因数を指定する必要がありません。\n" " `dplyr` と `ggplot2` 関数を組み合わせることで、同じ図を、新しい変数を作ったり、\n" @@ -17935,7 +17935,7 @@ msgstr "" #: r-novice-gapminder/_episodes/13-dplyr.md:593 #: r-novice-gapminder/_episodes/14-tidyr.md:645 msgid "## Other great resources" -msgstr "## その他の素晴らしい資料" +msgstr "## その他役に立つ資料" # unordered list #: r-novice-gapminder/_episodes/13-dplyr.md:595 @@ -18012,13 +18012,13 @@ msgstr " - 各列が変数" # unordered list #: r-novice-gapminder/_episodes/14-tidyr.md:24 msgid " - each row is an observation" -msgstr " - 各行が標本" +msgstr " - 各行が観測値" #: r-novice-gapminder/_episodes/14-tidyr.md:26 msgid "" "In the 'long' format, you usually have 1 column for the observed variable and\n" "the other columns are ID variables." -msgstr "「縦長」形式では、ふつう観測値は1列で、残りはIDの変数の列になります。" +msgstr "「縦長」形式では、普通、観測値は1列で、残りの列はIDの変数になります。" #: r-novice-gapminder/_episodes/14-tidyr.md:30 msgid "" @@ -18033,7 +18033,7 @@ msgstr "" "「横長」形式は、それぞれの行には、場所/主題/患者があり、同じようなデータ型の\n" "複数の観測変数があります。 時間を変えて繰り返し観測した値や、\n" "複数の観測変数(又は、その両方)が、これに該当します。\n" -"データ入力がより単純と感じたり、「幅長」形式の方が良いという\n" +"データ入力がより単純と感じたり、「縦長」形式の方が良いという\n" "アプリケーションもあるでしょうが、「R」の関数の多くは、\n" "「縦長」形式データを前提として作られています。ここでは、\n" "元々の形式に関係なくデータを効率的に変換する方法を学びましょう。" @@ -18066,7 +18066,7 @@ msgid "" "installed dplyr in the previous lesson):" msgstr "" "まず、パッケージをインストールしましょう、もしまだやっていなければですが\n" -"(おそらく、前の dplyr のレッスン、インストールしているかと思います):" +"(おそらく、前の dplyr のレッスンで、インストールしているかと思います):" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:52 @@ -18163,7 +18163,7 @@ msgstr "" "3つの「ID variables」(`continent`, `country`, `year`)と、3つの「観測変数」\n" "(`pop`,`lifeExp`,`gdpPercap`)がありますね。3つの観測変数が、全ての違う\n" "単位であり、全ての変数が1列になってはいませんが、個人的には、自分のデータを、\n" -"この中間形式にしたいと思うことが多いです。このデータフレームをより縦長に広げたい\n" +"この中間形式にしたいと思うことが多いです。このデータフレームをより縦に広げたい\n" "(つまり、4つの ID 変数と1観測変数にしたい)というときに使える操作は、\n" "ほとんどありません。" @@ -18217,7 +18217,7 @@ msgid "" "`read.csv()` to disable that." msgstr "" "データファイルをロードして見てみましょう。 注:大陸と国の列は、因子型にはしたくありません。\n" -"そこで、そうならないように、stringsAsFactors 引数を `read.csv()` 使いましょう。" +"そこで、そうならないように、`read.csv()`に stringsAsFactors 引数を使いましょう。" # code block #: r-novice-gapminder/_episodes/14-tidyr.md:134 @@ -18511,7 +18511,7 @@ msgid "" msgstr "" ">\n" "> `gap_long` を使って、各大陸の平均余命、人口及びgdpPercapを計算しましょう。\n" -">**ヒント:** `dplyr` で習った `group_by()` と `summarize()` 変数を使いましょう。\n" +">**ヒント:** `dplyr` で習った `group_by()` と `summarize()` 関数を使いましょう。\n" ">\n" "> > ## チャレンジ2の解答\n" "> >\n" From d9646acfd3d99f3c5d5522bba30ec6ead62fac08 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 17:50:49 +0900 Subject: [PATCH 49/59] change account to passes parameter for testing --- wrapper.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 9b006145..848e4781 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -159,7 +159,7 @@ if [[ $create == true ]]; then #checkout Japanese branch git checkout ja - git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git + git remote add swc-ja git@github.com:${git_user}/i18n.git git pull swc-ja ja #import submodules @@ -180,7 +180,7 @@ if [[ $create == true ]]; then git remote remove swc-ja fi #reset all repos to remote - url=https://github.com/swcarpentry-ja/${dir}.git + url=https://github.com/${git_user}/${dir}.git git remote add swc-ja $url if [[ `git branch -v | grep "master" | wc -l` -ge 1 ]] then @@ -285,7 +285,7 @@ if [[ $import == true ]]; then #checkout Japanese branch git checkout ja - git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git + git remote add swc-ja git@github.com:${git_user}/i18n.git git pull swc-ja ja #import submodules @@ -307,7 +307,7 @@ if [[ $import == true ]]; then git remote remove swc-ja fi #reset all repos to remote - url=https://github.com/swcarpentry-ja/${dir}.git + url=https://github.com/${git_user}/${dir}.git git remote add swc-ja $url if [[ `git branch -v | grep "master" | wc -l` -ge 1 ]] then @@ -367,7 +367,7 @@ if [[ $render == true ]]; then #checkout Japanese branch git checkout ja - git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git + git remote add swc-ja git@github.com:${git_user}/i18n.git git pull swc-ja ja #import submodules From 00d4714b25940c0b3d55f484b41d719d8212c0aa Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 19:00:36 +0900 Subject: [PATCH 50/59] correct handling of submodule updates --- wrapper.sh | 135 +++++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 66 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 848e4781..3e65cd71 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -164,10 +164,10 @@ if [[ $create == true ]]; then #import submodules git submodule init - git submodule import + git submodule add git@github.com:${git_user}/${repo} echo "update local submodules" - #git submodule update --recursive --merge + git submodule update -f --recursive --merge $repo #remove _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -291,10 +291,10 @@ if [[ $import == true ]]; then #import submodules git submodule init git submodule foreach 'git pull swc-ja' - git submodule import + git submodule add git@github.com:${git_user}/${repo} echo "update local submodules" - git submodule update --recursive --remote --merge + git submodule update -f --recursive --remote --merge #remove _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -372,10 +372,10 @@ if [[ $render == true ]]; then #import submodules git submodule init - git submodule import + git submodule add git@github.com:${git_user}/${repo} echo "import local submodules" - git submodule import --recursive --remote --merge + git submodule update -f --recursive --remote --merge if [[ ! -z $repo ]]; then if [[ -d $repo ]]; then @@ -429,65 +429,68 @@ if [[ $render == true ]]; then exit 1 fi - #create as submodule - ##git submodule add https://github.com/${git_user}/${repo}-ja.git locale/ja/$repo - ##git submodule absorbgitdirs - - #move to external repo - mkdir -p ../${repo}-ja - rsync -ru locale/ja/${repo}/* ../${repo}-ja - - #add update lessons to remote - cd ../${repo}-ja - git init - remotes=`git remote | grep "swc-ja" | wc -l` - if [[ remotes -le 0 ]]; then - git remote add swc-ja https://github.com/$remote_user/$repo-ja.git + #create as submodule + ##git submodule add https://github.com/${git_user}/${repo}-ja.git locale/ja/$repo + ##git submodule absorbgitdirs + + #move to external repo + mkdir -p ../${repo}-ja + rsync -ru locale/ja/${repo}/* ../${repo}-ja + + #add update lessons to remote + cd ../${repo}-ja + git init + remotes=`git remote | grep "swc-ja" | wc -l` + if [[ remotes -le 0 ]]; then + git remote add swc-ja https://github.com/$remote_user/$repo-ja.git fi - git pull swc-ja master - - # remove files provided by template - rm -rf bin/boilerplate - rm -rf _layouts _includes _episodes_rmd assets bin code - - git add * - git commit -m "update lesson files" - git push swc-ja master - - #update original lesson to import translated content - cd ../i18n # or English lesson - git submodule foreach git pull origin master - - #restore locale lessons (only English lessons translated) - for dir in `git submodule | grep "^+" | cut -d" " -f2` - do - if [ -d $dir ] - then - cd $dir - git reset --hard - cd .. - fi - done - - cd ${repo} - git add -u - - #create lesson in locale if not existing or update - if [ -d ./locale/ja ] - then - cd locale/ja - git pull origin master - cd ../.. - else - mkdir -p locale - url="https://github.com/$remote_user/${repo}-ja.git" - git submodule add $url ./locale/ja - fi - - #push updated locale lessons to English lesson - git add -u - git commit -m "update Japanese lessons" - git push swc-ja gh-pages - - cd .. + git pull swc-ja master + + # remove files provided by template + rm -rf bin/boilerplate + rm -rf _layouts _includes _episodes_rmd assets bin code + + git add * + git commit -m "update lesson files" + git push swc-ja master + + #update original lesson to import translated content + cd ../i18n # or English lesson + # restore to version from remote + git submodule update -f --recursive + # import changes from org repo + git submodule foreach 'case $name in po4gitbook) ;; *) git pull -f swc-ja gh-pages ;; esac' + + #restore locale lessons (only English lessons translated) + for dir in `git submodule | grep "^+" | cut -d" " -f2` + do + if [ -d $dir ] + then + cd $dir + git reset --hard + cd .. + fi + done + + cd ${repo} + git add -u + + #create lesson in locale if not existing or update + if [ -d ./locale/ja ] + then + cd locale/ja + git pull origin master + cd ../.. + else + mkdir -p locale + url="https://github.com/$remote_user/${repo}-ja.git" + git submodule add $url ./locale/ja + fi + + #push updated locale lessons to English lesson + git add -u + git commit -m "update Japanese lessons" + git push swc-ja gh-pages + + cd .. fi From 17db8a6549cf06bb0d39204d5e4038534712fcda Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Fri, 14 Aug 2020 19:02:55 +0900 Subject: [PATCH 51/59] Update admin.md --- docs/admin.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/admin.md b/docs/admin.md index 29f403e5..d53d8acc 100644 --- a/docs/admin.md +++ b/docs/admin.md @@ -57,7 +57,8 @@ git pull origin gh-pages 6. Sync changes to (master branch of) the pushed submodule files to the original lesson repository ``` -git submodule foreach git pull origin master +git submodule foreach 'case $name in po4gitbook) ;; *) git pull swc-ja gh-pages ;; esac' +git submodule update --recursive ``` 7. Commit changes to the submodule to the original lesson From 8d623ee1d89c6592a5b641806035c1f642f793ad Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 19:20:36 +0900 Subject: [PATCH 52/59] update PO files --- po/shell-novice.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/shell-novice.ja.po b/po/shell-novice.ja.po index bda3f244..b5f34625 100644 --- a/po/shell-novice.ja.po +++ b/po/shell-novice.ja.po @@ -13,7 +13,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: Satoshi Yokota \n" +"Last-Translator: \n" "Language-Team: Japanese \n" "Language: ja\n" "X-Generator: Poedit 2.3\n" From 927f229d49e81f21df1514b5d39a9f49670e08bf Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 23:04:49 +0900 Subject: [PATCH 53/59] update PO files --- wrapper.sh | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 3e65cd71..7747a125 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -253,7 +253,7 @@ if [[ $create == true ]]; then rm po/*.pot echo "run compile on po4gitbook to create new lessson" po4gitbook/compile.sh > /dev/null 2>&1 - echo lesson $repo created in locale/ja/$repo + echo lesson $repo created in _locale/ja/$repo #restore _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -294,7 +294,7 @@ if [[ $import == true ]]; then git submodule add git@github.com:${git_user}/${repo} echo "update local submodules" - git submodule update -f --recursive --remote --merge + git submodule update -f --recursive #remove _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -375,7 +375,7 @@ if [[ $render == true ]]; then git submodule add git@github.com:${git_user}/${repo} echo "import local submodules" - git submodule update -f --recursive --remote --merge + git submodule update -f --recursive if [[ ! -z $repo ]]; then if [[ -d $repo ]]; then @@ -413,7 +413,7 @@ if [[ $render == true ]]; then git commit -m "update PO files" git push swc-ja ja - echo "translated lessons from po/${repo}.ja.po exported to locale/ja/$repo" + echo "translated lessons from po/${repo}.ja.po exported to _locale/ja/$repo" #check if remote translated lesson exists lesson_dir=`git ls-remote https://github.com/${git_user}/${repo}-ja.git | grep "master" | wc -l` @@ -430,12 +430,12 @@ if [[ $render == true ]]; then fi #create as submodule - ##git submodule add https://github.com/${git_user}/${repo}-ja.git locale/ja/$repo + #git submodule add https://github.com/${git_user}/${repo}-ja.git _locale/ja/$repo ##git submodule absorbgitdirs #move to external repo mkdir -p ../${repo}-ja - rsync -ru locale/ja/${repo}/* ../${repo}-ja + rsync -ru _locale/ja/${repo}/* ../${repo}-ja #add update lessons to remote cd ../${repo}-ja @@ -461,12 +461,13 @@ if [[ $render == true ]]; then # import changes from org repo git submodule foreach 'case $name in po4gitbook) ;; *) git pull -f swc-ja gh-pages ;; esac' - #restore locale lessons (only English lessons translated) + #restore _locale lessons (only English lessons translated) for dir in `git submodule | grep "^+" | cut -d" " -f2` do if [ -d $dir ] then cd $dir + git checkout gh-pages git reset --hard cd .. fi @@ -475,22 +476,32 @@ if [[ $render == true ]]; then cd ${repo} git add -u - #create lesson in locale if not existing or update - if [ -d ./locale/ja ] + #create lesson in _locale if not existing or update + if [ -d ./_locale/ja ] then - cd locale/ja + cd _locale/ja + git add -u + git commit -m "update Japanese lessons" git pull origin master cd ../.. else - mkdir -p locale - url="https://github.com/$remote_user/${repo}-ja.git" - git submodule add $url ./locale/ja + mkdir -p _locale + url="https://github.com/${remote_user}/${repo}-ja.git" + git submodule add $url ./_locale/ja fi - #push updated locale lessons to English lesson + cd _locale/ja + remotes=`git remote | grep "swc-ja" | wc -l` + if [[ remotes -le 0 ]]; then + git remote add swc-ja https://github.com/${remote_user}/$repo-ja.git + fi + git pull swc-ja master + cd ../.. + + #push updated _locale lessons to English lesson git add -u git commit -m "update Japanese lessons" - git push swc-ja gh-pages + git push swc-ja gh-pages cd .. fi From 5564da146afb4a8da94ed7eb2e8cadcfd7f05512 Mon Sep 17 00:00:00 2001 From: Tom Kelly Date: Fri, 14 Aug 2020 19:02:55 +0900 Subject: [PATCH 54/59] Update admin.md --- docs/admin.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/admin.md b/docs/admin.md index 29f403e5..d53d8acc 100644 --- a/docs/admin.md +++ b/docs/admin.md @@ -57,7 +57,8 @@ git pull origin gh-pages 6. Sync changes to (master branch of) the pushed submodule files to the original lesson repository ``` -git submodule foreach git pull origin master +git submodule foreach 'case $name in po4gitbook) ;; *) git pull swc-ja gh-pages ;; esac' +git submodule update --recursive ``` 7. Commit changes to the submodule to the original lesson From a8f95113be9b6f519123d4637a4061d7ef49536e Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 19:20:36 +0900 Subject: [PATCH 55/59] update PO files --- po/shell-novice.ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/shell-novice.ja.po b/po/shell-novice.ja.po index bda3f244..b5f34625 100644 --- a/po/shell-novice.ja.po +++ b/po/shell-novice.ja.po @@ -13,7 +13,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: Satoshi Yokota \n" +"Last-Translator: \n" "Language-Team: Japanese \n" "Language: ja\n" "X-Generator: Poedit 2.3\n" From d24c464a59e611f7e1462ac225502d3638f659e5 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 23:04:49 +0900 Subject: [PATCH 56/59] update PO files --- wrapper.sh | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 3e65cd71..7747a125 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -253,7 +253,7 @@ if [[ $create == true ]]; then rm po/*.pot echo "run compile on po4gitbook to create new lessson" po4gitbook/compile.sh > /dev/null 2>&1 - echo lesson $repo created in locale/ja/$repo + echo lesson $repo created in _locale/ja/$repo #restore _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -294,7 +294,7 @@ if [[ $import == true ]]; then git submodule add git@github.com:${git_user}/${repo} echo "update local submodules" - git submodule update -f --recursive --remote --merge + git submodule update -f --recursive #remove _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -375,7 +375,7 @@ if [[ $render == true ]]; then git submodule add git@github.com:${git_user}/${repo} echo "import local submodules" - git submodule update -f --recursive --remote --merge + git submodule update -f --recursive if [[ ! -z $repo ]]; then if [[ -d $repo ]]; then @@ -413,7 +413,7 @@ if [[ $render == true ]]; then git commit -m "update PO files" git push swc-ja ja - echo "translated lessons from po/${repo}.ja.po exported to locale/ja/$repo" + echo "translated lessons from po/${repo}.ja.po exported to _locale/ja/$repo" #check if remote translated lesson exists lesson_dir=`git ls-remote https://github.com/${git_user}/${repo}-ja.git | grep "master" | wc -l` @@ -430,12 +430,12 @@ if [[ $render == true ]]; then fi #create as submodule - ##git submodule add https://github.com/${git_user}/${repo}-ja.git locale/ja/$repo + #git submodule add https://github.com/${git_user}/${repo}-ja.git _locale/ja/$repo ##git submodule absorbgitdirs #move to external repo mkdir -p ../${repo}-ja - rsync -ru locale/ja/${repo}/* ../${repo}-ja + rsync -ru _locale/ja/${repo}/* ../${repo}-ja #add update lessons to remote cd ../${repo}-ja @@ -461,12 +461,13 @@ if [[ $render == true ]]; then # import changes from org repo git submodule foreach 'case $name in po4gitbook) ;; *) git pull -f swc-ja gh-pages ;; esac' - #restore locale lessons (only English lessons translated) + #restore _locale lessons (only English lessons translated) for dir in `git submodule | grep "^+" | cut -d" " -f2` do if [ -d $dir ] then cd $dir + git checkout gh-pages git reset --hard cd .. fi @@ -475,22 +476,32 @@ if [[ $render == true ]]; then cd ${repo} git add -u - #create lesson in locale if not existing or update - if [ -d ./locale/ja ] + #create lesson in _locale if not existing or update + if [ -d ./_locale/ja ] then - cd locale/ja + cd _locale/ja + git add -u + git commit -m "update Japanese lessons" git pull origin master cd ../.. else - mkdir -p locale - url="https://github.com/$remote_user/${repo}-ja.git" - git submodule add $url ./locale/ja + mkdir -p _locale + url="https://github.com/${remote_user}/${repo}-ja.git" + git submodule add $url ./_locale/ja fi - #push updated locale lessons to English lesson + cd _locale/ja + remotes=`git remote | grep "swc-ja" | wc -l` + if [[ remotes -le 0 ]]; then + git remote add swc-ja https://github.com/${remote_user}/$repo-ja.git + fi + git pull swc-ja master + cd ../.. + + #push updated _locale lessons to English lesson git add -u git commit -m "update Japanese lessons" - git push swc-ja gh-pages + git push swc-ja gh-pages cd .. fi From 67079f6ef85d9cc5f42d220748639efb7a51c1e8 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 23:27:11 +0900 Subject: [PATCH 57/59] reset submodules after rendering webpages --- wrapper.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/wrapper.sh b/wrapper.sh index 7747a125..05c8ad96 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -504,4 +504,5 @@ if [[ $render == true ]]; then git push swc-ja gh-pages cd .. +git submodule update -f --recursive fi From e8e5ac3fac015064959ef95db832756f93e02370 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Fri, 14 Aug 2020 23:47:20 +0900 Subject: [PATCH 58/59] correct rendering translated webpages --- wrapper.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index 05c8ad96..7a7be855 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -167,7 +167,7 @@ if [[ $create == true ]]; then git submodule add git@github.com:${git_user}/${repo} echo "update local submodules" - git submodule update -f --recursive --merge $repo + git submodule update -f --recursive $repo #remove _locale directory (only translate English lessons) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -435,11 +435,12 @@ if [[ $render == true ]]; then #move to external repo mkdir -p ../${repo}-ja - rsync -ru _locale/ja/${repo}/* ../${repo}-ja + rsync -ru locale/ja/${repo}/* ../${repo}-ja #add update lessons to remote cd ../${repo}-ja git init + git remote remove swc-ja remotes=`git remote | grep "swc-ja" | wc -l` if [[ remotes -le 0 ]]; then git remote add swc-ja https://github.com/$remote_user/$repo-ja.git @@ -459,7 +460,7 @@ if [[ $render == true ]]; then # restore to version from remote git submodule update -f --recursive # import changes from org repo - git submodule foreach 'case $name in po4gitbook) ;; *) git pull -f swc-ja gh-pages ;; esac' + git submodule foreach 'case $name in po4gitbook) ;; *) git checkout gh-pages; git pull -f swc-ja gh-pages ;; esac' #restore _locale lessons (only English lessons translated) for dir in `git submodule | grep "^+" | cut -d" " -f2` @@ -468,7 +469,11 @@ if [[ $render == true ]]; then then cd $dir git checkout gh-pages - git reset --hard + remotes=`git remote | grep "swc-ja" | wc -l` + if [[ remotes -le 0 ]]; then + git remote add swc-ja https://github.com/$remote_user/$repo-ja.git + fi + git pull swc-ja gh-pages cd .. fi done From 9cd9432b193f403444f1422563d4269258e2eeb9 Mon Sep 17 00:00:00 2001 From: TomKellyGenetics Date: Sat, 29 Aug 2020 18:31:45 +0900 Subject: [PATCH 59/59] migrate changes to lesson template to lang.md --- lang.md | 5 +- po/r-novice-gapminder.ja.po | 168 ++++++++++++++++++------------------ 2 files changed, 87 insertions(+), 86 deletions(-) diff --git a/lang.md b/lang.md index ebd97101..9976c287 100644 --- a/lang.md +++ b/lang.md @@ -15,15 +15,16 @@ contribute: "貢献します" source: "ソース" cite: "引用します" contact: "連絡します" -keypoints: "要点" +keypoints: "キーポイント" overview: "概要" break: "休止" previous: "戻る" next: "次へ" episode: "エピソード" lessonHome: "レッスンのホーム" +title: "タイトル" teaching: "講義" -exercises: "練習" +exercises: "演習" min: "分" questions: "質問" objectives: "目標" diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index f4a2a27f..f9ae6b12 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -828,15 +828,15 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 01-rstudio-intro.md in _episodes_rmd/\n" -"レッスンタイトル: \"R と RStudio\"\n" -"講義: 45分\n" -"演習: 10分\n" -"質問:\n" +"title: \"R と RStudio\"\n" +"teaching: 45分\n" +"exercises: 10分\n" +"questions:\n" "- \"RStudio はどのように操作したらよいですか?\"\n" "- \"R とはどのようにやりとりしたらよいですか?\"\n" "- \"環境の管理はどうしたらよいですか?\"\n" "- \"パッケージのインストールはどうしたらよいですか?\"\n" -"目標:\n" +"objectives:\n" "- \"RStudio IDE の各ウィンドウの使用目的と使い方が説明出来るようになりましょう\"\n" "- \"RStudio IDE のボタンやオプションの位置を理解しましょう\"\n" "- \"変数が定義出来るようになりましょう\"\n" @@ -845,7 +845,7 @@ msgstr "" "- \"算術演算子や比較演算子が使えるようになりましょう。\"\n" "- \"関数が呼び出せるようになりましょう。\"\n" "- \"パッケージの管理が出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"RStudio で R プロラムの作成と実行を行う。\"\n" "- \"R は算術演算子や数学関数が使える。\"\n" "- \"`<-` を使って変数に値を設定する。\"\n" @@ -3283,14 +3283,14 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 02-project-intro.md in _episodes_rmd/\n" -"タイトル: \"RStudio のプロジェクト管理\"\n" -"講義: 20 分\n" -"演習: 10 分\n" -"質問:\n" +"title: \"RStudio のプロジェクト管理\"\n" +"teaching: 20 分\n" +"exercises: 10 分\n" +"questions:\n" "- \"R のプロジェクトの管理はどうしたら良いですか?\"\n" -"目標:\n" +"objectives:\n" "- RStudio のプロジェクトを作成出来るようになりましょう\n" -"キーポイント:\n" +"keypoints:\n" "- \"RStudio でプロジェクトの生成と管理を行う。\"\n" "- \"オリジナルデータは読み込み専用とする。\"\n" "- \"生成された出力は使い捨てとする。\"\n" @@ -3801,16 +3801,16 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 03-seeking-help.md in _episodes_rmd/\n" -"タイトル: \"ヘルプ機能\"\n" -"講義: 10 分\n" -"演習: 10 分\n" -"質問:\n" +"title: \"ヘルプ機能\"\n" +"teaching: 10 分\n" +"exercises: 10 分\n" +"questions:\n" "- \"R のヘルプ機能はありますか?\"\n" -"目標:\n" +"objectives:\n" "- \"関数や特別な演算子に関する R のヘルプファイルにアクセス出来るようになりましょう。\"\n" "- \"CRAN のタスクビューを使って課題が解決出来るようなパッケージの特定が出来るようになりましょう。\"\n" "- \"あなたの仲間にヘルプを求められるようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"R の `help()` でオンラインヘルプを使用する。\"\n" "source: Rmd\n" "---" @@ -4416,18 +4416,18 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 04-data-structures-part1.md in _episodes_rmd/\n" -"タイトル: \"データの構造\"\n" -"講義: 40分\n" -"演習: 15分\n" -"質問:\n" +"title: \"データの構造\"\n" +"teaching: 40分\n" +"exercises: 15分\n" +"questions:\n" "- \"How can I read data in R のデータはどう読めばいいですか?\"\n" "- \"R の基本的なデータタイプにはどのようなものがありますか?\"\n" "- \"R のカテゴリー情報はどのように表現しますか ?\"\n" -"目標:\n" +"objectives:\n" "- \"様々なタイプのデータがあることを理解しましょう。\"\n" "- \"データフレームとその要素がベクター、ファクターおよびリストとどのように関連しているかを理解しましょう。\"\n" "- \"オブジェクトのタイプ、クラス、および構造の確認を R で行えるようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"R のテーブル型のデータの読み込みには `read.csv` を使う。\"\n" "- \"R の基本的なデータタイプには`double(浮動小数点型)`、`integer(整数型)`、`complex(複素数型)`、`logical(論理型)`、そして`character(文字型)`がある。\"\n" "- \"R では、データのカテゴリーを表すのに`factor (ファクター)` を使う。\"\n" @@ -7108,19 +7108,19 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 05-data-structures-part2.md in _episodes_rmd/\n" -"タイトル: \"Exploring Data Frames\"\n" -"講義: 20分\n" -"演習: 10分\n" -"質問:\n" +"title: \"Exploring Data Frames\"\n" +"teaching: 20分\n" +"exercises: 10分\n" +"questions:\n" "- \"データフレームはどのように操作すればよいですか?\"\n" -"目標:\n" +"objectives:\n" "- \"行や列を追加したり削除出来るようになりましょう。\"\n" "- \"`NA`が入っている行の削除が出来るようになりましょう。\"\n" "- \"2 つのデータフレームをマージできるようになりましょう。\"\n" "- \"`factor (ファクター)`について理解しましょう。\"\n" "- \"`factor` を `character (文字型)`に変換、またはその逆の変換が出来るようになりましょう。\"\n" "- \"データフレームの列のサイズやクラスなどの基本的なプロパティ、および名前や最初の数行の表示が出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"新しい列をデータフレームに追加するときは `cbind()` を使用する。\"\n" "- \"新しい行をデータフレームに追加するときは `rbind()` を使用する。\"\n" "- \"データフレームから行を削除するとき\"\n" @@ -8378,16 +8378,16 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 06-data-subsetting.md in _episodes_rmd/\n" -"タイトル: データの部分集合化\n" -"講義: 35分\n" -"演習: 15分\n" -"質問:\n" +"title: データの部分集合化\n" +"teaching: 35分\n" +"exercises: 15分\n" +"questions:\n" "- \"データの部分集合化を R で行うにはどのようにすればいいですか?\"\n" -"目標:\n" +"objectives:\n" "- \"ベクター、ファクター、マトリックス、リスト、およびデータフレームの部分化が出来るようになりましょう。\"\n" "- \"インデックス、名前、および比較演算子を使用してデータ内の個々および複数の要素を取り出せるようになりましょう。\"\n" "- \"様々なデータ構造の要素のスキップや削除が出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"R のインデックスは 0 ではなく 1 から始まる。\"\n" "- \"`[]` を使用して個々の値にアクセス出来る。\"\n" "- \"`[下の番号:上の番号]` を使用してスライスされたデータにアクセス出来る。\"\n" @@ -11082,16 +11082,16 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 07-control-flow.md in _episodes_rmd/\n" -"タイトル: 実行の制御\n" -"講義: 45 分\n" -"演習: 20 分\n" -"質問:\n" +"title: 実行の制御\n" +"teaching: 45 分\n" +"exercises: 20 分\n" +"questions:\n" "- \"R でデータに依存した選択を行うにはどうすればよいですか?\"\n" "- \"R で処理を繰り返すにはどうすればよいですか?\"\n" -"目標:\n" +"objectives:\n" "- \"`if()` と `else()` で条件文が書けるようになりましょう。\"\n" "- \"`for()` ループを理解して使えるようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"選択の際は `if` と `else` を使う。\"\n" "- \"繰り返す処理には `for` を使う。\"\n" "source: Rmd\n" @@ -12294,7 +12294,7 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 08-plot-ggplot2.md in _episodes_rmd/\n" -"タイトル: ggplot2 を用いたパブリッシュ出来るグラフィックスの作成\n" +"title: ggplot2 を用いたパブリッシュ出来るグラフィックスの作成\n" "講義: 60 分\n" "練習: 20 分\n" "質問:\n" @@ -13287,14 +13287,14 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 09-vectorization.md in _episodes_rmd/\n" -"タイトル: ベクトル化\n" -"講義: 10 分\n" -"演習: 15 分\n" -"質問:\n" +"title: ベクトル化\n" +"teaching: 10 分\n" +"exercises: 15 分\n" +"questions:\n" "- \"ベクトルの全要素はどうしたら一括で操作出来ますか?\"\n" -"目標:\n" +"objectives:\n" "- \"R におけるベクトル化された操作を理解しましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"ループの代わりにベクトル化を利用します。\"\n" "source: Rmd\n" "---" @@ -14202,19 +14202,19 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 10-functions.md in _episodes_rmd/\n" -"タイトル: 関数について\n" -"講義: 45 分\n" -"演習: 15 分\n" -"質問:\n" +"title: 関数について\n" +"teaching: 45 分\n" +"exercises: 15 分\n" +"questions:\n" "- \"R で関数はどのように書きますか?\"\n" -"目標:\n" +"objectives:\n" "- \"引数を持つ関数を定義しましょう。\"\n" "- \"関数から値を返しましょう。\"\n" "- \"関数の中で `stopifnot()` を使って引数の状態を検査しましょう。\"\n" "- \"関数をテストしましょう。\"\n" "- \"関数の引数に既定値を指定しましょう。\"\n" "- \"なぜプログラムを小さな一つの目的を持つ関数に分けるべきか説明出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"`function` を使って R で新しい関数を定義する。\"\n" "- \"パラメーターを用いて関数に値を渡す。\"\n" "- \"`stopifnot()` を使って R の関数の引数を柔軟に検査する。\"\n" @@ -15487,16 +15487,16 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 11-writing-data.md in _episodes_rmd/\n" -"title: データの出力\n" -"講義: 10\n" -"練習: 10\n" -"質問:\n" -"- \"Rで作った図を保存するにはどうしますか?\"\n" -"目標:\n" -"- \"R から図やデータを 出力出来るようになりましょう。\"\n" -"要点:\n" -"- \"RStudio のエクスポートボタンを使って図を保存しましょう。\"\n" -"- \"`write.table` を使って表形式のデータを保存しましょう。\"\n" +"title: データの書き込み\n" +"teaching: 10\n" +"exercises: 10\n" +"questions:\n" +"- \"R で作成したプロットやデータを保存するにはどうすればよいですか?\"\n" +"objectives:\n" +"- \"R からプロットやデータを書き出せるようになりましょう。\"\n" +"keypoints:\n" +"- \"'Export' ボタンを使って RStudio からプロットの保存が出来る。\"\n" +"- \"`write.table` を使って表形式のデータの保存が出来る。\"\n" "source: Rmd\n" "---" @@ -15896,13 +15896,13 @@ msgstr "" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 12-plyr.md in _episodes_rmd/\n" "title: Splitting and Combining Data Frames with plyr によるデータの分離と併合\n" -"講義: 30 分\n" -"演習: 30 分\n" -"質問:\n" +"teaching: 30 分\n" +"exercises: 30 分\n" +"questions:\n" "- \"異なるデータセットに異なる計算を施すにはどうすればよいですか?\"\n" -"目標:\n" +"objectives:\n" "- \"`split-apply-combine (分離-施工-併合)` をデータ分析に使えるようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"`plyer` パッケージを使用して、データの分離、部分化されたデータに関数の適用、そして結果を併合する。\"\n" "source: Rmd\n" "---" @@ -16817,16 +16817,16 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 13-dplyr.md in _episodes_rmd/\n" -"タイトル: Dataframe Manipulation with dplyr\n" -"講義: 40 分\n" -"演習: 15 分\n" -"質問:\n" +"title: Dataframe Manipulation with dplyr\n" +"teaching: 40 分\n" +"exercises: 15 分\n" +"questions:\n" "- \"同じ作業を繰り返すことなく、データフレームを操作するにはどうすればよいです?\"\n" -"目標:\n" +"objectives:\n" "- \"`dplyr` にある 6 つの操作 を パイプ を使用して出来るようになりましょう。.\"\n" "- \"データセットを要約するために `group_by()` と `summarize()` 併用出来ることを理解しましょう。\"\n" "- \"論理フィルターを使用してデータのサブセットを分析出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"`dplyr` パッケージを使用してデータフレームの操作を行う。\"\n" "- \"データフレームから変数を選択する際は `select()` を使用する。\"\n" "- \"値を基にデータを選択する際は `filter()` を使用する。\"\n" @@ -17982,14 +17982,14 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 14-tidyr.md in _episodes_rmd/\n" -"タイトル: tidyr によるデータフレームの操作\n" -"講義: 30 分\n" -"演習: 15 分\n" -"質問:\n" +"title: tidyr によるデータフレームの操作\n" +"teaching: 30 分\n" +"exercises: 15 分\n" +"questions:\n" "- \"データフレームのフォーマットを変更するにはどのようにすればよいですか?\"\n" -"目標:\n" +"objectives:\n" "- \" 「横長」と「縦長」のデータ形式を理解し、`tidyr`を使用して、その変換が出来るようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"データフレームの形式を変更するには `tidyr` を使用する。\"\n" "- \"「横長」から「縦長」に変換するには `gather()` を使用する。\"\n" "- \"「縦長」から「横長」に変換するには `spread()` を使用する。\"\n" @@ -19115,7 +19115,7 @@ msgstr "" "- チャンクのオプション\n" "- 文中の R コード\n" "- 他の出力フォーマット\n" -"キーポイント:\n" +"keypoints:\n" "- \"R のマークダウンと R で作成されたソフトウェアが混在するレポート\"\n" "- \"フォーマット制御のために Specify chunk オプションを指定する。\"\n" "- \"`knitr` を使用してドキュメントを PDF およびほかのフォーマットに出来る。\"\n" @@ -19942,7 +19942,7 @@ msgstr "" "- \"他の人も使えるソフトウェアを描くにはどうしたらよいですか?\"\n" "objectives:\n" "- \"R のプログラミングのベストプラクティスとその理由が説明できるようになりましょう。\"\n" -"キーポイント:\n" +"keypoints:\n" "- \"常にプロジェクトフォルダーを構造化し、整理し、片づけておく。\"\n" "- \"どうやって、ではなく、何であるかとなぜであるかを文書化しておく。\"\n" "- \"プログラムは一つの用途に絞られた短い関数に分割する。\"\n"