SlideShare a Scribd company logo
1 of 80
Download to read offline
Chapter 14Chapter 14
Shell ScriptShell Script
Ref. Pge. 425
Shell TypeShell Type
●
Login ShellLogin Shell
– Local login via consoleLocal login via console
– Terminal programTerminal program
– Remote loginRemote login
●
Interactive ShellInteractive Shell
– With shell promptWith shell prompt
– Typing commands manuallyTyping commands manually
Shell InvocationShell Invocation
●
Login ShellLogin Shell
– /etc/profile/etc/profile
– then one of following in order:then one of following in order:
●
~/.bash_profile~/.bash_profile
●
~/.bash_login~/.bash_login
●
~/.profile~/.profile
●
Interactive ShellInteractive Shell
– /etc/bash.bashrc/etc/bash.bashrc
– ~/.bashrc~/.bashrc
Ref. Pge. 432
Variable SettingVariable Setting
●
Setting a variable:Setting a variable:
name=valuename=value
●
Setting rules:Setting rules:
●
No spaceNo space
●
No number beginningNo number beginning
●
NoNo $$ in namein name
●
Case sensitiveCase sensitive
Variable SettingVariable Setting
●
Common errors:Common errors:
  A= BA= B
  1A=B1A=B
  $A=B$A=B
  a=Ba=B
