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

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

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