Quantcast
Channel: SoftSupplier » Pascal
Viewing all articles
Browse latest Browse all 10

User Interface

$
0
0

After the login process has been verified correct username and password, it changes the current catalog with directory to this user (specified in / etc / passwd) and launches the execution of the program whose name appears on the last field of the same entries in / etc / passwd. This program is usually a shell. Launch execution process takes place without creating a new login process is virtually replaced with the new program.
Command interpreter command interpreters working like operating systems already known: displays a prompt, take command and arguments and, if that command is an internal command executes, otherwise the command name used to identify an executable file is loaded and executed. After the execution command prompt reappears to ask user to enter a new order. In terms of process, orders execution mechanism was presented in the previous chapter.
Note: Unlike other operating systems, which command interpreter is a privileged program (see command.com), Unix shell is considered as a normal program, not having higher priority than other processes.
The shell is not part of core operating system. There are many parsers available, the user can load cell you want to ask him. It can even launch a user’s interpreter, if he is capable of something … The most common shell is: sh (shell), csh (C-shell), ksh (KornShell), bash (Born Again Shell).
All commands have the following syntax:
$ (Command) (argument2 }…{ argument1 argumentn)
Command is an internal command (executed directly by the shell) or an executable program name, searched the following sequence:
• current directory;
• directory / bin;
• / usr / bin;
• If no error is found in places specified above
Other defining parameters  command and control are called arguments. They are separated by blank sites. You can enter multiple commands on same line if you digging through “;”
Many of the arguments of a command are file names, so they were introduced some wildcards (jocker characters) so we can cover a lot of files. Wildcards are:
• *, any character string (including the empty string);
•? -Any character;
• [...]- a lot of characters;
• –lexicographic sequence of characters;
Examples of using wildcards:
All source files *. step-Pascal;
ex?. txt-all text files have the prefix “ex”
eg [1-9], indicate files ex1, ex2, … ex8;
prob [37], indicating files and prob7 prob3;

pro [*?], show all files beginning with “pro” and continue with a certain string, and files with names consisting of four characters, the first three being “pro”
File Redirection
After initializing the working session, Shell opens three files standard (0,1,2) for input, output and display the default keyboard and assigned errors on the screen. When you launch the program associated with a command interpreter, and it inherits the open files, and so the standard. Such programs are independent of physical devices associated with shell file redirection file standard.Interpretorul allows standard input / output to other files or periferice. For example, if a program is the standard output screen, we can send data (through redirection surgery) to a text file specified.
• With the sign “<” is redirected in  standard input file.
This means that the program launched by the shell will not get data from the keyboard, but from a file specified by the operator “<”. For example:
prog
determine the “prog” to read data from file “file”
• Using the operator “>” to redirect output standard. Command
ls-l> file
will list the contents of current directory in the file “file”. If the file already exists, using the operator “>>” instead of “>” will add information to the end of the file “file”
• A program can be launched with simultaneous entry and exit redirect standard
crypt ‘<’ fis1> fis2,
fis1 totals command file and submit the result to fis2.
Pipe communication between processes
Communication between processes can be achieved by redirection (first process submitting data to a file, where it is read from the second process) or by engineering pipe (pipe), using operator “.” Command:
ls-l / bin | wc-l
determine the number of files in the directory / bin (command ls lists directory contents and transmits the result of wc command, which counts how many lines is the resulting text file in the first phase).

11


Viewing all articles
Browse latest Browse all 10

Trending Articles