You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/scripting.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,9 @@ We start scripting with a simple example. The task at hand is to check how many
54
54
55
55
**What it does**
56
56
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``.
60
60
61
61
We can now execute two Linux commands with a single line.
62
62
@@ -165,7 +165,7 @@ Check that ``count_ABCD.sh`` has executable permissions and executed the script
165
165
$ ./count_ABCD.sh file.dat
166
166
```
167
167
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:
0 commit comments