Archived
1
0
Fork 0
This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
shbot/shtrains.sh

32 lines
632 B
Bash
Raw Permalink Normal View History

2009-07-06 17:26:39 +02:00
#!/bin/bash
links -dump 'http://transilien.mobi/pam/TempReelSaisieDepartSubmit.do?debutDepart=Courbevoie&tous=Tous+trains' >trains.tmp
2009-07-06 17:26:39 +02:00
2009-07-07 09:56:53 +02:00
cat trains.tmp | \
while true
do
while true
do
read PATTERN || break
if [[ $PATTERN =~ \ *[A-Z]{4}\ *(.*)\ *Voie ]]; then
PATTERN=${BASH_REMATCH[1]}
break
fi
done
2009-07-07 09:56:53 +02:00
read STATION || break
read UGUU || break
if [[ $UGUU =~ Supprime ]]; then
read UGUU || break
continue
fi
#[[ $STATION =~ Versailles\ Rive\ Droite ]] && STATION="Versailles Rive Droit"
2009-07-07 09:56:53 +02:00
if [ -n "$*" ]; then
[[ $STATION =~ $@ ]] && echo "$PATTERN $STATION"
else
echo "$PATTERN $STATION"
fi
done
2009-07-06 17:26:39 +02:00
exit 0