Shell Programming have objectives: What is a Shell Program, common Shells, concepts of shell programming, how shell programs are executed, concepts and use of shell variables, how command line arguments are passed shell programs, concepts of command substitution, basic coding principles, write and discuss shell scripts. | Shell Programming Objectives • • • • • • • • • What is a Shell Program Common Shells Concepts of shell programming How shell programs are executed Concepts and use of shell variables How command line arguments are passed to shell programs Concepts of command substitution Basic coding principles Write and discuss shell scripts What is a Shell Program? • After logging onto the system a prompt for input appears which is generated by a Command String Interpreter program called the shell. The shell – interprets the input, – takes appropriate action, and – finally prompts for more input. • The shell can be used either – interactively ‐ enter commands at the command prompt, or – as an interpreter to execute a shell script • Note: Shell scripts are dynamically interpreted, NOT compiled. What is a Shell Script? • A Text File • With Instructions • Executable Common Shells • • • C‐Shell ‐ csh – Good for interactive systems – Inferior programmable features Bourne Shell ‐ bsh or sh ‐ also restricted shell ‐ bsh – Sophisticated pattern matching and file name substitution Korn Shell – Backwards compatible with Bourne Shell – Regular expression substitution – emacs editing mode • Born Again Shell (BASH) – default shell on most Linux system • TENEX C‐Shell ‐ tcsh – Based on C‐Shell – Additional ability to use emacs to edit the command line – Word completion & spelling correction