Linux fundamental - Chap 14 shell script

Kenny (netman)
Kenny (netman)IT Infrastructure Engineer at SUMIKA TECHNOLOGY CO., LTD.
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.
1 of 80

Recommended

Shell Script Tutorial by
Shell Script TutorialShell Script Tutorial
Shell Script TutorialQuang Minh Đoàn
1.3K views31 slides
Shell script-sec by
Shell script-secShell script-sec
Shell script-secSRIKANTH ANDE
587 views115 slides
Unix Shell Scripting Basics by
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
11.9K views71 slides
Quick start bash script by
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
3.5K views36 slides
Shell Scripting by
Shell ScriptingShell Scripting
Shell ScriptingGaurav Shinde
6.4K views75 slides
Unix Shell Scripting Basics by
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
3.3K views71 slides

More Related Content

What's hot

Introduction to shell scripting by
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scriptingCorrado Santoro
5.2K views96 slides
Chap06 by
Chap06Chap06
Chap06Dr.Ravi
905 views41 slides
Shell scripting by
Shell scriptingShell scripting
Shell scriptingManav Prasad
3.6K views90 slides
Unix And Shell Scripting by
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
4.6K views33 slides
Shell scripting by
Shell scriptingShell scripting
Shell scriptingsimha.dev.lin
8.9K views12 slides
Shell programming 1.ppt by
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.pptKalkey
219 views16 slides

What's hot(20)

Introduction to shell scripting by Corrado Santoro
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scripting
Corrado Santoro5.2K views
Chap06 by Dr.Ravi
Chap06Chap06
Chap06
Dr.Ravi905 views
Unix And Shell Scripting by Jaibeer Malik
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
Jaibeer Malik4.6K views
Shell programming 1.ppt by Kalkey
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
Kalkey219 views
Linux fundamental - Chap 00 shell by Kenny (netman)
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
Kenny (netman)1.1K views
Intro to Linux Shell Scripting by vceder
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
vceder6.9K views
Bash Shell Scripting by Raghu nath
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath3.6K views
Lecture 3 Perl & FreeBSD administration by Mohammed Farrag
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
Mohammed Farrag1.5K views
OpenGurukul : Language : Shell Scripting by Open Gurukul
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
Open Gurukul3.6K views
Mastering unix by Raghu nath
Mastering unixMastering unix
Mastering unix
Raghu nath429 views
PL/Perl - New Features in PostgreSQL 9.0 201012 by Tim Bunce
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
Tim Bunce5.4K views
Bash shell by xylas121
Bash shellBash shell
Bash shell
xylas1216.7K views

Viewers also liked

Shell script by
Shell scriptShell script
Shell scriptTiago
452 views151 slides
Shell Script Linux by
Shell Script LinuxShell Script Linux
Shell Script LinuxWellington Oliveira
1.2K views29 slides
Ras pioverview by
Ras pioverviewRas pioverview
Ras pioverviewAlec Clews
1.1K views15 slides
Chap 18 net by
Chap 18 netChap 18 net
Chap 18 netKenny (netman)
664 views25 slides
Linux fundamental - Chap 16 System Rescue by
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueKenny (netman)
963 views7 slides

Viewers also liked(20)

Shell script by Tiago
Shell scriptShell script
Shell script
Tiago 452 views
Ras pioverview by Alec Clews
Ras pioverviewRas pioverview
Ras pioverview
Alec Clews1.1K views
Linux fundamental - Chap 16 System Rescue by Kenny (netman)
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
Kenny (netman)963 views
Linux pipe & redirection by Colin Su
Linux pipe & redirectionLinux pipe & redirection
Linux pipe & redirection
Colin Su971 views
Unix tutorial-08 by Tushar Jain
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
Tushar Jain720 views
Linux network monitoring hands-on pratice by Kenny (netman)
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
Kenny (netman)1.8K views
Linux fundamentals by chakrikolla
Linux fundamentalsLinux fundamentals
Linux fundamentals
chakrikolla493 views
Power point (asking permission) by ahmaddarda1505
Power point (asking permission)Power point (asking permission)
Power point (asking permission)
ahmaddarda15056.1K views
Linux fundamental - Chap 13 account management by Kenny (netman)
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account management
Kenny (netman)935 views
Linux fundamental - Chap 05 filter by Kenny (netman)
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
Kenny (netman)778 views
Linux fundamental - Chap 09 pkg by Kenny (netman)
Linux fundamental - Chap 09 pkgLinux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkg
Kenny (netman)808 views

