Sponsored Links

 

 

 

Shell Scripting

Source: www.astro.virginia.edu
Topic: Shell Programming


Short Desciption:
Why Shell Script? Its the simplest form of programming. Shell scripting is exactly the same as. you use with an interactive shell session. ...

 

Content Inside:
Shell ScriptingPage 1Shell ScriptingSeptember 6 2005Page 2Whats a Shell?The most basic user interface.Command Line WindowsDOS Window WindowsTerminal UnixSometimes Console UnixPage 3Common Unix Shells sh the bourne shell Stephen Bourne AT&T Bell Laboratories csh the C programmers shell Bill Joy University of California bash Bourne Again Shell Richard Stallman Free Software Foundation tcsh an updated csh t is for TENEX a old system eventually boughtby DEC in the late 70s. ksh the korn shell David Korn AT&T Bell LaboratoriesPage 4Why Your Default Shell is tcshtcsh has very flexible completion andvariable substitution routines builtin. Examples: tab completion spellingcorrection variablesThe Sun Solaris operating systemdefaults to it.Page 5.cshrc And .bashrc Files Modify your shell by editing your .cshrc (tcsh)or .bashrc (bash) Both are shell scripts! $PATH $LD_LIBRARY_PATH aliasesPage 6Why Shell Script?Its the simplest form of programming.Shell scripting is exactly the same asyou use with an interactive shell session.Greatly reduces time spent doingrepetitive commands.EASY!Page 7Why tcsh is Bad for ScriptingSince most of the Unix system is builtupon the sh shell bash is a moresensible choice.csh Programming Considered Harmfulhttp://www.tac.nyc.ny.us/mirrors/tc shbook/cshwhynotPage 8Getting Started with bash At any Unix prompttype bash. To start programs do itlike you would in tcsh. Differences betweentcsh and bash aremainly in variabledeclaration I/Obash2.95b $$ lsbincodeDocumentstmp$ emacsPage 9Variables Any word can beused but typicallyvariables are writtenin UPPER CASE. After declaring thevariable you referto it by using adollar sign ($).$ TEST=1$ echo $TEST1$ echo $SHELL/bin/bash$ printenvTEST=1SHELL=/bin/bashPage 10Flow Control if; then; else; fi while; do; done for; do; doneif TEST = 1 ]; then<do this>else<do this instead>fifor i in 123; do<do this to $i>donePage 11Putting This into a Script Begin with shabangThis identifie ...

 

add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related PDF Files

UNIX System Programming


Topic: Shell Programming

UNIX System Programming Lecture 4 BASH Shell Programming BLP: Chapter 2 BABS Outline: Redirection ... zsh, ksh Change your default shell to bash $ chsh -s /bin/bash 2 Our First Shell Script A ...

Advanced UNIX Shell Scripting Workshop


Topic: Shell Programming

... want to increase their productivity by taking advantage of Korn shell features in business applications. Prerequisites: Introduction to UNIX for Applications Developers or UNIX Shell Programming or ...

GUIfying and Documenting your Shell Script


Topic: Shell Programming

plications and are meant to achieve a higher level of programming. ... shell script itself (or any application of choice with a specified CLI) can be ...

Shell Scripting with Scheme


Topic: Shell Programming

possible with Scheme. The focus of. this article is therefore on shell. programming as well as. programming for the Internet. Shell Scripting with Scheme ...

Automated testing using Shell Scripting


Topic: Shell Programming

Advanced Bash scripting guide from The Linux Documentation Project (TLDP). Unix Shell Programming by Yashavant Kanetkar BPB Publication. ...

 

Sponsored Links