42 lines
880 B
Bash
Executable File
42 lines
880 B
Bash
Executable File
#!/bin/bash
|
|
# Auteur: Pascal ANELLI
|
|
# 6 fev 2020
|
|
# Session 3
|
|
|
|
source ${LIBSH}/libeval.sh
|
|
|
|
#-------------------------
|
|
rep=/home/alice/Sequence2/A24
|
|
challenge=C24Q2
|
|
#-------------------------
|
|
# Debut
|
|
banniere $challenge
|
|
echo -e "ATTENTION\n Lancement de l'evaluateur par la commande : \n\t\tjobs | evalQ242"
|
|
|
|
|
|
jobs="$(mktemp)"
|
|
|
|
# Dump the jobs
|
|
cat - >|$jobs
|
|
|
|
# 1 number of jobs
|
|
[ $(cat $jobs | wc -l) -eq 3 ]
|
|
step $(vraifaux $?) "La liste des jobs contient le nombre exact de jobs "
|
|
|
|
# 2 good jobs
|
|
[ $(cat "$jobs" | grep -c "macmd") -eq 3 ]
|
|
step $(vraifaux $?) "La liste des jobs contient les commandes demandees "
|
|
|
|
# 3 good jobs ID
|
|
code=$(cat "$jobs" | sed -n -e 's/].*//p' | sed -n -e 's/^\[//p' | tr -d ' \n')
|
|
[ "$code" == "126" ]
|
|
step $(vraifaux $?) "Les numeros de jobs sont corrects "
|
|
|
|
#-------------------------
|
|
# Fin
|
|
status "${challenge}_$res"
|
|
|
|
rm -f $jobs
|
|
exit 0
|
|
|