Presentation is loading. Please wait.

Presentation is loading. Please wait.

MaSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic.

Similar presentations


Presentation on theme: "MaSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic."— Presentation transcript:

1 maSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic way for the user to interact with the OS. – Main shell types. ● Command line shell (example, bash). ● Graphical shell (GNOME, KDE).

2 maSH – Miniature Shell ● History of Unix shells. – sh (Thomson, 1974) – Bourne shell (1977) – also sh. – csh (1978) – ksh, tcsh (1980s) – bash (FSF GNU/Linux – POSIX standards) ● Developed as an alternative to the commercial ksh. – zsh and many more like ash, dash, sash etc. ● Languages like Perl, Python, Ruby evolved out of shell languages.

3 maSH – Miniature Shell ● Shell script – Sequence of commands stored in a text file and executed by the shell program.

4 maSH – Miniature Shell ● How the shell gets invoked? – init – getty – login ● You are in a “shell” the moment you are logged in.

5 maSH – Miniature Shell ● Shell – basic process flow

6 maSH – Miniature Shell ● Startup files used by bash. – Login shell ● /etc/profile ●.bash_profile ●.bash_login – Interactive non-login shell ●.bashrc

7 maSH – Miniature Shell ● Features of maSH – A very minimal shell. – Does not implement shell grammar – only a simple command executer. – Cannot execute maSH scripts. – No filename completion, alias, command history etc. – Does not implement job control. – Implements only a few builtin commands. – Does not have man page.

8 maSH – Miniature Shell ● Builtin commands – echo – help – showenv – version – pwd – cd – kill [-sig] – exit

9 maSH – Miniature Shell ● Source code analysis. – Header files – maash.h, getline.h, config.h – Source files – maash.c cmds.c, utils.c – getline.c [Cross-platform] ● Line editing, command history. – config.h – Usage. – Static library for getline.

10 maSH – Miniature Shell ● GNU toolchain – GNU make – gcc – binutils – linker, assembler etc. – GNU debugger – GNU autotools ● GNU autotools – autoheader – autoconfig – automake – libtool

11 maSH – Miniature Shell ● Using GNU autotools – Developer requires ● aclocal ● autoconf ● autoheader ● automake – Installer requires ● gcc ● Make utility ● Perl

12 maSH – Miniature Shell ● Using GNU autotools ● configure.ac ● Makefile.am ● Minimal files: – README, AUTHORS, NEWS, ChangeLog ● Sub-directories – src, include, lib, bin, doc

13 maSH – Miniature Shell ● Demonstration – Downloading – Building ●./configure –prefix= ● make ● make install – Using ● As a user program. ● As a user's default shell.

14 maSH – Miniature Shell ● Modifying source code – generating patch – – diff X.c X.c > “diff file”. ● Submitting patches: – e-mail to mash@space-kerala.orgmash@space-kerala.org – Website: http://space-kerala.orghttp://space-kerala.org


Download ppt "MaSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic."

Similar presentations


Ads by Google