#!/bin/bash #Get the pics #set -x DIR=~/Pictures/to_post MESSAGE=$DIR/newspost.txt NUM_PIC=24 #number of pictures to be posted QUEUE2=`find ~/Pictures/to_work_on/wpm|wc -l` GROUP='alt.binaries.pictures.wallpaper' #GROUP='al.binares.test' # COUNTING : Counting and sorting files {{{ COUNTING () { find $DIR/t -name "*.jpg" >> $DIR/files.txt TOTAL=`wc -w < $DIR/files.txt` for COUNT in `seq $NUM_PIC` #35 do if [ $TOTAL = "0" ] then rm $DIR/files.txt exit fi FILE=`head -$((($RANDOM * 32678 +$RANDOM) % $TOTAL + 1)) $DIR/files.txt|tail -1|awk -F: '{print $NF}'` echo $FILE >> end_file.txt grep -v $FILE $DIR/files.txt > $DIR/files.txt.tmp mv $DIR/files.txt.tmp $DIR/files.txt let TOTAL=TOTAL-1 done rm $DIR/files.txt cat > $MESSAGE <