SlideShare a Scribd company logo
1 of 22
www.exoplatform.com Copyright 2011 eXo Platform Linux Shell Scripting Exo Shell Scripting Vu Duy Tu – CT Team Link to file in exo site
www.exoplatform.com Copyright 2011 eXo Platform Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Unix  Architecture
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Popular Shells Shell Name Developed by Where Remark BASH ( Bourne-Again SHell )  Brian Fox and Chet Ramey Free Software Foundation Most common shell in Linux. It's Freeware shell. CSH (C SHell)  Bill Joy University of California (For BSD The C shell's syntax and usage are very similar to the C programming language. KSH (Korn SHell)  David Korn AT & T Bell Labs TCSH  See the man page. Type $ man tcsh TCSH is an enhanced but completely compatible version of the Berkeley UNIX C shell (CSH).
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Families of Shells
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Flavors of Unix Shells ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Login shell ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform How to use Shell ? - To use shell (You start to use your shell as soon as you log into your system) you have to simply type commands. - See common Linux Command for syntax and example, this can be used as quick reference while programming the shell.
www.exoplatform.com Copyright 2011 eXo Platform What is Shell Script ? Normally shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
www.exoplatform.com Copyright 2011 eXo Platform What is Shell Script ? Why to Write Shell Script ? Shell script can take input from user, file and output them on screen. Useful to create our own commands. Save lots of time. To automate some task of day today life. System Administration part can be also automated.
www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual - Make a comment: # - make easier to read and maintain - Make a alias: alias="command/function" - Print info in to console: echo - Goto dir: cd  - View files/folder in dir: ls - Move/Copy/Remove files/folder: mv/cp/rm  - Create folder: mkdir  - Create text file: echo "content" > file.txt - Install application : apt-get, dpkg - Editor text file: gedit, vim.. - Search files/folder: find  - Search content: grep  - Replace content: sed  - Download file from Internet: wget   ... ,[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual ,[object Object],- Operators Operators Example = a=$b;  a=&quot;abc&quot;; a=&quot;a=$b&quot;; a=$(ls); a=`ls *.java`; a=$((a+1)); +,-,*,/,% Only use in (()) or use command expr: echo &quot;1 + 2 = $((1+2)) or 1 + 2 = `expr 1+ 2`&quot;; echo &quot;3 * 5 = `3  5`&quot;; ==, !=, >, < &&, || if [ $a == $b ],  if [ $a != $b ], if [ $((a > 5)) ],  if [ $a -gt 5 ],  if [ $a -le 5 ]  if [ -n &quot;$a&quot; ] && [ -e &quot;$b&quot; ]; ...,  if [ -n &quot;$a&quot; ] || [ -n &quot;$b&quot; ]; ... - Different &quot; &quot;, ` ` and ' ' ,[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual -Parameters +  It is  their position on the command line - Operators Operators Example if... else if [ $a == $b ]; then .... fi if [ $a == $b ]; then .... elif [ $a == &quot;xxx&quot; ]; then ... fi  if [ $a == $b ]; then .... elif [ $a == &quot;xxx&quot; ]; then ...  else ... fi For Loops for X in `ls *.java` do .... done for ((i = 0 ; i <= 10 ; i++ )) do ... done Functions function abc { .... do something ... } Parameters Detail   $0 Name of the calling program $1 - $9 Command-line Arguments
www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual -  Parameters + Value of Command-line arguments: $* and $@( not just the first nine) “ $*”  : treats the entire list of arguments as a single argument “ $@” : produce a list of separate arguments (Only bash/ksh/sh) + Example for use: - Array + Initialization: arr=(item1 item2 item3 ... itemn). + Use: echo arr[0]; + Loops: for X in &quot;${arr[@]}&quot;; do ... done
www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Example -  Base shell
www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting I.   Exo application using in terminal. - Maven : + mvn version + mvn clean   + mvn eclipse:eclipse + mvn install - param - Svn : + svn checkout (co) + svn update (ud) + svn commit (ci) + svn info, log, diff, st - Git + git init + git add .... - Patch: patch file diff. - MySql - Achecker client
www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting II.  Apply shell for Exo - Create stack for build projects (exobuild). -   Create alias for quick run command. - Create function for run sequential other command. - Setup or install other application help for work in eXo - Create function for automatically run some stack (ex: jenkins) - Create function (search by rules) for checking bug in code. - Maybe we can use find/grep/sed for fix some bug :D. (ex: accessibility )
www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting III. EXOCT (my shell scripting for eXo) - Quick use some function in eXo.  - Quick goto produce. - Easy for update/build other produces  - Easy for create patch - Easy for build quickwar/module of produce - Easy for run tomcat ... Other..
www.exoplatform.com Copyright 2011 eXo Platform Document reference 1/ The book attachment in wiki page. 2/ Link: http://javarevisited.blogspot.com http://tldp.org/LDP/abs/html/   http://www.freeos.com/guides/lsst/  (main) http://www.grymoire.com/Unix/Sed.html
www.exoplatform.com Copyright 2011 eXo Platform Discussion Thank you!
www.exoplatform.com Copyright 2011 eXo Platform Linux Shell Scripting Exo Shell Scripting Vu Duy Tu – CT Team Link to file in exo site

