unix shell-scripting basics.ppt

Download UNIX Shell-Scripting Basics.ppt

Post on 14-Apr-2015

26 views

Category:

Documents

3 download

Embed Size (px)

TRANSCRIPT

UNIX Shell-Scripting Basics

AgendaWhat is a shell? A shell script? Introduction to bash Running Commands Applied Shell Programming

What is a shell?

What is a shell?

/bin/bash

What is a shell?

#!/bin/bash

What is a shell?INPUT

shell

OUTPUT

ERROR

What is a shell?Any Program But there are a few popular shells

Bourne Shells

/bin/sh /bin/bash Bourne-Again Shell

Steve Bourne

Other Common ShellsC Shell (/bin/csh) Turbo C Shell (/bin/tcsh) Korn Shell (/bin/ksh)

An aside: What do I mean by /bin ?C Shell (/bin/csh) Turbo C Shell (/bin/tcsh) Korn Shell (/bin/ksh)

An aside: What do I mean by /bin ? /bin, /usr/bin, /usr/local/bin /sbin, /usr/sbin, /usr/local/sbin /tmp /dev /home/borwicjh

What is a Shell Script?A Text File With Instructions Executable

What is a Shell Script?% cat > hello.sh /tmp/myfile cat 2> /tmp/myerr cat < /tmp/myinput cat &1

INPUT 0 env OUTPUT 1 ERROR 2

What is a Shell Script? How To Run% cat > hello.sh