Shells - National Chiao Tung University
[Pages:31]Shells
lctseng
Computer Center, CS, NCTU
Introduction ? UNIX Kernel and Shell
q Interface to communicate with kernel q Where you type commands
Commands...
2
Picture from
Computer Center, CS, NCTU
Introduction ? UNIX Kernel and Shell
interpret
3
Computer Center, CS, NCTU
The UNIX Shells
q How shell works
? Fetch command ? Analyze ? Execute
q Unix shells
Shell
Originator
Bourne Shell S. R. Bourne
Csh
Bill Joy
Tcsh
Ken Greer
Korn Shell David Korn
Z Shell
Paul Falstad
System Name /bin/sh /bin/csh /bin/tcsh (shells/ksh93) (shells/zsh)
4
Prompt $ % > $ %
Computer Center, CS, NCTU
Shell Startup Files
q sh
? /etc/profile
login shell, system wide
? ~/.profile
login shell
? ENV
q csh
? /etc/csh.cshrc
always, system wide
? /etc/csh.login
login shell, system wide
? ~/.cshrc
always
? ~/.login
login shell
? ~/.logout
logout shell
? /etc/csh.logout
logout shell, system wide
q tcsh
? ~/.tcshrc
login shell
q bash
? /etc/profile ? ~/.bash_profile or ~/.bash_login or ~/.profile
? ~/.bashrc
? BASH_ENV
5
Computer Center, CS, NCTU
Shell Startup Files - tcsh
q .tcshrc
6
Computer Center, CS, NCTU
Shell Startup Files - tcsh
q A sample tcshrc for you to change your prompt q q How to use
? Copy the content as your .tcshrc q Simplest install steps
? $ cd ~ ? $ fetch -o .tcshrc
7
Computer Center, CS, NCTU
Shell Environment Variables
q Controlling shell behaviors
? There are many environment variables that control the shell behavior
q To dump them: env command
q To get value: $variable_name or ${variable_name}
? echo "$PATH"
q Useful Environment Variables
sh
csh
HOME
MAIL
description User's home directory User's mailbox
PATH
Search path
PS1
prompt Primary prompt string (waiting for input commands)
PS2
prompt2 Secondary prompt string (after lines end with \)
prompt3 Third prompt string (automatic spelling correction)
history Number of history commands
8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- sun glassfish enterprise server v211 reference manual
- difference between export and declare bash
- bash script print result of last statement
- document unix 18 advanced unix scripts
- bash execute for loop variable declaration
- shells national chiao tung university
- biogeography of deep and open ocean areas
- draft of first half of report
- agriculture
- biodiversity management plan for the leopard toad
Related searches
- national university bachelor degree progr
- national university online degree programs
- national university masters degree programs
- national university degree programs
- national university bachelor degree programs
- national university online courses
- national university certificate programs
- national university online programs
- national university phd programs
- tung oil gun stock finish
- national university online masters programs
- national university rankings 2019 list