This shell script  recodes individual identifiers in a pedfile as integers: useful for packages such as snpMatrix.  It requires R and gawk to be installed

Save it as recodepedIDs.sh, download the R script recodeids.R, and call the script with

recodepedIDs.sh <filename>

where pedfile is

The original pedfile will be moved to <filename>.origIDs.ped

#!/bin/bash
export PEDFILE=$1
mv $PEDFILE.ped $PEDFILE.origIDs.ped
R CMD BATCH --vanilla recodeids.R recodeidsR.log
cat $PEDFILE.origIDs.ped | gawk '{for(x=1; x<=6; x++)$x=""; print}' > $PEDFILE.no6
paste $PEDFILE.ped6 $PEDFILE.no6 > $PEDFILE.newIDs.ped
mv $PEDFILE.newIDs.ped $PEDFILE.ped
rm $PEDFILE.no6
rm $PEDFILE.ped6