Professional Documents
Culture Documents
1. Visual:- The Korn shell checks to see if this variable ends with vi or macs.
VISUAL=$(whence emacs)
or
VISUAL=$(whence vi)
2. Set : -The second way of selecting an editing mode is to set the option explicitly with
the set -o command:
$ set -o emacs
or
$ set -o vi
o Filename expansion
If you want a command to work with a group of files. Wildcards are used to create
a filename expansion pattern: a series of characters and wildcards that expands to a
list of filenames.
Eg:- / etc/*
[...] - If you enclose some characters in brackets, the result is a wildcard that matches those
characters. For example,[abc] matches either a, or b, or c. If you add a ^ after the first
bracket, the sense is reversed; so [^abc] matches any character that is not a, b, or c. You can
include a range, such as [a-j], which matches anything between a and j. The match is case
sensitive, so to allow any letter, you must use [a-zA-Z].
Examples:
*.txt - This will give you a list of all filenames that end in .txt, since the * matches anything at all.
Page 1 of 6
[^a] - This gives you all a -letter filenames that do not begin with a.
a* - This gives you every filename that starts with a, regardless of how many letters it has.
The above three numbers are standard POSIX numbers and also known as file
descriptors (FD). Every Linux command at least open the above streams to talk with users
or other system programs.
Integer value
Standard File Descriptor
Meaning
File Number
Page 2 of 6
Read input from a file (the
stdin 0
default is keyboard)
You can manipulate the final result by redirecting input and output.
Standard Input: -
Standard input is the default input method, which is used by all commands to read its
input.
It is denoted by zero number (0).
Standard Output:-
Standard Error:-
Standard error is the default error output device, which is used to write all system
error messages.
It is denoted by two number (2).
Quoting mechanisms
Page 3 of 6
There are three types of quotes:
Quote
Name Meaning Example (type at shell prompt)
type
The Backslash
The backslash ( \ ) alters the special meaning of the ' and " i.e. it will escape or cancel the
special meaning of the next character.
Example:-
leo@leo-desktop:~$ echo "Todays Date is $(date)"
Todays Date is Thu Dec 2 14:20:11 EAT 2010
Page 4 of 6
leo@leo-desktop:~$ echo Todays Date is $(date)
Todays Date is Thu Dec 2 14:20:21 EAT 2010
Student$student-desktop:$
Example :-
$ date – used for displaying the date.
$ cal – used for the purpose of displaying the calendar
The terminal in which you will type the programs for the purpose of displaying the
commands and the output of the commands.
Enter into the terminal mode and then go for entering the command as
1. $ vi aaa.sh
Page 5 of 6
.sh – goes for the extension of shell.
After execution of this the program is been saved in the program name
with the extension of sh
1. $ sh aaa.sh
As you execute this you will get the program been implemented.
Page 6 of 6