shellFun - Dante Cannarozzi Washington University...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Dante Cannarozzi Washington University djc2@cse.wustl.edu www.cse.wustl.edu/~djc2 Fun With Shells (CSE 422S) 2-Dante Cannarozzi, Oct 2009 Common Shells sh (Bourne Shell, Stephen Bourne, 1977) Default shell for Unix Version 7 Always intended to be a scripting language scripts can be invoked as commands by using their filename may be used interactively or non-interactively allow both synchronous and asynchronous execution of commands supports input and output redirection and pipelines provides a set of builtin commands provides flow control constructs, quotation facilities, and functions. typeless variables 3-Dante Cannarozzi, Oct 2009 Common Shells (2) provides local and global variable scope scripts do not require compilation before execution does not have a goto facility, so code restructuring may be necessary Command substitution using back quotes: `command`. Here documents using << to embed a block of input text within a script. " for ~ do ~ done " loops, in particular the use of $* to loop over arguments. " case ~ in ~ esac " selection mechanism, primarily intended to assist argument parsing. sh provided support for environment variables using keyword parameters and exportable variables. 4-Dante Cannarozzi, Oct 2009 Common Shells (3) csh (C Shell, Bill Joy, 1978) developed on BSD Job control History substitution Array ~ expansion Aliases Math operations tcsh (TENEX C Shell, Ken Greer, 1979) developed on TENEX C Shell + programmable command line complete and command line editing 5-Dante Cannarozzi, Oct 2009 Common Shells (4) Ksh (Korn Shell, David Korn, early 1980s) AT&T Bell Laboratories Main advantage was its uses as a programming language bash (Bourne Again Shell, Brian Fox, 1987) Shell for the GNU operation systems Superset of Bourne 6-Dante Cannarozzi, Oct 2009 Bash Shell Prompt todays date and time export PS1="\d \h $ => Sat Jun 02 server $ todays date/time, hostname, current dir export PS1="[\d \t \u@\h:\w ] $ => [Sat Jun 02 14:24:12 vivek@server:~ ] $ set a red color prompt export PS1="\e[0;31m[\u@\h \W]\$ \ e[m 7-Dante Cannarozzi, Oct 2009 Bash Builtin Commands...
View Full Document

Page1 / 32

shellFun - Dante Cannarozzi Washington University...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online