Similar to Linux fundamental - Chap 14 shell script

Course 102: Lecture 10: Learning About the Shell by
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
1.2K views32 slides
Linux shell by
Linux shellLinux shell
Linux shellKenny (netman)
1.4K views143 slides
UNIX - Class4 - Advance Shell Scripting-P1 by
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1Nihar Ranjan Paital
1.3K views18 slides
InSpec Workshop at Velocity London 2018 by
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018Mandi Walls
350 views63 slides
Shell Programming_Module2_Part2.pptx.pdf by
Shell Programming_Module2_Part2.pptx.pdfShell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdfHIMANKMISHRA2
18 views120 slides
Bangpypers april-meetup-2012 by
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
528 views14 slides

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

Course 102: Lecture 10: Learning About the Shell by Ahmed El-Arabawy
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-Arabawy1.2K views
InSpec Workshop at Velocity London 2018 by Mandi Walls
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
Mandi Walls350 views
Shell Programming_Module2_Part2.pptx.pdf by HIMANKMISHRA2
Shell Programming_Module2_Part2.pptx.pdfShell Programming_Module2_Part2.pptx.pdf
Shell Programming_Module2_Part2.pptx.pdf
HIMANKMISHRA218 views
Bangpypers april-meetup-2012 by Deepak Garg
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
Deepak Garg528 views
Introduction to ansible by Omid Vahdaty
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Omid Vahdaty1.1K views
A tour of Ansible by DevOps Ltd.
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.588 views
One click deployment by Alex Su
One click deploymentOne click deployment
One click deployment
Alex Su3.1K views
2009 cluster user training by Chris Dwan
2009 cluster user training2009 cluster user training
2009 cluster user training
Chris Dwan371 views
Eclipse HandsOn Workshop by Bastian Feder
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
Bastian Feder1.6K views
Cli jbug by maeste
Cli jbugCli jbug
Cli jbug
maeste722 views
AS7 and CLI by JBug Italy
AS7 and CLIAS7 and CLI
AS7 and CLI
JBug Italy3.2K views
Perl - laziness, impatience, hubris, and one liners by Kirk Kimmel
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
Kirk Kimmel2.3K views
Airlover 20030324 1 by Dr.Ravi
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
Dr.Ravi1K views
390aLecture05_12sp.ppt by mugeshmsd5
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.ppt
mugeshmsd51 view

More from Kenny (netman)

rpi_audio configuration steps by
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration stepsKenny (netman)
550 views4 slides
Rpi audio by
Rpi audioRpi audio
Rpi audioKenny (netman)
416 views33 slides
Importance of linux system fundamental in technical documentation reading by
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)
522 views15 slides
Ha opensuse by
Ha opensuseHa opensuse
Ha opensuseKenny (netman)
1K views20 slides
About the Course by
About the CourseAbout the Course
About the CourseKenny (netman)
798 views29 slides
Linux fundamental - Chap 15 Job Scheduling by
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
1.1K views14 slides

More from Kenny (netman)(20)

rpi_audio configuration steps by Kenny (netman)
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
Kenny (netman)550 views
Importance of linux system fundamental in technical documentation reading by Kenny (netman)
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
Kenny (netman)522 views
Linux fundamental - Chap 15 Job Scheduling by Kenny (netman)
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
Kenny (netman)1.1K views
Linux fundamental - Chap 12 Hardware Management by Kenny (netman)
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
Kenny (netman)886 views
Linux fundamental - Chap 11 boot by Kenny (netman)
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
Kenny (netman)1.2K views
Linux fundamental - Chap 10 fs by Kenny (netman)
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
Kenny (netman)880 views
Linux fundamental - Chap 08 proc by Kenny (netman)
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
Kenny (netman)967 views
Linux fundamental - Chap 07 vi by Kenny (netman)
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
Kenny (netman)784 views
Linux fundamental - Chap 06 regx by Kenny (netman)
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
Kenny (netman)716 views
Linux fundamental - Chap 04 archive by Kenny (netman)
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
Kenny (netman)758 views
Linux fundamental - Chap 03 file by Kenny (netman)
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
Kenny (netman)1.7K views
Linux fundamental - Chap 02 perm by Kenny (netman)
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 perm
Kenny (netman)1.1K views
Linux fundamental - Chap 01 io by Kenny (netman)
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 io
Kenny (netman)1.6K views

Linux fundamental - Chap 14 shell script