css-team: spellcheck

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@280 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
terehm 2018-11-19 15:05:42 +00:00
parent 8378ae0a4e
commit c0a6a75fce
7 changed files with 33 additions and 33 deletions

View File

@ -9,8 +9,8 @@ next-page: pages/scripts/1-variables.html
--- ---
<!-- Echo command text --> <!-- Echo command text -->
<h3>Echo</h3> <h3>Echo</h3>
<p>This command print as output its entire argument on the command-line.<br> <p>This command prints its entire argument as output on the command-line.<br>
It could be used with variables, like in the following example:<br> It can be used with variables, like in the following example:<br>
<pre> <pre>
example="this is an example" example="this is an example"
@ -22,10 +22,10 @@ echo $example
<!-- Cat command text --> <!-- Cat command text -->
<h3>Cat</h3> <h3>Cat</h3>
This command prints the content of a certain file as an output on the This command prints the content of a certain file as output on the
command-line.<br> command-line.<br>
As example, we could imagine a simple text file in nano named "Hello", which contains For example, we could imagine a simple text file in nano named "Hello", which contains
the line "Hello World".<br> the line "Hello World".<br>
So, our command example will look like this:<br> So, our command example will look like this:<br>

View File

@ -10,13 +10,13 @@ next-page: pages/scripts/2-special-variables.html
--- ---
<!-- Intro --> <!-- Intro -->
A variable is simply a string to which we assign a certain type of data, A variable is simply a string to which we assign a certain type of data,
which could be a text, a number, a filename and other types of data.<br> which could be some text, a number, a filename or other types of data.<br>
<!-- How to name a variable - text --> <!-- How to name a variable - text -->
<h3>Naming a variable</h3> <h3>Naming a variable</h3>
<!-- Explaination --> <!-- Explaination -->
To name a variable in Unix we have to use only letters, numbers or To name a variable in Unix we can only use letters, numbers or
the underscore character (_).<br> the underscore character (_).<br>
Other characters can't be used because they have a special meaning in Unix Shell.<br> Other characters can't be used because they have a special meaning in Unix Shell.<br>
@ -32,7 +32,7 @@ name_4
<!-- How to define a variable - text --> <!-- How to define a variable - text -->
<h3>Defining a variable</h3> <h3>Defining a variable</h3>
To define a certain variable, we could use the following basecase: To define a certain variable, we use the following base case:
<pre> <pre>
variable_name=variable_value variable_name=variable_value
@ -58,7 +58,7 @@ echo $VAR_1
<!-- How to delete a variable - text --> <!-- How to delete a variable - text -->
<h3>Deleting a variable</h3> <h3>Deleting a variable</h3>
Deleting a variable means that shell will remove a certain variable from the list of Deleting a variable means that the shell will remove a certain variable from the list of
those that it tracks.<br> those that it tracks.<br>
To delete a variable we use the following command: To delete a variable we use the following command:
@ -75,7 +75,7 @@ unset VAR_1
<!-- How to protect a variable - text --> <!-- How to protect a variable - text -->
<h3>Protecting variables</h3> <h3>Protecting variables</h3>
To protect a certain variable, we can set them as read-only so that it can't be To protect a certain variable, we can set it as read-only so that it can't be
changed or deleted.<br> changed or deleted.<br>
So, if we try to change the value of VAR_1, the result will be the following: So, if we try to change the value of VAR_1, the result will be the following:
@ -86,7 +86,7 @@ VAR_1="Blueberry"
VAR_1: This variable is read only. VAR_1: This variable is read only.
</pre> </pre>
If we try to delete the variable, shell will give us the following value: If we try to delete the variable, the shell will give us the following error:
<pre> <pre>
VAR_1="Strawberry" VAR_1="Strawberry"

View File