More Related Content

What's hot

Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script Amit Ghosh
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarGauravRaikar3
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell ScriptingRaghu nath
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
 
Bash shell
Bash shellBash shell
Bash shellxylas121
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell ScriptingRaghu nath
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in LinuxAnu Chaudhry
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-linersdaoswald
 
Oral presentation v2
Oral presentation v2Oral presentation v2
Oral presentation v2Yeqi He
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpen Gurukul
 

What's hot (20)

Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Chap06
Chap06Chap06
Chap06
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Bash shell
Bash shellBash shell
Bash shell
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-liners
 
Oral presentation v2
Oral presentation v2Oral presentation v2
Oral presentation v2
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 

Viewers also liked

MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013Thuy_Dang
 
Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!Abhi Patel
 
Xss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAXss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAThuy_Dang
 
Berntsen -chicago_my_home_town_-_08-10-11
Berntsen  -chicago_my_home_town_-_08-10-11Berntsen  -chicago_my_home_town_-_08-10-11
Berntsen -chicago_my_home_town_-_08-10-11Rosanna Goode
 
Barber Library Website Usability Results, Fall 2012
Barber Library Website Usability Results, Fall 2012Barber Library Website Usability Results, Fall 2012
Barber Library Website Usability Results, Fall 2012desilvam
 
Cumpleaños
CumpleañosCumpleaños
Cumpleañosmaclein1
 
Catalog parts
Catalog partsCatalog parts
Catalog partsdesilvam
 
Cumple2011
Cumple2011Cumple2011
Cumple2011maclein1
 
Chromattic usage in eXo Social
Chromattic usage in eXo SocialChromattic usage in eXo Social
Chromattic usage in eXo SocialThuy_Dang
 
Regular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal teamRegular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal teamThuy_Dang
 
La desicion mas dificil
La desicion mas dificilLa desicion mas dificil
La desicion mas dificilgabydq
 
Ingles speaking
Ingles speakingIngles speaking
Ingles speakinggabydq
 
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamAOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamThuy_Dang
 
Ingles speaking
Ingles speakingIngles speaking
Ingles speakinggabydq
 

Viewers also liked (20)

MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013
 
Lirios do_campo
Lirios do_campoLirios do_campo
Lirios do_campo
 
Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!
 
COSTA_CONCORDIA
COSTA_CONCORDIACOSTA_CONCORDIA
COSTA_CONCORDIA
 
Xss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAXss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEA
 
