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

Shell Programming for System Administrators


Topic: Shell Programming

Course Description. The Shell Programming for System Administrators course. provides students with the skills to read write and debug. UNIX shell scripts. ...

Korn Shell Script Writing


Topic: Shell Programming

A shell script is an executable file which is executed by the. shell linebyline. It can contain the following:. UNIX commands. shell programming ...

Windshield Windows Shell Script


Topic: Shell Programming

Windshield Windows Shell Script Columbia University COMS W4115 Programming Languages and Translators Spring 2007 Prof. Stephen A.

UNIX Shell Programming


Topic: Shell Programming

... Options to the ps Utility Background Commands (&) Killing Background Processes Redirecting the Standard Error Shell Programming Concepts What is a Shell? What is a Shell Script? Why Use ...

Win32 Shell Scripting Tutorial


Topic: Shell Programming

Batch files are used to automate repetitive command sequences in the command shell environment. In the context of batch programming the environment is ...

 

Sponsored Links