@ -9,12 +9,12 @@ previous-page: pages/scripts/1-variables.html
next-page: pages/scripts/3-parameter_expansion.html next-page: pages/scripts/3-parameter_expansion.html
--- ---
<!-- Intro --> <!-- Intro -->
There are certain strings that we can not use in the variable-naming process.<br> There are certain strings that we can't use in the variable-naming process.<br>
In this page we will see what actually are those strings, and what's their purpose.<br> In this page we will see what those strings are, and what their purpose is.<br>
<h4>$$</h4> <h4>$$</h4>
To begin, we will see the simplest variable, which is the dollar sign ($). To begin, we look at the simplest variable, which is the dollar sign ($).
This command simply gives us the process ID number of the current shell.<br> This command simply gives us the process ID of the current shell.<br>
<pre> <pre>
echo $$ echo $$
@ -22,7 +22,7 @@ echo $$
</pre> </pre>
<h4>$0</h4> <h4>$0</h4>
This variable will simply give us the filename of the current script. This variable simply gives us the filename of the current script.
<h4>$n</h4> <h4>$n</h4>
This variable corresponds to the arguments with which a script was invoked. This variable corresponds to the arguments with which a script was invoked.
@ -32,4 +32,4 @@ Here n is a positive number corresponding to the position of an argument.
This variable gives us the number of arguments supplied to a script. This variable gives us the number of arguments supplied to a script.
<h4>$!</h4> <h4>$!</h4>
This variable gives us the process number of the last background command. This variable gives us the process ID of the last background command.

View File

@ -60,7 +60,7 @@ There are also other ways to specify the <i> numerical range </i>. For instance,
your numerical range is too big, you can simply write: <code> {1..100} </code>. This piece your numerical range is too big, you can simply write: <code> {1..100} </code>. This piece
of code means every natural number between 1 and 100 (both included). <br> of code means every natural number between 1 and 100 (both included). <br>
Ranges can also count backward like this: <code>{10..1}</code>. Ranges can also count backward like this: <code>{10..1}</code>.
You can even increment the numerical value by step of two: <code> {0..10..2} </code>. You can even increment the numerical value by steps of two: <code> {0..10..2} </code>.
This piece of code means every natural number between 0 and 10 with a step of two, This piece of code means every natural number between 0 and 10 in steps of two;
0 2 4 6... 10. 0 2 4 6... 10.
<!-- End of Explanation of Numerical Range --> <!-- End of Explanation of Numerical Range -->

View File

@ -31,7 +31,7 @@ done
<!-- End of Introduction --> <!-- End of Introduction -->
<!-- First Example --> <!-- First Example -->
Here is a first simple example: Here is a simple first example:
{% highlight bash %} {% highlight bash %}
i=0; i=0;
@ -80,8 +80,8 @@ do
done done
{% endhighlight %} {% endhighlight %}
No termination condition is set for this loop in this example. This type of loop No termination condition is set for the loop in this example. This type of loop
is called infinite loop.<br> is called an infinite loop.<br>
The <code> exit</code> statement is used to quit the loop. This loop will The <code> exit</code> statement is used to quit the loop. This loop will
iterate for 9 times, then iterate for 9 times, then
as soon as <code> i</code> becomes equal to 0, the condition of the last if as soon as <code> i</code> becomes equal to 0, the condition of the last if

View File

