run-11.sh 670 Bytes
#!/bin/bash

#set -e

CORES=16
INPUT_DIR=/data/muntean/english-tweets
OUTPUT_DIR=/data/muntean/filter-10-cities-november-tweets
COMMAND="time python filter_tweets_by_city.py"

for LINE in `ls $INPUT_DIR/english-tweets-2015112*`
do
        #echo $LINE
        #echo $COMMAND
        #echo $OUTPUT_DIR
        NUMBER=$(echo $LINE | tr -dc '0-9')
        #echo $NUMBER
        sem -j $CORES $COMMAND $LINE $OUTPUT_DIR 2>&1 > $OUTPUT_DIR/stats-$NUMBER-FTBC.tsv
done
sem --wait

#RET_CODE=${PIPESTATUS[0]}
 #      if ${RET_CODE} -ne 0; then
  #             printf "\e[0;31m%s\e[0m\n" "FAILED .... Error Code: ${RET_CODE}."
   #            exit ${RET_CODE}
    #   fi

exit 0