Chapter 9 Writing Scripts, Config Email and using Databases Flashcards
Display
This variable identifies the display used by the X windows server. It’s usually set to :0.0, which indicates the first display on the current computer. You ccan run Multiple X Sessions on one computer in which case each one gets a different DISPLAY number- for instance, :0.0 for the first session and :1.0 for the second session.
Editor
Some programs launch the program pointed to by this enviorment variable when they need to call a text editor for you to use. Thus, changing this variable to your favorite editor can help you work in linux. It’s best to set this variable to a text-mode editor because GUI editors may cause problems if theyre called from a program that was launched from a text mode.
This varible determines the number of commands that will be saved in your history file.
HISTSIZE
This variable points to your home directory. Some programs use it to help them look for configuration files or as a default location in which to store files.
HOME
This is the current TCP/IP hostname of the computer.
HOSTNAME
A Few programs use this environment variable to indicate directories in which library files may be found. It works much like PATH
LD_LIBRARY_PATH
The system holds your current language, specified as a locale,using this variable. Locales are describes further in Ch 6 “config the X Windows Systems, Localization and Printing”
LANG
This variable holds your username when you are logged into the system.
LOGNAME
This variable holds the location of the user’s mail spool. It usually /var/spool/mail/username
If set, this variable determines the pager to use for output by programs, such as man
PAGER
This is the default prompt in bash. It generally includes. It generally includes variables of its own, such as \u (for the username), \h (for the hostname) and \W for the current working directory) This value is frequently set in /etc/profile, but users often over ride it.
PS1
This is the present working directory. The enviorment variable is maintained by the system. Programs may use it to search for files when you dont provide a complete pathname.
PWD
The variable holds the path to the current command shell.
SHELL
You can set this enviorment variable to your own time zone, which is the most useful if thats different than they computers time zone- for instance, if your using a computer remotely.
TZ
User or Username
This is your current username. Its variable thats maintained by the system.
is parameter is what you want to type at the command prompt, and the shell substitues command for whatever you type.
alias_name
Vocab
is a variable defined by a user for various pruposes, such as temporarily storing data.
user defined variable
Explain the function of enviorment variables
Enviorment variables are used to store information on the systems for the benefitws of running programs. Examples include the pathenviorment variable, which holds the locations of executable programs and HOSTNAME which holds the systems hostname.
Describe various shell script components?
A shell script combines several commands, possibly including conditional expressions, variables, and other programming features. A shell script must start with a shebang line to let the kernel know its a script and indicate the shell interperter to use. Each script component has a specific syntax needed for proper shell execution and logic flow. A shell script is run using vatious methods. Each method may or may not create a subshell and may or maynot require the execution bit to be set.
Describe the prupose of shell aliases?
aliases enable you to create a command “shortcut” a simple command that can stand in for different or longer command. Aliases are typically defined in a shell startup scripts as a way to create a shortened version of a command. aliases also allow useful command options to be used as the new default or they create an easier to remeber verstion of a command.
Summarize the major SMTP servers for linux
Sendmail was the most common SMTP server a decade ago, and it is still very popular today. Postfix and Exim are often supplied as the default mail servers on modern distributors, whereas administrators soetimes install qmail. Postfix and qmail use modular designs,whereas sendmail and Exim do not.
Summerize the structure of a SQL Database?
Each SQL instllation consists of a numver of naed databases, each of which in turn may contain miltiple tables. Each table can be thought of as two dinensional array of data. Each row in a table describes some object or concept(inventory,employees,movies in a personal DVD collection and so on and each column in a table holds data about these objects or conceptys(model number,salary or director for example.
Describe the commands used to enter in a SQL Database?
The INSERT command inserts a single entry into a database. It requires a table name and set values, as in INSERT ITO Moves VALUES(‘Brazil’, “terry Gilliam’, 1985); The update command can be used in a similar way to update an existing entry, but you must use SET to specify the column to set and WHERE to identify the row or rows to be modified.