mooc/www/sys/fs/usr/script/old/evalQ242

41 lines
838 B
Plaintext
Raw Normal View History

2023-01-31 09:52:15 +04:00
#!/bin/bash
# Auteur: Pascal ANELLI
# 6 fev 2020
# Session 3
source ${LIBSH}/libeval.sh
#-------------------------
rep=/home/alice/Sequence2/A24
challenge=C24Q2
#-------------------------
# Debut
banniere $challenge
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
# listcode = [ '000', 'ea4', 'fd3', '4b0' ]