mirror of https://github.com/01-edu/public.git
fix(hard-conditions): creating the files in the test and removing unnecessary folder
adding details in the readme
This commit is contained in:
parent
9eb5d849d5
commit
74c7460405
|
@ -1 +0,0 @@
|
|||
echo "hello world"
|
|
@ -5,9 +5,15 @@ set -euo pipefail
|
|||
IFS='
|
||||
'
|
||||
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
|
||||
submitted=$(bash "$script_dirS"/student/hard-conditions.sh hard-conditions/test-hard-conditions.sh)
|
||||
expected=$(bash "$script_dirS"/solutions/hard-conditions.sh hard-conditions/test-hard-conditions.sh)
|
||||
|
||||
echo "echo hello word" >test-hard-conditions.sh
|
||||
echo "echo hello word" >non-ex
|
||||
chmod +x test-hard-conditions.sh
|
||||
|
||||
submitted=$(bash "$script_dirS"/student/hard-conditions.sh test-hard-conditions.sh)
|
||||
expected=$(bash "$script_dirS"/solutions/hard-conditions.sh test-hard-conditions.sh)
|
||||
diff <(echo "$submitted") <(echo "$expected")
|
||||
submitted=$(bash "$script_dirS"/student/hard-conditions.sh hard-conditions/non-ex)
|
||||
expected=$(bash "$script_dirS"/solutions/hard-conditions.sh hard-conditions/non-ex)
|
||||
|
||||
submitted=$(bash "$script_dirS"/student/hard-conditions.sh non-ex)
|
||||
expected=$(bash "$script_dirS"/solutions/hard-conditions.sh non-ex)
|
||||
diff <(echo "$submitted") <(echo "$expected")
|
||||
|
|
|
@ -29,9 +29,9 @@ $ test EXPRESSION
|
|||
$ [ EXPRESSION ]
|
||||
```
|
||||
|
||||
In a shell script, $1 is a special variable that refers to the first argument passed to the script. Arguments are values that are passed to the script when it is run, and they can be used to modify the behavior of the script or provide input to it.
|
||||
In a shell script, `$1` is a special variable that refers to the first argument passed to the script. Arguments are values that are passed to the script when it is run, and they can be used to modify the behavior of the script or provide input to it.
|
||||
|
||||
Here is an example of a simple shell script that prints the value of $1:
|
||||
Here is an example of a simple shell script that prints the value of `$1`:
|
||||
|
||||
```console
|
||||
#!/bin/bash
|
||||
|
@ -43,7 +43,9 @@ echo "The first argument is: $1"
|
|||
To run this script and pass an argument to it, you can use the following command:
|
||||
|
||||
```console
|
||||
./script.sh arg1
|
||||
$ ./script.sh hello
|
||||
The first argument is: hello
|
||||
$
|
||||
```
|
||||
|
||||
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!
|
||||
|
|
Loading…
Reference in New Issue