mirror of https://github.com/01-edu/public.git
nprimo
2 years ago
committed by
Niccolò Primo
3 changed files with 117 additions and 0 deletions
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
IFS=' |
||||
' |
||||
|
||||
challenge () { |
||||
if [[ $# -eq 1 ]]; then |
||||
submitted=$(bash student/remake.sh "$1") |
||||
expected=$(bash solutions/remake.sh "$1"-expected) |
||||
diff <(echo $submitted) <(echo $expected) |
||||
diff <(ls -ltr $1) <(ls -ltr $1-expected) |
||||
else |
||||
diff <(bash student/remake.sh "$@") <(bash solutions/remake.sh "$@") |
||||
fi |
||||
} |
||||
|
||||
challenge a |
||||
challenge |
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
IFS=' |
||||
' |
||||
|
||||
if [[ $# -eq 1 ]]; then |
||||
mkdir -p $1 |
||||
cd $1 |
||||
touch -t 01010001 ciao |
||||
chmod 442 ciao |
||||
mkdir mamma |
||||
touch -t 01020001 mamma |
||||
chmod 777 mamma |
||||
touch -t 01030001 guarda |
||||
chmod 400 guarda |
||||
touch -t 01040001 come |
||||
chmod 642 come |
||||
mkdir mi |
||||
touch -t 01050001 mi |
||||
chmod 452 mi |
||||
touch -t 01060001 diverto |
||||
chmod 421 diverto |
||||
else |
||||
echo Error |
||||
exit 1 |
||||
fi |
Loading…
Reference in new issue