All pastes #422421 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-03 13:36 UTC
rendered paste body
#!/bin/sh

keepdirs=""

for i in `seq 0 7`; do

        keepday=$(date +%d-%m-%Y -d "$i days ago")
        keepdirs="$keepday $keepdirs"

done

monthly=$(date +01-%m-%Y)

#monthly="01-01-2007"

if [ -z $(echo "$keepdirs" | grep "$monthly") ]; then

        keepdirs="$keepdirs $monthly"

fi

echo $keepdirs