Thankyou for your reply I am studying those and they seem helpful (specially # last operation ok?
check by yuripaes) but still there are 4 other things in which I need help.
1: What will be the bullet proof type script to install following;
apt-get update && apt-get install build-essential default-jre unzip libxslt1-dev libpng12-dev libjpeg62-dev ttf-dejavu libtiff4-dev libjasper-dev libfontconfig1-dev libxml2-dev ghostscript libopenexr-dev libwmf-dev librsvg2-dev libfftw3-dev liblzma-dev liblcms1-dev graphviz-dev libdjvulibre-dev openssl xorg libssl-dev mysql-server
2: How to replace the following line in file "/etc/apt/sources.list" with my own using sed;
squeeze main contrib non-free
3:Now i tried the following script to check if user is logged in as a root user or not, if not then login as root user but when I run this script the shell get login as root user but does not run the remaining script.
if [ `whoami` != root ]; then
echo "$0:Logging as root ";
4: Can any one share link to some recommended shell script tutorial