#!/bin/bash##This is a script to simply and easily copy DVDs to your hard drive from the command line## Variable Declaration #safemk () {if [ ! -d $1 ]; then mkdir $1; chmod +rw $1; fi}
MYHOME=/home/$USERVIDEO=/home/$USER/video/dvds## Scripted Action # OPTIONS=”Home User-Specified Video/dvd QUIT” select opt in $OPTIONS; do if [ "$opt" = "Home" ]; [...]
Archive for the ‘Scripting’ Category
Copy DVDs to your hard drive using script
Posted in Scripting on March 18, 2008 | Leave a Comment »
Introduction to GCC
Posted in GNU/Linux, Scripting on March 15, 2008 | Leave a Comment »
for the GNU Compilers gcc and g++
Nice free book for GCC compiler for beginner
http://www.network-theory.co.uk/docs/gccintro/index.html
Script to Backup and Restore Linux System using tar
Posted in Backup, GNU/Linux, Scripting on March 15, 2008 | 2 Comments »
Looking around Ubuntu forum I came across backing up and restoring Ubuntu / Linux using tar.
The concept shown over is very simple and easy to understand. There are many commercial products such as Norton Ghost and Acronis to image backup Linux server but the following procedure makes task easier to implement.
1. Backing-up
Become a superuser
$ sudo [...]
Shell scripting
Posted in Linux Comm, Scripting on January 30, 2008 | Leave a Comment »
Variables
To separare variable from the rest of the text, use {}
$ echo ${name}7
To remove a variable $name
$ unset $name
To assign a result of a command to a variable
$NAME=`whoami`
or
$NAME=$(whoami)
Standard I/O Redirection
To send the stdout and stderr to two separate files
$ prog >file1 2>file2
To send [...]
AWK Programming
Posted in Linux Comm, Scripting on January 30, 2008 | Leave a Comment »
awk is filter. awk performs the specified action on lines that match the pattern. Like ’sed’, a regular expression pattern must be enclosed in a forward slashes. If no pattern is listed, the action is performed on every input line.
awk ‘pattern {action}’ [files]
$ awk ‘/^S/’ phone.list
$ awk ‘/^S/ {print $1}’ phone.list
Variables
$0 [...]


