SOS!!!shell-pgming Basics 4EPOKA
SOS!!!shell-pgming Basics 4EPOKA
3
SHELL PROGRAM STRUCTURE
A shell program contains high-level programming
language features:
4
YOUR SHELL PROGRAMMING
LIBRARY
Naming of shell programs and their output
⚫ Give a meaningful name
5
STEPS TO CREATE SHELL PROGRAMS
Specify shell to execute program
⚫ Script must begin with #! (pronounced
“shebang”) to identify shell to be executed
⚫ use comments
lines start with #
⚫ use indentation
to reflect logic
and nesting
8
EXAMPLE: “HELLO” SCRIPT
#! /bin/csh
echo "Hello $USER"
9
EXAMPLE SCRIPT OUTPUT
% chmod u+x hello
% ./hello
Hello ege!