Berntsen -chicago_my_home_town_-_08-10-11
Berntsen  -chicago_my_home_town_-_08-10-11Berntsen  -chicago_my_home_town_-_08-10-11
Berntsen -chicago_my_home_town_-_08-10-11
 
Barber Library Website Usability Results, Fall 2012
Barber Library Website Usability Results, Fall 2012Barber Library Website Usability Results, Fall 2012
Barber Library Website Usability Results, Fall 2012
 
Cumpleaños
CumpleañosCumpleaños
Cumpleaños
 
Catalog parts
Catalog partsCatalog parts
Catalog parts
 
Cumple2011
Cumple2011Cumple2011
Cumple2011
 
Chromattic usage in eXo Social
Chromattic usage in eXo SocialChromattic usage in eXo Social
Chromattic usage in eXo Social
 
Regular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal teamRegular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal team
 
Expo dun and ross
Expo dun and rossExpo dun and ross
Expo dun and ross
 
La desicion mas dificil
La desicion mas dificilLa desicion mas dificil
La desicion mas dificil
 
Ingles speaking
Ingles speakingIngles speaking
Ingles speaking
 
Jhonatanlopez
JhonatanlopezJhonatanlopez
Jhonatanlopez
 
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamAOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
 
20140426 wtm66
20140426 wtm6620140426 wtm66
20140426 wtm66
 
Coisas antigas 1
Coisas antigas 1Coisas antigas 1
Coisas antigas 1
 
Ingles speaking
Ingles speakingIngles speaking
Ingles speaking
 

Similar to Shell scripting - By Vu Duy Tu from eXo Platform SEA

Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingvibrantuser
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administrationvceder
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4Techvilla
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfClapperboardCinemaPV
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell ScriptAmit Ghosh
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atdAcácio Oliveira
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageRené Ribaud
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atdAcácio Oliveira
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4Acácio Oliveira
 

Similar to Shell scripting - By Vu Duy Tu from eXo Platform SEA (20)

Shell programming
Shell programmingShell programming
Shell programming
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Unix day2 v1.3
Unix day2 v1.3Unix day2 v1.3
Unix day2 v1.3
 
60761 linux
60761 linux60761 linux
60761 linux
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
 
Unix
UnixUnix
Unix
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administration
 
Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Slides
SlidesSlides
Slides
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell Script
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming language
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atd
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4
 

More from Thuy_Dang

Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA
Scala - By Luu Thanh Thuy CWI team from eXo Platform SEAScala - By Luu Thanh Thuy CWI team from eXo Platform SEA
Scala - By Luu Thanh Thuy CWI team from eXo Platform SEAThuy_Dang
 
Mcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal teamMcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal teamThuy_Dang
 
Web accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAWeb accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAThuy_Dang
 
Secure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEASecure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEAThuy_Dang
 
SEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM teamSEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM teamThuy_Dang
 
Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT Thuy_Dang
 
Os gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamOs gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamThuy_Dang
 
eXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh VueXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh VuThuy_Dang
 

More from Thuy_Dang (8)

Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA
Scala - By Luu Thanh Thuy CWI team from eXo Platform SEAScala - By Luu Thanh Thuy CWI team from eXo Platform SEA
Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA
 
Mcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal teamMcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal team
 
Web accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAWeb accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEA
 
Secure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEASecure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEA
 
SEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM teamSEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM team
 
Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT
 
Os gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamOs gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC team
 
eXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh VueXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh Vu
 

Recently uploaded

Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 

Recently uploaded (20)

Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 

