Unix Unit II
Unix Unit II
Dr.T.Logeswari
fdformat[-n]device
$fdformat/dev/fd0
o/p: it will perform low level format on floppy disk press enter
$df/dev/hda3
• Syntax
$unmount[option]file system
• The second hard disk will have the name /dev/hdb with simillar
extension
Dr.T.Logeswari
• The input and output files are stream of character which are
given as input or sent as output
Keyboard
stdin
Program
stdout
Terminal
screen
stderr
stdin Program 1
Keyboard ls command
Stdin / stdout
Program 2
Terminal screen More command
stdout
Program
statement
END{…..}
Begin
•Statement starting with BEGIN are executed before reading the input line
•It is used for variable initialization
$awk END
Built-in Variable
Unix Shell Programming - Forouzan 56
User defined Variables
• Variable names can use any of the character[A-Z, a-z,0-9]
• You cant place two variable adjacent to each other without
having space in between
• String constant are delimited by double quotes
• Statement need not end with semicolon
• Comment can added to program by using #
• When variable are defined in awk they get initialized to zero
or null string automatically
While (expression)
{
statement
}