Skip to content

Commit 4a7de89

Browse files
committed
Update scripting.md for typos and formatting issues
1 parent ee070e6 commit 4a7de89

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/scripting.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ We start scripting with a simple example. The task at hand is to check how many
5454

5555
**What it does**
5656

57-
- First line of the script: telling the system it should be executed in the ``bash`` shell, since commands differ between shells (the program loader is told to run the program ``/bin/bash`` as first argument). ``#!`` are called "shebang"
58-
- second line: search for the string ``ABCD`` in the file ``file.dat``, then redirect the output to the file ``file_filtered.dat``
59-
- third line: run the command ``wc -l`` with the file ``file_filtered.dat`` as input. It then redirects the output to the file ``output.dat``.
57+
- First line of the script: telling the system it should be executed in the ``bash`` shell, since commands differ between shells (the program loader is told to run the program ``/bin/bash`` as first argument). ``#!`` are called "shebang"
58+
- second line: search for the string ``ABCD`` in the file ``file.dat``, then redirect the output to the file ``file_filtered.dat``
59+
- third line: run the command ``wc -l`` with the file ``file_filtered.dat`` as input. It then redirects the output to the file ``output.dat``.
6060

6161
We can now execute two Linux commands with a single line.
6262

@@ -165,7 +165,7 @@ Check that ``count_ABCD.sh`` has executable permissions and executed the script
165165
$ ./count_ABCD.sh file.dat
166166
```
167167

168-
This should give the same result of 2 as before. When running the script ``count_ABCD`` the ``$1`` gets replaced with the first argument you write after the name of the script. The file ``file2.dat`` can now be processed without changing the script:
168+
This should give the same result of 2 as before. When running the script ``count_ABCD.sh`` the ``$1`` gets replaced with the first argument you write after the name of the script. The file ``file2.dat`` can now be processed without changing the script:
169169

170170
```bash
171171
$ ./count_ABCD.sh file2.dat
@@ -193,7 +193,7 @@ $ ./count_string.sh file2.dat ABCD
193193
3
194194
```
195195

196-
of for the word 'line' by changing the input at the prompt
196+
alternatively you can search for the word 'line' by changing the input at the prompt
197197

198198
```bash
199199
$ ./count_string.sh file.dat line
@@ -212,7 +212,7 @@ It is useful to write comments into your script, to make their actions more unde
212212

213213
Obviously this excludes the shebang in the first line of the script.
214214

215-
Open ``count_string`` in an editor and add comments
215+
Open ``count_string.sh`` in an editor and add comments
216216

217217
!!! Example "Commented version of count_string.sh"
218218

0 commit comments

Comments
 (0)