I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Sunday, 10 June 2012

Simple script to install some packages for my server

#! /bin/bash

#CMD='apt-get -y install %s';
CMD='echo %s';
REGEXP='(#.*|^\s*$)'



function installPackage(){
PERFORM_CMD=`printf "${CMD}" $1`;
echo ${PERFORM_CMD};
${PERFORM_CMD};
}


function installPackages(){
while read line
do
if [[ $line =~ $REGEXP ]]; then
continue;
fi
installPackage $line;
done <$1 } # for PACKAGE_LIST in installfiles.txt; do installPackages ${PACKAGE_LIST}; done