@@ -13,6 +13,29 @@ echo hello # how are you? my command ls ; cd
...
@@ -13,6 +13,29 @@ echo hello # how are you? my command ls ; cd
When it will come the time to write scripts, you will have to use it extensively to comment your code...
When it will come the time to write scripts, you will have to use it extensively to comment your code...
## Variable
A variable is a named storage location that holds a value or information. Think of a variable as a container. The name of the variable allows you to refer to and access the stored value.
In bash any character or string can become a variable storing any value using the = sign as follow:
```bash
v=hello
var=4
echo$v
echo$var
```
!!! question "Try to define a variable `number` and initialize it to 10. Display the value of the variable with `echo`. Change its value to 20 and display it"
??? example "Click to show the solution"
```bash
number=10
echo$number
number=20
echo$number
```
## First script
## First script
!!! question "Write a bash script called `count.sh` that allows to count the number of files contained in the directory `training_unix_basics/data`"
!!! question "Write a bash script called `count.sh` that allows to count the number of files contained in the directory `training_unix_basics/data`"