@ -11,7 +11,7 @@ next-page: pages/scripts/8-redirection.html
<!-- Introduction --> <!-- Introduction -->
If statements allow us to make decisions in our Bash scripts. They allow us to If statements allow us to make decisions in our Bash scripts. They allow us to
whether run or not a piece of code based on a condition that we set. <br> decide whether or not to run a piece of code based on a condition that we set. <br>
If statements take this form: If statements take this form:
{% highlight bash %} {% highlight bash %}
@ -39,7 +39,7 @@ In this first example we evaluate a variable <code>i</code> to 105.
The <i> if statement </i> will print "You chose a big number" The <i> if statement </i> will print "You chose a big number"
only if the number contained in our variable <code>i</code> is <b>G</b>reater or only if the number contained in our variable <code>i</code> is <b>G</b>reater or
<b>E</b>qual to 200. <br> <b>E</b>qual to 200. <br>
This is our case, therefore the output of this piece of code will be: This is the case, therefore the output of this piece of code will be:
<pre> <pre>
You chose a big number. You chose a big number.
</pre> </pre>
@ -52,7 +52,7 @@ This is our case, therefore the output of this piece of code will be:
Sometimes we want to perform a certain set of actions, if our condition evaluates to Sometimes we want to perform a certain set of actions, if our condition evaluates to
true and another set of actions if our condition evaluates to false. We can do this with true and another set of actions if our condition evaluates to false. We can do this with
the <i> if else </i> statement. the <i> if else </i> statement.
<i> if else </i> sattements take this form: <i> if else </i> statements take this form:
{% highlight bash %} {% highlight bash %}
if [condition]; then if [condition]; then
command1 command1
@ -78,10 +78,10 @@ else
fi fi
{% endhighlight %} {% endhighlight %}
In this example, that is just an extension of the previous example, we In this example, which is just an extension of the previous example, we
evaluate a variable <code>i</code> to 50. If <code>i</code> is greater or equal to evaluate a variable <code>i</code> to 50. If <code>i</code> is greater or equal to
200, you print out "You chose a big number", otherwise, 200, we print out "You chose a big number", otherwise,
(if <code>i</code> is not greater or equal to 200), just like in this case, you print out (if <code>i</code> is not greater or equal to 200), just like in this case, we print out
"You chose a small number". "You chose a small number".
Therefore, the output of this piece of code is: Therefore, the output of this piece of code is:
@ -130,7 +130,7 @@ else
fi fi
{% endhighlight %} {% endhighlight %}
In this example, that is just an extension of the previous example, we evaluate a In this example, which is just an extension of the previous example, we evaluate a
variable <code>i</code> to 150. If <code>i</code> is greater or equal to 200, variable <code>i</code> to 150. If <code>i</code> is greater or equal to 200,
you print out "You chose a big number", if <code>i</code> is equal to 150 you print out you print out "You chose a big number", if <code>i</code> is equal to 150 you print out
"You chose 150" otherwise you print out "You chose a small number". "You chose 150" otherwise you print out "You chose a small number".

View File

@ -9,7 +9,7 @@ previous-page: pages/scripts/7-if.html
--- ---
<h3>output as input</h3> <h3>output as input</h3>
<br> <br>
To redirect a certain output of the command-line we have to use the symbol "&gt;".<br> To redirect the output of a command we use the symbol "&gt;".<br>
In this case, we will use a file named <i>hello.txt</i>, in which we want to insert In this case, we will use a file named <i>hello.txt</i>, in which we want to insert
a certain output ("Sun" in this case):<br> a certain output ("Sun" in this case):<br>
@ -40,10 +40,10 @@ cat hello.txt
<!-- Input redirection text --> <!-- Input redirection text -->
<h3>input as output</h3> <h3>input as output</h3>
<br> <br>
To redirect an input from a file for a command, the symbol "&lt;" is used. To redirect input from a file for a command, the symbol "&lt;" is used.
<pre> <pre>
echo $lt; $(cat hello.txt) echo &lt; $(cat hello.txt)
Sun Sun
Moon Moon
</pre> </pre>
@ -54,7 +54,7 @@ This is particularly useful when chaining commands.<br>
<h3>Chaining (or piping)</h3> <h3>Chaining (or piping)</h3>
Chaining, also called Piping because it works with the pipe symbol "|", takes Chaining, also called Piping because it works with the pipe symbol "|", takes
the output of a certain command-line and feeds it to another command in a direct way. the output of a certain command and feeds it to another command.
<pre> <pre>
cat hello.txt | grep Mo cat hello.txt | grep Mo
Moon Moon
@ -63,7 +63,7 @@ Moon
<h3>A simple example</h3> <h3>A simple example</h3>
Now let's say that we want to combine those commands in a more complex operation. Now let's say that we want to combine those commands in a more complex operation.
Let's say we want to take some contents from a certain file and put it into another file.<br> Let's say we want to take the content of a certain file and put it into another file.<br>
We want to sort the animals whose name begins with letter "d" from the file We want to sort the animals whose name begins with letter "d" from the file
<i>animals.txt</i> and put it into <i>d_animals.txt</i>.<br> <i>animals.txt</i> and put it into <i>d_animals.txt</i>.<br>