diff options
-rwxr-xr-x | livetimes.sh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/livetimes.sh b/livetimes.sh index 5f633f1..39ebc07 100755 --- a/livetimes.sh +++ b/livetimes.sh @@ -1,6 +1,5 @@ #!/bin/bash # TODO: If $stop similar to "Bus Station" then reject and suggest user tries supplying a route number to see when their next bus leaves the station -# TODO: Fix duplication of destinations and routes in result read stop # function to provide data to a for loop @@ -13,7 +12,6 @@ _liveresult() { exitcode=$? # sort livetimes by service_number and eta livetimes=$(echo ${livetimes} | jq 'sort_by((.service_number | sub("[^0-9]$"; "") | tonumber), (.service_number | sub("[^A-Z]$"; "") | tostring), .eta)') - #livetimes=$(echo ${livetimes} | jq 'sort_by((.service_number | [ (sub("[^0-9]*$"; "") | tonumber), sub("^[0-9]*"; "") ]), .eta))' livetimeslen=$(echo ${livetimes} | jq '. | length') if [ $exitcode != 0 ]; then echo "cURL error - exiting." @@ -26,7 +24,7 @@ _liveresult() { if [[ $(_jq '.service_number') != $outroute ]]; then result=$(echo $result | sed 's/,$//') result="$result | Dest: $(_jq '.destination')[$(_jq '.service_number')] - ETAs: $(_jq '.eta'), " - elif [ $outroute = $outroute ]; then + else result="$result $(_jq '.eta'), " fi outroute=$(_jq '.service_number') |