Variable SubstitutionVariable Substitution
●
Substitute then re-construct:Substitute then re-construct:
$ A=ls $ A=ls 
$ B=la $ B=la 
$ C=/tmp $ C=/tmp 
$ $A ­$B $C$ $A ­$B $C
●
Result:Result:
$ ls ­la /tmp $ ls ­la /tmp 
Viewing a Variable ValueViewing a Variable Value
●
Using theUsing the echoecho command:command:
$ echo $A ­$B $C$ echo $A ­$B $C
ls ­la /tmpls ­la /tmp  
Ref. Pge. 430
Value ExpansionValue Expansion
●
Using separator:Using separator:
$ A=B:C:D$ A=B:C:D
$ A=$A:E$ A=$A:E
●
UsingUsing {}{}::
$ A=BCD$ A=BCD
$ A=${A}E$ A=${A}E
Ref. Pge. 427
TheThe exportexport commandcommand
●
Purpose:Purpose:
To set Environment Variable, inheritable in subTo set Environment Variable, inheritable in sub
shells.shells.
Setting Environment VariableSetting Environment Variable
●
UsingUsing exportexport command:command:
$ A=B$ A=B
$ export A$ export A
OrOr
$ export A=B$ export A=B
●
UsingUsing declaredeclare command:command:
$ declare ­x A$ declare ­x A
$ A=B$ A=B
Variable Exportation EffectVariable Exportation Effect
A=B export A
Before exporting
After exporting
Viewing Environment VariableViewing Environment Variable
●
UsingUsing envenv command:command:
$ env$ env
●
UsingUsing exportexport command:command:
$ export$ export
Variable RevocationVariable Revocation
●
UsingUsing unsetunset command:command:
$ A=B$ A=B
$ B=C$ B=C
$ unset $A$ unset $A
●
Different to null value:Different to null value:
$ A=$ A=
$ unset A$ unset A
Using readUsing read
●
Geting variable values from STDIN:Geting variable values from STDIN:
$ read var1 var2 var3$ read var1 var2 var3
●
Terminating input by pressingTerminating input by pressing EnterEnter
●
Positional assignmentPositional assignment
●
Extras are assigned to the last variableExtras are assigned to the last variable
●
Common options:Common options:
­p 'prompt' ­p 'prompt' : gives prompts: gives prompts
­n ­n nn  : gets: gets nn of characters enoughof characters enough
­s ­s : silent mode: silent mode
Ref. Pge. 440
Command AliasCommand Alias
●
Setting an alias:Setting an alias:
$ alias alias_name='commands line'$ alias alias_name='commands line'
●
Run defined commands by eRun defined commands by enteringntering
alias name.alias name.
●
User aliases are defined inUser aliases are defined in ~/~/.bashrc.bashrc
●
Listing aliases:Listing aliases:
$ alias$ alias
●
Removing an alias:Removing an alias:
$ unalias alias_name$ unalias alias_name
Ref. Pge. 431
Process HierarchyProcess Hierarchy
●
Every command generates a processEvery command generates a process
when running.when running.
●
A command process is a child whileA command process is a child while
the shell is the parent.the shell is the parent.
●
A child process returns a value(A child process returns a value($?$?) to) to
parent when exists.parent when exists.
shell
command
Return
Value
Process EnvironmentProcess Environment
●
Children processes inheritChildren processes inherit
environment from parentenvironment from parent
●
However, any changing ofHowever, any changing of
environment in a child will NEVERenvironment in a child will NEVER
effect the parent!effect the parent!
Shell ScriptShell Script
●
Definition:Definition:
A series of command lines are predefined in aA series of command lines are predefined in a
text file for running.text file for running.
Ref. Pge. 433
Script RunningScript Running
●
Using a sub shell to run commands:Using a sub shell to run commands:
Environment changing only effects the subEnvironment changing only effects the sub
shell.shell.
●
Interpreter is defined at the first line:Interpreter is defined at the first line:
#!/path/to/shell#!/path/to/shell
shell
sub shell
commands
Ref. Pge. 434
Source RunningSource Running
●
UsingUsing sourcesource command to run script:command to run script:
●
There is no sub shell, interpreter is ignored.There is no sub shell, interpreter is ignored.
●
Environment changing effects the currentEnvironment changing effects the current
shell.shell.
shell
commands
Ref. Pge. 434
Exec RunningExec Running
●
UsingUsing execexec command to run script:command to run script:
●
The current shell is terminated at scriptThe current shell is terminated at script
starting.starting.
●
The process is hanged over to interpreter.The process is hanged over to interpreter.
shell
commands
interpreter
PracticePractice
●
Write a simple shell script (Write a simple shell script (my.shmy.sh):):
pwdpwd
cd /tmpcd /tmp
pwdpwd
sleep 3sleep 3
●
Make it executable:Make it executable:
$ chmod +x my.sh$ chmod +x my.sh
PracticePractice
●
Run the script in different ways:Run the script in different ways:
$ ./my.sh$ ./my.sh
$ pwd$ pwd
$ . ./my.sh$ . ./my.sh
$ pwd$ pwd
$ cd ­$ cd ­
$ exec ./my.sh$ exec ./my.sh
Identical to:
source ./my.sh
Sequence RunningSequence Running
●
Using theUsing the ;; symbol:symbol:
$ cmd1 ; cmd2; cmd3$ cmd1 ; cmd2; cmd3
●
Equivalent to:Equivalent to:
$ cmd1$ cmd1
$ cmd2$ cmd2
$ cmd3$ cmd3
Command GroupingCommand Grouping
●
UsingUsing {}{} to run command group into run command group in
current shell:current shell:
$ { cmd1 ; cmd2; cmd3; }$ { cmd1 ; cmd2; cmd3; }
●
UsingUsing ()() to run command group in ato run command group in a
nested sub shell:nested sub shell:
$ ( cmd1 ; cmd2; cmd3 )$ ( cmd1 ; cmd2; cmd3 )
Command Grouping BehaviorCommand Grouping Behavior
●
UsingUsing {}{} ::
Environment changing effects theEnvironment changing effects the
current shell.current shell.
●
UsingUsing ()()::
Environment changing does NOTEnvironment changing does NOT
effects the current shell.effects the current shell.
Named Command GroupNamed Command Group
●
Also known as functionAlso known as function
A command group is run when calling theA command group is run when calling the
function name.function name.
$ my_function () {$ my_function () {
cmd1cmd1
cmd2cmd2
cmd3cmd3
}}
$ my_function$ my_function
Ref. Pge. 443
Command SubstitutionCommand Substitution
●
UsingUsing $()$() ::
$ cmd1 … $(cmd2 …) … $ cmd1 … $(cmd2 …) … 
●
UsingUsing ```` (don't be confused with(don't be confused with ''''):):
$ cmd1 … `cmd2 …` … $ cmd1 … `cmd2 …` … 
Ref. Pge. 438
Multiple SubstitutionMultiple Substitution
●
UsingUsing $()$() ::
$ cmd1 … $(cmd2 … $(cmd3 … ) … ) … $ cmd1 … $(cmd2 … $(cmd3 … ) … ) … 
●
UsingUsing ```` ::
$ cmd1 … `cmd2 … `cmd3 … ` … ` … $ cmd1 … `cmd2 … `cmd3 … ` … ` … 
Advanced Variable SubstitutionAdvanced Variable Substitution
●
${#var}${#var} ::
the length of valuethe length of value
Advanced Variable SubstitutionAdvanced Variable Substitution
●
${var#pattern}${var#pattern} ::
removes shortestremoves shortest patternpattern at beginningat beginning
●
${var##pattern}${var##pattern} ::
removes longestremoves longest patternpattern at beginningat beginning
●
${var%pattern}${var%pattern} ::
removes shortestremoves shortest patternpattern at endat end
●
${var%%pattern}${var%%pattern} ::
removes longestremoves longest patternpattern at endat end
Advanced Variable SubstitutionAdvanced Variable Substitution
●
${var:n:m}${var:n:m} ::
To haveTo have mm characters from positioncharacters from position nn ,,
(position starting from 0)(position starting from 0)
Advanced Variable SubstitutionAdvanced Variable Substitution
●
${var/pattern/str}${var/pattern/str} ::
substitutes the firstsubstitutes the first patternpattern toto strstr
●
  ${var//pattern/str}${var//pattern/str} ::
substitutes allsubstitutes all patternpattern toto strstr
Array SettingArray Setting
●
UsingUsing ()()::
array=(value1 value2 value3)array=(value1 value2 value3)
●
Position assignment:Position assignment:
array[0]=value1array[0]=value1
array[1]=value2array[1]=value2
array[2]=value3array[2]=value3
Array SubstitutionArray Substitution
●
All values:All values:
${array[@]}${array[@]}
${array[*]}${array[*]}
●
Position values:Position values:
${array[0]}${array[0]}
${array[1]}${array[1]}
${array[2]}${array[2]}
Array SubstitutionArray Substitution
● Length of value:Length of value:
${#array[0]}${#array[0]}
●  Number of values:Number of values:
${#array[@]}${#array[@]}
Arithmetic ExpansionArithmetic Expansion
●
32Bit integer:32Bit integer:
-2,147,483,648 to 2,147,483,647-2,147,483,648 to 2,147,483,647
●
No floating pointNo floating point !!
Using external commands instead:Using external commands instead:
●
bcbc
●
awkawk
●
perlperl
Arithmetic OperationArithmetic Operation
●
Operators:Operators:
+ + : add: add
­ ­ : subtract: subtract
* * : multiply: multiply
/ / : divide: divide
& & : AND: AND
| | : OR: OR
^ ^ : XOR: XOR
! ! : NOT: NOT
Arithmetic OperationArithmetic Operation
●
UsingUsing $(())$(()) oror $[]$[]::
$ a=5;b=7;c=2$ a=5;b=7;c=2
$ echo $((a+b*c))$ echo $((a+b*c))
1919
$ echo $[(a+b)/c]$ echo $[(a+b)/c]
66
Arithmetic OperationArithmetic Operation
●
UsingUsing declaredeclare with variable:with variable:
$ declare ­i d$ declare ­i d
$ d=(a+b)/c$ d=(a+b)/c
$ echo $d$ echo $d
66
Arithmetic OperationArithmetic Operation
●
UsingUsing letlet with variable:with variable:
$ let f=(a+b)/c$ let f=(a+b)/c
$ echo $f$ echo $f
66
Arithmetic OperationArithmetic Operation
●
UsingUsing (())(()) with variable:with variable:
$ a=1$ a=1
$ ((a++))$ ((a++))
$ echo $a$ echo $a
22
$((a­=5))$((a­=5))
$ echo $a$ echo $a
­3­3
Script ParameterScript Parameter
●
Assigned in command line:Assigned in command line:
script_name par1 par2 par3 ...script_name par1 par2 par3 ...
●
Reset byReset by setset command:command:
set par1 par2 par3 ...set par1 par2 par3 ...
●
Separated bySeparated by <IFS><IFS> ::
set “par1 par2” par3 ...set “par1 par2” par3 ...
Ref. Pge. 437
Gathering ParametersGathering Parameters
●
Substituted bySubstituted by $$nn  ((nn=position) :=position) :
$0 $1 $2 $3 ...$0 $1 $2 $3 ...
●
Positions:Positions:
$0 $0 : script_name itself: script_name itself
$1 $1 : the: the 1st1st parameterparameter
$2 $2 : the: the 2nd2nd parameterparameter
and so on...and so on...
Parameter SubstitutionParameter Substitution
●
Reserved variables:Reserved variables:
${${nnnn} } : position greater than 9: position greater than 9
$# $# : the: the numbernumber of parametersof parameters
$@ or $* $@ or $* : All parameters individually: All parameters individually
““$*” $*” : All parameters in one: All parameters in one
““$@” $@” : All parameters with position reserved: All parameters with position reserved
Parameter ShiftingParameter Shifting
●
UsingUsing shift [shift [nn]]
to erase the firstto erase the first nn parameters.parameters.
Function ParameterFunction Parameter
●
Functions have own positions exceptFunctions have own positions except $0$0
Return Value (RV)Return Value (RV)
●
Every command has a Return ValueEvery command has a Return Value
when existswhen exists, also called Exist Status., also called Exist Status.
●
Specified bySpecified by exitexit in script:in script:
exit [n]exit [n]
Or, inherited from the last commandOr, inherited from the last command
●
UsingUsing $?$? to have RV of last commandto have RV of last command
Return ValueReturn Value
●
Range:Range:
0-2550-255
●
Type:Type:
TRUE: 0TRUE: 0
FALSE: 1-255FALSE: 1-255
Conditional RunningConditional Running
●
UsingUsing &&&& to run only while TRUE:to run only while TRUE:
cmd1 && cmd2cmd1 && cmd2
●
UsingUsing |||| to run only while FALSE:to run only while FALSE:
cmd1 || cmd2cmd1 || cmd2
Test ConditionTest Condition
●
UsingUsing testtest command to returncommand to return
TRUE or FALSE accordingly:TRUE or FALSE accordingly:
test expressiontest expression
[ expression ][ expression ]
Ref. Pge. 440
Test ExpressionTest Expression
( EXPRESSION )( EXPRESSION )
              EXPRESSION is trueEXPRESSION is true
! EXPRESSION! EXPRESSION
              EXPRESSION is falseEXPRESSION is false
EXPRESSION1 ­a EXPRESSION2EXPRESSION1 ­a EXPRESSION2
              both EXPRESSION1 and EXPRESSION2 are trueboth EXPRESSION1 and EXPRESSION2 are true
EXPRESSION1 ­o EXPRESSION2EXPRESSION1 ­o EXPRESSION2
              either EXPRESSION1 or EXPRESSION2 is trueeither EXPRESSION1 or EXPRESSION2 is true
String ExpressionString Expression
­n STRING­n STRING
              the length of STRING is nonzerothe length of STRING is nonzero
STRING equivalent to ­n STRINGSTRING equivalent to ­n STRING
­z STRING­z STRING
              the length of STRING is zerothe length of STRING is zero
STRING1 = STRING2STRING1 = STRING2
              the strings are equalthe strings are equal
STRING1 != STRING2STRING1 != STRING2
              the strings are not equalthe strings are not equal
Integer ExpressionInteger Expression
INTEGER1 ­eq INTEGER2INTEGER1 ­eq INTEGER2
              INTEGER1 is equal to INTEGER2INTEGER1 is equal to INTEGER2
INTEGER1 ­ge INTEGER2INTEGER1 ­ge INTEGER2
              INTEGER1 is greater than or equal to INTEGER2INTEGER1 is greater than or equal to INTEGER2
INTEGER1 ­gt INTEGER2INTEGER1 ­gt INTEGER2
              INTEGER1 is greater than INTEGER2INTEGER1 is greater than INTEGER2
INTEGER1 ­le INTEGER2INTEGER1 ­le INTEGER2
              INTEGER1 is less than or equal to INTEGER2INTEGER1 is less than or equal to INTEGER2
INTEGER1 ­lt INTEGER2INTEGER1 ­lt INTEGER2
              INTEGER1 is less than INTEGER2INTEGER1 is less than INTEGER2
INTEGER1 ­ne INTEGER2INTEGER1 ­ne INTEGER2
              INTEGER1 is not equal to INTEGER2INTEGER1 is not equal to INTEGER2
File ExpressionFile Expression
FILE1 ­nt FILE2FILE1 ­nt FILE2
              FILE1 is newer (mtime) than FILE2FILE1 is newer (mtime) than FILE2
FILE1 ­ot FILE2FILE1 ­ot FILE2
              FILE1 is older than FILE2FILE1 is older than FILE2
File ExpressionFile Expression
­e FILE­e FILE
              FILE existsFILE exists
­s FILE­s FILE
              FILE exists and has a size greater than FILE exists and has a size greater than 
zerozero
File ExpressionFile Expression
­d FILE­d FILE
              FILE exists and is a directoryFILE exists and is a directory
­f FILE­f FILE
              FILE exists and is a regular fileFILE exists and is a regular file
­L FILE­L FILE
              FILE exists and is a symbolic link (same FILE exists and is a symbolic link (same 
as ­h)as ­h)
File ExpressionFile Expression
­u FILE­u FILE
              FILE exists and its set­user­ID bit is setFILE exists and its set­user­ID bit is set
­g FILE­g FILE
              FILE exists and is set­group­IDFILE exists and is set­group­ID
­k FILE­k FILE
              FILE exists and has its sticky bit setFILE exists and has its sticky bit set
File ExpressionFile Expression
­G FILE­G FILE
              FILE exists and is owned by the effective FILE exists and is owned by the effective 
group IDgroup ID
­O FILE­O FILE
              FILE exists and is owned by the effective FILE exists and is owned by the effective 
user IDuser ID
File ExpressionFile Expression
­r FILE­r FILE
              FILE exists and read permission is grantedFILE exists and read permission is granted
­w FILE­w FILE
              FILE exists and write permission is grantedFILE exists and write permission is granted
­x FILE­x FILE
              FILE exists and execute (or search) FILE exists and execute (or search) 
permission is grantedpermission is granted
Test ExampleTest Example
●
Think about:Think about:
$ unset A$ unset A
$ test ­n $A$ test ­n $A
$ echo $?$ echo $?
00
$ test ­n “$A”$ test ­n “$A”
$ echo $?$ echo $?
11
Test ExampleTest Example
●
Tips:Tips:
test strtest str
test test ­n­n str str
test ­ntest ­n
test test ­n­n ­n ­n
test ­n $Atest ­n $A
test ­ntest ­n
test test ­n­n ­n ­n
Test ExampleTest Example
●
Tips:Tips:
test ­n “$A“test ­n “$A“
test ­n <NULL>test ­n <NULL>
TheThe if­thenif­then StatementStatement
●
Syntax:Syntax:
if cmd1 if cmd1 
thenthen
cmd2...cmd2...
fifi
Ref. Pge. 440
TheThe if­then­elseif­then­else StatementStatement
●
Syntax:Syntax:
if cmd1 if cmd1 
thenthen
cmd2 ...cmd2 ...
elseelse
cmd3 ...cmd3 ...
fifi
Ref. Pge. 441
Using Command GroupUsing Command Group
●
Syntax:Syntax:
cmd1 && {cmd1 && {
cmd2 ...cmd2 ...
::
} || {} || {
cmd3 ...cmd3 ...
}}
Multiple Conditions (Multiple Conditions (elifelif))
●
Syntax:Syntax:
if cmd1 if cmd1 
thenthen
cmd2 ...cmd2 ...
elif cmd3elif cmd3
thenthen
cmd4 ...cmd4 ...
fifi
repeatable
Run ByRun By casecase
●
Syntax:Syntax:
case “STRING” incase “STRING” in
pattern1)pattern1)
cmd1 ...cmd1 ...
;;;;
pattern2)pattern2)
cmd2 ...cmd2 ...
;;;;
esacesac
repeatable
Ref. Pge. 441
Loop StatementLoop Statement
●
Loop flow:Loop flow:
loop
condition
do
cmd ...
done
Ref. Pge. 442
TheThe forfor LoopLoop
●
Syntax:Syntax:
for VAR in values ...for VAR in values ...
dodo
commands ...commands ...
donedone
Ref. Pge. 442
TheThe forfor LoopLoop
●
Tips:Tips:
●
A new variable is set when running a for loopA new variable is set when running a for loop
●
The value sources are vary.The value sources are vary.
●
The times of loop depends on the number ofThe times of loop depends on the number of
value.value.
●
Each value is used once in theEach value is used once in the do­donedo­done
statement in order.statement in order.
TheThe whilewhile LoopLoop
●
Syntax:Syntax:
while cmd1while cmd1
dodo
cmd2 ...cmd2 ...
donedone
Ref. Pge. 443
TheThe whilewhile LoopLoop
●
Tips:Tips:
●
TheThe cmd1cmd1 is run at each loop cycle.is run at each loop cycle.
●
TheThe do­donedo­done statement only be run whilestatement only be run while cmd1cmd1
returns TRUE value.returns TRUE value.
●
The whole loop is terminated onceThe whole loop is terminated once cmd1cmd1 returnsreturns
FALSE value.FALSE value.
●
Infinity loop may be designed in purpose, orInfinity loop may be designed in purpose, or
accidentally.accidentally.
TheThe untiluntil LoopLoop
●
Syntax:Syntax:
until cmd1until cmd1
dodo
cmd2 ...cmd2 ...
donedone
TheThe untiluntil LoopLoop
●
Tips:Tips:
●
TheThe cmd1cmd1 is run at each loop cycle.is run at each loop cycle.
●
TheThe do­donedo­done statement only be run whilestatement only be run while cmd1cmd1
returns FALSE value.returns FALSE value.
●
The whole loop is terminated onceThe whole loop is terminated once cmd1cmd1 returnsreturns
TRUE value.TRUE value.
UsingUsing breakbreak In LoopIn Loop
●
Loop flow:Loop flow:
loop
condition
do
cmd ...
break
cmd ...
done
UsingUsing breakbreak In LoopsIn Loops
●
Tips:Tips:
●
The loop is terminated once theThe loop is terminated once the breakbreak runs.runs.
●
A number can be specified to break theA number can be specified to break the NthNth
outbound loop.outbound loop.
1
2
3
UsingUsing continuecontinue In LoopIn Loop
●
Loop flow:Loop flow:
loop
condition
do
cmd ...
continue
cmd ...
done
UsingUsing continuecontinue In LoopIn Loop
●
Tips:Tips:
●
The remained lines in current loop cycle areThe remained lines in current loop cycle are
omitted once theomitted once the continuecontinue runs, script goesruns, script goes
straight to continue next cycle.straight to continue next cycle.
●
A number can be specified to continue theA number can be specified to continue the NthNth
outbound loop.outbound loop.
UsingUsing sleepsleep In LoopIn Loop
●
Tips:Tips:
●
The script is temporally stopped when theThe script is temporally stopped when the
sleepsleep runs.runs.
●
A number of second can be specified to stop theA number of second can be specified to stop the
script in how long.script in how long.
●
Useful for periodical jobs with infinity loop.Useful for periodical jobs with infinity loop.

More Related Content

What's hot

Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scriptingCorrado Santoro
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.pptKalkey
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellKenny (netman)
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell ScriptingRaghu nath
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpen Gurukul
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Mastering unix
Mastering unixMastering unix
Mastering unixRaghu nath
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012Tim Bunce
 
Bash shell
Bash shellBash shell
Bash shellxylas121
 

What's hot (20)

Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scripting
 
Chap06
Chap06Chap06
Chap06
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Scripting and the shell in LINUX
Scripting and the shell in LINUXScripting and the shell in LINUX
Scripting and the shell in LINUX
 
Unix shell scripting tutorial
Unix shell scripting tutorialUnix shell scripting tutorial
Unix shell scripting tutorial
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Mastering unix
Mastering unixMastering unix
Mastering unix
 
Shellprogramming
ShellprogrammingShellprogramming
Shellprogramming
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Bash shell
Bash shellBash shell
Bash shell
 

Viewers also liked

Viewers also liked (20)

Shell script
Shell scriptShell script
Shell script
 
Introduction to c ++ part -2
Introduction to c ++   part -2Introduction to c ++   part -2
Introduction to c ++ part -2
 
Shell Script Linux
Shell Script LinuxShell Script Linux
Shell Script Linux
 
Ras pioverview
Ras pioverviewRas pioverview
Ras pioverview
 
Chap 18 net
Chap 18 netChap 18 net
Chap 18 net
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
 
Linux pipe & redirection
Linux pipe & redirectionLinux pipe & redirection
Linux pipe & redirection
 
Chap 17 advfs
Chap 17 advfsChap 17 advfs
Chap 17 advfs
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
Power point (asking permission)
Power point (asking permission)Power point (asking permission)
Power point (asking permission)
 
Your first linux programs
Your first linux programsYour first linux programs
Your first linux programs
 
Unix - Filters/Editors
Unix - Filters/EditorsUnix - Filters/Editors
Unix - Filters/Editors
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 
Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account management
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
 
Linux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkgLinux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkg
 

Similar to Linux fundamental - Chap 14 shell script

Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Ahmed El-Arabawy
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1Nihar Ranjan Paital
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018Mandi Walls
 
Shell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdfShell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdfHIMANKMISHRA2
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleOmid Vahdaty
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 
One click deployment
One click deploymentOne click deployment
One click deploymentAlex Su
 
Licão 09 variables and arrays v2
Licão 09 variables and arrays v2Licão 09 variables and arrays v2
Licão 09 variables and arrays v2Acácio Oliveira
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfOrtus Solutions, Corp
 
2009 cluster user training
2009 cluster user training2009 cluster user training
2009 cluster user trainingChris Dwan
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 
Cli jbug
Cli jbugCli jbug
Cli jbugmaeste
 
Shell Scripting crash course.pdf
Shell Scripting crash course.pdfShell Scripting crash course.pdf
Shell Scripting crash course.pdfharikrishnapolaki
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersKirk Kimmel
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1Dr.Ravi
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.pptmugeshmsd5
 

Similar to Linux fundamental - Chap 14 shell script (20)

Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
 
Linux shell
Linux shellLinux shell
Linux shell
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 
Shell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdfShell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdf
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
Licão 09 variables and arrays v2
Licão 09 variables and arrays v2Licão 09 variables and arrays v2
Licão 09 variables and arrays v2
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
2009 cluster user training
2009 cluster user training2009 cluster user training
2009 cluster user training
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
Cli jbug
Cli jbugCli jbug
Cli jbug
 
AS7 and CLI
AS7 and CLIAS7 and CLI
AS7 and CLI
 
Shell Scripting crash course.pdf
Shell Scripting crash course.pdfShell Scripting crash course.pdf
Shell Scripting crash course.pdf
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
 
Spsl by sasidhar 3 unit
Spsl by sasidhar  3 unitSpsl by sasidhar  3 unit
Spsl by sasidhar 3 unit
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.ppt
 

More from Kenny (netman)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration stepsKenny (netman)
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingKenny (netman)
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsKenny (netman)
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procKenny (netman)
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viKenny (netman)
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxKenny (netman)
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveKenny (netman)
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileKenny (netman)
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permKenny (netman)
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioKenny (netman)
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network MonitoringKenny (netman)
 

More from Kenny (netman) (20)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
 
Rpi audio
Rpi audioRpi audio
Rpi audio
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
About the Course
About the CourseAbout the Course
About the Course
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 perm
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 io
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network Monitoring
 
加密應用(GPG)
加密應用(GPG)加密應用(GPG)
加密應用(GPG)
 
金鑰管理 (PKI)
金鑰管理 (PKI)金鑰管理 (PKI)
金鑰管理 (PKI)
 

Linux fundamental - Chap 14 shell script