Feeds:
Posts
Comments

Archive for the ‘Scripting’ Category

#!/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" ]; [...]

Read Full Post »

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

Read Full Post »

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 [...]

Read Full Post »

Shell scripting

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 [...]

Read Full Post »

AWK Programming

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 [...]

Read Full Post »