Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:bash [2022/02/11 11:02] – [Generalities] mh | linux:bash [2022/02/28 14:54] (current) – mh | ||
---|---|---|---|
Line 19: | Line 19: | ||
Bash is **not a strict interpreter**. | Bash is **not a strict interpreter**. | ||
- | Beware of the ambiguity we are used to while expressing ourselves with human languages. | + | **Beware of the ambiguity** we are used to while expressing ourselves with human languages. |
- | The discipline of writing clear, safe and precise code lies heavily upon the user. | + | The **discipline of writing clear, safe and precise code** lies heavily upon the user. |
- | **Don' | + | __**Don' |
</ | </ | ||
Line 35: | Line 35: | ||
Many command types are syntax sugar: their effect can be achieved differently, | Many command types are syntax sugar: their effect can be achieved differently, | ||
</ | </ | ||
+ | |||
+ | ==== Variables ==== | ||
+ | |||
+ | Before a command' | ||
==== Basic commands ==== | ==== Basic commands ==== | ||
Line 41: | Line 45: | ||
Bash performs a search using this name and looks for : | Bash performs a search using this name and looks for : | ||
- | *alias (first) | + | *alias (before anything else) |
*functions | *functions | ||
*built-in commands | *built-in commands | ||
Line 59: | Line 63: | ||
echoname | echoname | ||
john | john | ||
+ | </ | ||
+ | ---- | ||
+ | |||
+ | === type === | ||
+ | |||
+ | Displays information on a command, and where it is stored. | ||
+ | |||
+ | //Note that the **type** command and the **which** program are different and give different outputs// | ||
+ | |||
+ | **Example** | ||
+ | <code bash> | ||
+ | $ type ls | ||
+ | ls is aliased to 'ls -al' | ||
</ | </ | ||
---- | ---- | ||
Line 102: | Line 119: | ||
They can be a filename, a variable name, the name of a program or just a litteral. | They can be a filename, a variable name, the name of a program or just a litteral. | ||
+ | |||
+ | Multiple arguments can be used, separated by a blank space | ||
</ | </ | ||
Line 184: | Line 203: | ||
There can be **no whitespace** around the = operator ! | There can be **no whitespace** around the = operator ! | ||
- | If a whitespace is required in the variable, use '' | + | If a whitespace is required in the variable, use 'single |
</ | </ | ||
Line 324: | Line 343: | ||
As a result, both file descriptors are connected to the same stream. | As a result, both file descriptors are connected to the same stream. | ||
+ | Be careful not to write something like '' | ||
</ | </ | ||