From: W. Trevor King Date: Sun, 16 Mar 2014 22:48:56 +0000 (-0700) Subject: *.ipynb: Use absolute URLs to link to the glossary X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=refs%2Fheads%2Fnovice;p=swc-modular-shell.git *.ipynb: Use absolute URLs to link to the glossary SWC has a single, global glossary [1], not per-subject glossaries. Because this per-subject branch no longer contains the global glossary, we need to adjust the links to point at an external glossary. Done automatically with: $ sed -i 's|\.\./\.\./gloss.html|https://github.com/swcarpentry/bc/blob/ma ster/gloss.md|g' *.md [1]: https://github.com/swcarpentry/bc/blob/master/gloss.md --- diff --git a/00-intro.md b/00-intro.md index df0b297..24c329c 100644 --- a/00-intro.md +++ b/00-intro.md @@ -76,11 +76,11 @@ These devices only allowed input and output of the letters, numbers, and punctua so programming languages and interfaces had to be designed around that constraint. This kind of interface is called a -[command-line interface](../../gloss.html#cli), or CLI, +[command-line interface](https://github.com/swcarpentry/bc/blob/master/gloss.md#cli), or CLI, to distinguish it from the -[graphical user interface](../../gloss.html#gui), or GUI, +[graphical user interface](https://github.com/swcarpentry/bc/blob/master/gloss.md#gui), or GUI, that most people now use. -The heart of a CLI is a [read-evaluate-print loop](../../gloss.html#repl), or REPL: +The heart of a CLI is a [read-evaluate-print loop](https://github.com/swcarpentry/bc/blob/master/gloss.md#repl), or REPL: when the user types a command and then presses the enter (or return) key, the computer reads it, executes it, @@ -92,7 +92,7 @@ This description makes it sound as though the user sends commands directly to th and the computer sends output directly to the user. In fact, there is usually a program in between called a -[command shell](../../gloss.html#shell). +[command shell](https://github.com/swcarpentry/bc/blob/master/gloss.md#shell). What the user types goes into the shell; it figures out what commands to run and orders the computer to execute them. diff --git a/01-filedir.md b/01-filedir.md index 261b9a1..21304b5 100644 --- a/01-filedir.md +++ b/01-filedir.md @@ -11,7 +11,7 @@ The part of the operating system responsible for managing files and directories -is called the [file system](../../gloss.html#filesystem). +is called the [file system](https://github.com/swcarpentry/bc/blob/master/gloss.md#filesystem). It organizes our data into files, which hold information, and directories (also called "folders"), @@ -27,7 +27,7 @@ $ ~~~ -The dollar sign is a [prompt](../../gloss.html#prompt), +The dollar sign is a [prompt](https://github.com/swcarpentry/bc/blob/master/gloss.md#prompt), which shows us that the shell is waiting for input; your shell may show something more elaborate. @@ -59,14 +59,14 @@ Next, let's find out where we are by running a command called `pwd` (which stands for "print working directory"). At any moment, -our [current working directory](../../gloss.html#current-working-directory) +our [current working directory](https://github.com/swcarpentry/bc/blob/master/gloss.md#current-working-directory) is our current default directory, i.e., the directory that the computer assumes we want to run commands in unless we explicitly specify something else. Here, the computer's response is `/users/vlad`, -which is Vlad's [home directory](../../gloss.html#home-directory): +which is Vlad's [home directory](https://github.com/swcarpentry/bc/blob/master/gloss.md#home-directory):
~~~ @@ -94,7 +94,7 @@ $ pwd To understand what a "home directory" is, let's have a look at how the file system as a whole is organized. -At the top is the [root directory](../../gloss.html#root-directory) +At the top is the [root directory](https://github.com/swcarpentry/bc/blob/master/gloss.md#root-directory) that holds everything else. We refer to it using a slash character `/` on its own; this is the leading slash in `/users/vlad`. @@ -148,7 +148,7 @@ solar.pdf swc `ls` prints the names of the files and directories in the current directory in alphabetical order, arranged neatly into columns. -We can make its output more comprehensible by using the [flag](../../gloss.html#command-line-flag) `-F`, +We can make its output more comprehensible by using the [flag](https://github.com/swcarpentry/bc/blob/master/gloss.md#command-line-flag) `-F`, which tells `ls` to add a trailing `/` to the names of directories:
@@ -165,7 +165,7 @@ solar.pdf swc/
Here, -we can see that `/users/vlad` contains seven [sub-directories](../../gloss.html#sub-directory). +we can see that `/users/vlad` contains seven [sub-directories](https://github.com/swcarpentry/bc/blob/master/gloss.md#sub-directory). The names that don't have trailing slashes, like `notes.txt`, `pizza.cfg`, and `solar.pdf`, are plain old files. @@ -181,7 +181,7 @@ which doesn't exist. > almost anything else we want. However, most people use two-part names > most of the time to help them (and their programs) tell different kinds > of files apart. The second part of such a name is called the -> [filename extension](../../gloss.html#filename-extension), and indicates +> [filename extension](https://github.com/swcarpentry/bc/blob/master/gloss.md#filename-extension), and indicates > what type of data the file holds: `.txt` signals a plain text file, `.pdf` > indicates a PDF document, `.cfg` is a configuration file full of parameters > for some program or other, and so on. @@ -222,12 +222,12 @@ but it's a self-defeating strategy. Notice, by the way that we spelled the directory name `data`. It doesn't have a trailing slash: that's added to directory names by `ls` when we use the `-F` flag to help us tell things apart. -And it doesn't begin with a slash because it's a [relative path](../../gloss.html#relative-path), +And it doesn't begin with a slash because it's a [relative path](https://github.com/swcarpentry/bc/blob/master/gloss.md#relative-path), i.e., it tells `ls` how to find something from where we are, rather than from the root of the file system. If we run `ls -F /data` (*with* a leading slash) we get a different answer, -because `/data` is an [absolute path](../../gloss.html#absolute-path): +because `/data` is an [absolute path](https://github.com/swcarpentry/bc/blob/master/gloss.md#absolute-path):
~~~ @@ -344,7 +344,7 @@ $ cd .. `..` is a special directory name meaning "the directory containing this one", or more succinctly, -the [parent](../../gloss.html#parent-directory) of the current directory. +the [parent](https://github.com/swcarpentry/bc/blob/master/gloss.md#parent-directory) of the current directory. Sure enough, if we run `pwd` after running `cd ..`, we're back in `/users/vlad`: @@ -392,7 +392,7 @@ but we'll see some uses for it soon. > if we are in `/users/vlad/data`, > the command `ls ..` will give us a listing of `/users/vlad`. > When the meanings of the parts are the same no matter how they're combined, -> programmers say they are [orthogonal](../../gloss.html#orthogonal): +> programmers say they are [orthogonal](https://github.com/swcarpentry/bc/blob/master/gloss.md#orthogonal): > Orthogonal systems tend to be easier for people to learn > because there are fewer special cases and exceptions to keep track of. @@ -464,7 +464,7 @@ Pressing tab again does nothing, since there are 1520 possibilities; pressing tab twice brings up a list of all the files, and so on. -This is called [tab completion](../../gloss.html#tab-completion), +This is called [tab completion](https://github.com/swcarpentry/bc/blob/master/gloss.md#tab-completion), and we will see it in many other tools as we go on.
diff --git a/02-create.md b/02-create.md index 67d7768..2b8a861 100644 --- a/02-create.md +++ b/02-create.md @@ -140,7 +140,7 @@ $ ls -s
Unfortunately, -Unix reports sizes in [disk blocks](../../gloss.html#disk-block) by default, +Unix reports sizes in [disk blocks](https://github.com/swcarpentry/bc/blob/master/gloss.md#disk-block) by default, which might be the least helpful default possible. If we add the `-h` flag, `ls` switches to more human-friendly units: diff --git a/03-pipefilter.md b/03-pipefilter.md index a69df4d..e45e493 100644 --- a/03-pipefilter.md +++ b/03-pipefilter.md @@ -55,7 +55,7 @@ $ wc *.pdb > #### Wildcards > -> `*` is a [wildcard](../../gloss.html#wildcard). It matches zero or more +> `*` is a [wildcard](https://github.com/swcarpentry/bc/blob/master/gloss.md#wildcard). It matches zero or more > characters, so `*.pdb` matches `ethane.pdb`, `propane.pdb`, and so on. > On the other hand, `p*.pdb` only matches `pentane.pdb` and > `propane.pdb`, because the 'p' at the front only matches itself. @@ -111,7 +111,7 @@ $ wc -l *.pdb > lengths ~~~
-The `>` tells the shell to [redirect](../../gloss.html#redirect) the command's output +The `>` tells the shell to [redirect](https://github.com/swcarpentry/bc/blob/master/gloss.md#redirect) the command's output to a file instead of printing it to the screen. The shell will create the file if it doesn't exist, or overwrite the contents of that file if it does. @@ -216,7 +216,7 @@ $ sort lengths | head -1 ~~~
-The vertical bar between the two commands is called a [pipe](../../gloss.html#pipe). +The vertical bar between the two commands is called a [pipe](https://github.com/swcarpentry/bc/blob/master/gloss.md#pipe). It tells the shell that we want to use the output of the command on the left as the input to the command on the right. @@ -245,12 +245,12 @@ In our case, the calculation is "head of sort of word count of `*.pdb`". Here's what actually happens behind the scenes when we create a pipe. -When a computer runs a program—any program—it creates a [process](../../gloss.html#process) +When a computer runs a program—any program—it creates a [process](https://github.com/swcarpentry/bc/blob/master/gloss.md#process) in memory to hold the program's software and its current state. -Every process has an input channel called [standard input](../../gloss.html#standard-input). +Every process has an input channel called [standard input](https://github.com/swcarpentry/bc/blob/master/gloss.md#standard-input). (By this point, you may be surprised that the name is so memorable, but don't worry: most Unix programmers call it "stdin". -Every process also has a default output channel called [standard output](../../gloss.html#standard-output) +Every process also has a default output channel called [standard output](https://github.com/swcarpentry/bc/blob/master/gloss.md#standard-output) (or "stdout"). The shell is actually just another program. @@ -285,9 +285,9 @@ This simple idea is why Unix has been so successful. Instead of creating enormous programs that try to do many different things, Unix programmers focus on creating lots of simple tools that each do one job well, and that work well with each other. -This programming model is called [pipes and filters](../../gloss.html#pipe-and-filter). +This programming model is called [pipes and filters](https://github.com/swcarpentry/bc/blob/master/gloss.md#pipe-and-filter). We've already seen pipes; -a [filter](../../gloss.html#filter) is a program like `wc` or `sort` +a [filter](https://github.com/swcarpentry/bc/blob/master/gloss.md#filter) is a program like `wc` or `sort` that transforms a stream of input into a stream of output. Almost all of the standard Unix tools can work this way: unless told to do otherwise, diff --git a/04-loop.md b/04-loop.md index 99cccfd..f649c84 100644 --- a/04-loop.md +++ b/04-loop.md @@ -34,7 +34,7 @@ $ mv basilisk.dat unicorn.dat This wouldn't back up our files: it would replace the content of `unicorn.dat` with whatever's in `basilisk.dat`. -Instead, we can use a [loop](../../gloss.html#for-loop) +Instead, we can use a [loop](https://github.com/swcarpentry/bc/blob/master/gloss.md#for-loop) to do some operation once for each thing in a list. Here's a simple example that displays the first three lines of each file in turn: @@ -62,7 +62,7 @@ it knows it is supposed to repeat a command (or group of commands) once for each In this case, the list is the two filenames. Each time through the loop, the name of the thing currently being operated on is assigned to -the [variable](../../gloss.html#variable) called `filename`. +the [variable](https://github.com/swcarpentry/bc/blob/master/gloss.md#variable) called `filename`. Inside the loop, we get the variable's value by putting `$` in front of it: `$filename` is `basilisk.dat` the first time through the loop, @@ -122,7 +122,7 @@ done The shell starts by expanding `*.dat` to create the list of files it will process. -The [loop body](../../gloss.html#loop-body) +The [loop body](https://github.com/swcarpentry/bc/blob/master/gloss.md#loop-body) then executes two commands for each of those files. The first, `echo`, just prints its command-line parameters to standard output. For example: @@ -203,7 +203,7 @@ the `head` and `tail` combination selects lines 81-100 from whatever file is bei > and won't be asked to read the file `red dragon.dat`. > > We can make our script a little bit more robust -> by [quoting](../../gloss.html#shell-quoting) our use of the variable: +> by [quoting](https://github.com/swcarpentry/bc/blob/master/gloss.md#shell-quoting) our use of the variable: > > ~~~ > for filename in *.dat diff --git a/05-script.md b/05-script.md index d72c063..c9e44aa 100644 --- a/05-script.md +++ b/05-script.md @@ -12,7 +12,7 @@ We are finally ready to see what makes the shell such a powerful programming env We are going to take the commands we repeat frequently and save them in files so that we can re-run all those operations again later by typing a single command. For historical reasons, -a bunch of commands saved in a file is usually called a [shell script](../../gloss.html#shell-script), +a bunch of commands saved in a file is usually called a [shell script](https://github.com/swcarpentry/bc/blob/master/gloss.md#shell-script), but make no mistake: these are actually small programs. @@ -147,7 +147,7 @@ ATOM 18 C 1 -0.696 -2.628 -0.641 This works, but it may take the next person who reads `middle.sh` a moment to figure out what it does. -We can improve our script by adding some [comments](../../gloss.html#comment) at the top: +We can improve our script by adding some [comments](https://github.com/swcarpentry/bc/blob/master/gloss.md#comment) at the top:
~~~ diff --git a/06-find.md b/06-find.md index b719892..ed0bc88 100644 --- a/06-find.md +++ b/06-find.md @@ -190,7 +190,7 @@ matched. (-F is specified by POSIX.) > > `grep`'s real power doesn't come from its options, though; it comes from > the fact that patterns can include wildcards. (The technical name for -> these is [regular expressions](../../gloss.html#regular-expression), which +> these is [regular expressions](https://github.com/swcarpentry/bc/blob/master/gloss.md#regular-expression), which > is what the "re" in "grep" stands for.) Regular expressions are both complex > and powerful; if you want to do complex searches, please look at the lesson > on [our website](http://software-carpentry.org). As a taster, we can