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

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

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