Home > Programming > Shell Programming



Shell Scripting

Sort 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 ...

Source: www.astro.virginia.edu


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
Search Terms:

 

Related Files

basic shell programming

Filed under: Programming and Shell Programming
bash derives much of its programming functionality from shell variables. Weve ... builtin variables that are vital to shell programming. ...

Unix Shell Scripts

Filed under: Programming and Shell Programming
that file is called shell script language. Like other programming languages it has variables and flow control. statements (e.g. ifthenelse while for ...

UNIX Shell Programming

Filed under: Programming and Shell Programming
Page 1 of 1 ITC_UNIXsp ExecuTrain Course Outline UNIX Shell Programming IT0001 3 Days Description Students learn to read, write, and debug shell scripts, thus increasing ...

Automated testing using Shell Scripting

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

Shell Programming

Filed under: Programming and Shell Programming
This training in Shell Programming is designed for. administrator to create and debug shell scripts so as to. automate routine tasks. ...