background preloader

Shell scripting

Facebook Twitter

Configuring Xterm in Linux. A number of excellent Xterm alternatives are XFCE terminal,gnome-terminal, andKonsole.

Configuring Xterm in Linux

Xterm is a terminal which runs in X. In Linux when you open xterm, you get a small window with a small - hard to read - font by default. Compared to the ordinary xterm, the gnome-terminal and Konsole come loaded with lots of features and are good to view. So why would anybody use an xterm over the other two? The answer lies in its low memory foot print. Configuring Xterm Fonts Here I will explain a number of ways in which you can configure xterm to make it look good and easier to read with larger fonts. If you look in the man page of xterm, you will find that you can configure the following aspects of xterm, namely : Text colourFont familyFont sizeThe xterm window position w.r.t the desktopand much more. Method 1: Choose the fonts and dimensions using Xfontsel The first thing you to do is decide on your choice of font and its size for your xterm. . $ xfontsel. The set Command - Vimperator. Windows XP - Using batch parameters - Vimperator.

KSH script BASICS - Vimperator. Contents Principle of ScriptVariablesBranchingLoopingCommandline ArgumentsComparisonsVariable ManipulationsKsh Regular ExpressionsFunctionsData RedirectionPipesCoprocessesRead Input from User and from FilesSpecial VariablesAction on Success or Failure of a CommandTrivial CalculationsNumerical Calculations using "bc""grep""sed""awk""perl" Principle of Script Defining the Shell Type To make a ksh script (which is a ksh program) crate a new file with a starting line like:#!

KSH script BASICS - Vimperator

/usr/bin/ksh It is important that the path to the ksh is propper and that the line doesn not have more than 32 characters. Four Types of Lines A script has four types of lines: The shell defining line at the top, empty lines, commentary lines starting with a # and command lines. . #! Start and End of Script The script starts at the first line and ends either when it encounters an "exit" or the last line. Start and End of Command print -n "Name: "; read name; print "" Name and Permissions of Script File Variables Filling in Using ?

KSH - Korn Shell Tutorial - Vimperator. Undefined Matching Patterns pattern: example: matches: not matched: ------------------------------------------------------------------ * boo* boot,boo,booth ?

KSH - Korn Shell Tutorial - Vimperator

Boo? Boot booth [...] [aeiou]* ark bark [!...] Conditional Statements format "true" if: --------------------------------------------------- (( _num1_ == _num2_ )) numbers equal (( _num1_ ! Test Objects (Files, Directories, etc.) test "true" if: ksh ----------------------------------- object exist -a readable -r writable -w executable -x non-zero length -s zero length directory -d plain file -f symbolic link -h named pipe -p block special file -b character special file -c soft link -L socket -S owned by me -O owned by my group not "sticky" bit set -k set-group-ID bit set -g set-user-id bit set -u opened on a terminal not Format of flow control functions Stylish Modern Furniture | Asian Furniture | Antique Dining Room Furniture | Elite Kitchens | Kitchen and Bath Corner | Homemaker Herald | Home Tips.

Awk/Nawk/Gawk Intro - Vimperator. Explained by examples rather than by definitons Syntax for one line awk commands Konzept Awk scannes ascii files or standard input.

Awk/Nawk/Gawk Intro - Vimperator

It can search strings easily and then has a lot of possibilities to process the found lines and output them in the new format. It does not change the input file but sends it's results onto standard output. awk/nawk/gawk Awk is the orignal awk. Search and Action Variables Awk does not distinguish between strings and numbers. Multiline awk in a shell script All between '' is in awk. Awk ' BEGIN { print a > "testfile" } ' a=$var BEGIN { }, { } and end { } An awk script can have three types of blocks. Awk ' BEGIN { myvalue = 1700 } /debt/ { myvalue -= $4 } /want/ { myvalue += $4 } END { print myvalue } ' infile Match in a particular field Awk autosplits a line on whitespace as default. Learning the Korn Shell - Vimperator.

Bash