Shell scripting - By Vu Duy Tu from eXo Platform SEA

  • 1. www.exoplatform.com Copyright 2011 eXo Platform Linux Shell Scripting Exo Shell Scripting Vu Duy Tu – CT Team Link to file in exo site
  • 2.
  • 3.
  • 4. www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Unix Architecture
  • 5. www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Popular Shells Shell Name Developed by Where Remark BASH ( Bourne-Again SHell ) Brian Fox and Chet Ramey Free Software Foundation Most common shell in Linux. It's Freeware shell. CSH (C SHell) Bill Joy University of California (For BSD The C shell's syntax and usage are very similar to the C programming language. KSH (Korn SHell) David Korn AT & T Bell Labs TCSH See the man page. Type $ man tcsh TCSH is an enhanced but completely compatible version of the Berkeley UNIX C shell (CSH).
  • 6. www.exoplatform.com Copyright 2011 eXo Platform What is shell ? Families of Shells
  • 7.
  • 8.
  • 9. www.exoplatform.com Copyright 2011 eXo Platform How to use Shell ? - To use shell (You start to use your shell as soon as you log into your system) you have to simply type commands. - See common Linux Command for syntax and example, this can be used as quick reference while programming the shell.
  • 10. www.exoplatform.com Copyright 2011 eXo Platform What is Shell Script ? Normally shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
  • 11. www.exoplatform.com Copyright 2011 eXo Platform What is Shell Script ? Why to Write Shell Script ? Shell script can take input from user, file and output them on screen. Useful to create our own commands. Save lots of time. To automate some task of day today life. System Administration part can be also automated.
  • 12.
  • 13.
  • 14. www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual -Parameters + It is their position on the command line - Operators Operators Example if... else if [ $a == $b ]; then .... fi if [ $a == $b ]; then .... elif [ $a == &quot;xxx&quot; ]; then ... fi if [ $a == $b ]; then .... elif [ $a == &quot;xxx&quot; ]; then ... else ... fi For Loops for X in `ls *.java` do .... done for ((i = 0 ; i <= 10 ; i++ )) do ... done Functions function abc { .... do something ... } Parameters Detail $0 Name of the calling program $1 - $9 Command-line Arguments
  • 15. www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Manual - Parameters + Value of Command-line arguments: $* and $@( not just the first nine) “ $*” : treats the entire list of arguments as a single argument “ $@” : produce a list of separate arguments (Only bash/ksh/sh) + Example for use: - Array + Initialization: arr=(item1 item2 item3 ... itemn). + Use: echo arr[0]; + Loops: for X in &quot;${arr[@]}&quot;; do ... done
  • 16. www.exoplatform.com Copyright 2011 eXo Platform Shell Scripting Example - Base shell
  • 17. www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting I. Exo application using in terminal. - Maven : + mvn version + mvn clean + mvn eclipse:eclipse + mvn install - param - Svn : + svn checkout (co) + svn update (ud) + svn commit (ci) + svn info, log, diff, st - Git + git init + git add .... - Patch: patch file diff. - MySql - Achecker client
  • 18. www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting II. Apply shell for Exo - Create stack for build projects (exobuild). - Create alias for quick run command. - Create function for run sequential other command. - Setup or install other application help for work in eXo - Create function for automatically run some stack (ex: jenkins) - Create function (search by rules) for checking bug in code. - Maybe we can use find/grep/sed for fix some bug :D. (ex: accessibility )
  • 19. www.exoplatform.com Copyright 2011 eXo Platform Exo Shell Scripting III. EXOCT (my shell scripting for eXo) - Quick use some function in eXo. - Quick goto produce. - Easy for update/build other produces - Easy for create patch - Easy for build quickwar/module of produce - Easy for run tomcat ... Other..
  • 20. www.exoplatform.com Copyright 2011 eXo Platform Document reference 1/ The book attachment in wiki page. 2/ Link: http://javarevisited.blogspot.com http://tldp.org/LDP/abs/html/ http://www.freeos.com/guides/lsst/ (main) http://www.grymoire.com/Unix/Sed.html
  • 21. www.exoplatform.com Copyright 2011 eXo Platform Discussion Thank you!
  • 22. www.exoplatform.com Copyright 2011 eXo Platform Linux Shell Scripting Exo Shell Scripting Vu Duy Tu – CT Team Link to file in exo site