I've a backup script (bash). Part of it is shown below. This script does a 14 day rotation of the backup. If I want to change this to say 30 days, I'd have to write out 30 such if-then blocks. I'm sure this could be replaced by a nifty for-loop. What would it be?

# step 1: delete the oldest snapshot, if it exists:
if [ -d $BACKUP_DIR/daily.14 ] ; then                   \
$RM -rf $BACKUP_DIR/daily.14 ;                          \
fi ;

# step 2: shift the middle snapshot(s) back by one, if they exist
if [ -d $BACKUP_DIR/daily.13 ] ; then                   \
$MV $BACKUP_DIR/daily.13 $BACKUP_DIR/daily.14 ; \
fi;

if [ -d $BACKUP_DIR/daily.12 ] ; then                   \
$MV $BACKUP_DIR/daily.12 $BACKUP_DIR/daily.13 ; \
fi;

if [ -d $BACKUP_DIR/daily.11 ] ; then                   \
$MV $BACKUP_DIR/daily.11 $BACKUP_DIR/daily.12 ; \
fi;

if [ -d $BACKUP_DIR/daily.10 ] ; then                   \
$MV $BACKUP_DIR/daily.10 $BACKUP_DIR/daily.11 ; \
fi;

if [ -d $BACKUP_DIR/daily.9 ] ; then                    \
$MV $BACKUP_DIR/daily.9 $BACKUP_DIR/daily.10 ;  \
fi;

if [ -d $BACKUP_DIR/daily.8 ] ; then                    \
$MV $BACKUP_DIR/daily.8 $BACKUP_DIR/daily.9 ;   \
fi;

if [ -d $BACKUP_DIR/daily.7 ] ; then                    \
$MV $BACKUP_DIR/daily.7 $BACKUP_DIR/daily.8 ;   \
fi;

if [ -d $BACKUP_DIR/daily.6 ] ; then                    \
$MV $BACKUP_DIR/daily.6 $BACKUP_DIR/daily.7 ;   \
fi;

if [ -d $BACKUP_DIR/daily.5 ] ; then                    \
$MV $BACKUP_DIR/daily.5 $BACKUP_DIR/daily.6 ;   \
fi;

if [ -d $BACKUP_DIR/daily.4 ] ; then                    \
$MV $BACKUP_DIR/daily.4 $BACKUP_DIR/daily.5 ;   \
fi;

if [ -d $BACKUP_DIR/daily.3 ] ; then                    \
$MV $BACKUP_DIR/daily.3 $BACKUP_DIR/daily.4 ;   \
fi;

if [ -d $BACKUP_DIR/daily.2 ] ; then                    \
$MV $BACKUP_DIR/daily.2 $BACKUP_DIR/daily.3 ;   \
fi;

if [ -d $BACKUP_DIR/daily.1 ] ; then                    \
$MV $BACKUP_DIR/daily.1 $BACKUP_DIR/daily.2 ;   \
fi;


# step 3: make a hard-link-only (except for dirs) copy of the latest snapshot, if that exists
if [ -d $BACKUP_DIR/daily.0 ] ; then                    \
$CP -al $BACKUP_DIR/daily.0 $BACKUP_DIR/daily.1 ;       \
fi;



Question: Is there any performance difference between ++i and i++ in C#?
Answer: Guys, guys, the "answers" are for C and C++.

C# is a different animal.

Use ILDASM to look at the compiled output to verify if there is an MSIL difference.