SlideShare a Scribd company logo
1 of 7
Bash scripting OpenFest Gabrovo 2010 Marian Marinov System Architect at Siteground.com
1. What will save time if cmd; then echo OK; fi vs if ( cmd ) then  echo OK;  fi  if [ "$(cmd)" == 'result' ]; then echo OK; fi  vs if [ $(cmd) == 'result' ]; then echo OK; fi  if [ -f PATH ]; then echo OK; fi vs if test -f PATH; then echo OK; fi
2. Environment HISTSIZE="1000" HOME="/home/hackman" HOSTNAME="gamelon.azilian.net" LOGNAME="hackman" OLDPWD="/home/hackman" PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin" PWD="/tmp" SHELL="/bin/bash" SHLVL="3" TERM="xterm" USER="hackman" USERNAME="hackman"
2. Environment SSH_AGENT_PID="2131" SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass" SSH_AUTH_SOCK="/tmp/ssh-rHvhmB2112/agent.2112" SSH_CLIENT="87.118.135.1 58431 18765" SSH_CONNECTION="87.118.135.1 58431 72.18.172.13 18765" SSH_TTY="/dev/pts/0"
3. Locality m=''; l=''; cat file | while read a; do if [ "$a" == 'XXX' ]; then  m=$a;  fi if [ "$a" == 'YYY' ]; then  n=$a;  fi  done m & n are still ''
4. Arrays l=(a b c) $ echo ${l[0]} a $ echo ${l[1]} ips=($(ip a l eth0|awk '/inet /{gsub(/.*/,"",$2);print $2}'))
5. Commands ls cp mv rm echo cat cut  wc seq tail head  sort uniq date stat  grep find  sed awk

More Related Content

What's hot

Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containersMarian Marinov
 
Tools used for debugging
Tools used for debuggingTools used for debugging
Tools used for debuggingMarian Marinov
 
Django Toolbox
Django ToolboxDjango Toolbox
Django Toolboxpythonsd
 
Introduction To Programming in GNU-LINUX
Introduction To Programming in GNU-LINUXIntroduction To Programming in GNU-LINUX
Introduction To Programming in GNU-LINUXIrfan Ahmed
 
PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12Kazuki KOMORI
 
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feedsmusher has_a_location acts_as_feed
smusher has_a_location acts_as_feedgrosser
 
Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Puppet
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friendajacksified
 
Characterset
CharactersetCharacterset
CharactersetHari K T
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 
Intro to the command line
Intro to the command lineIntro to the command line
Intro to the command linegregmcintyre
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internetTatsuhiko Miyagawa
 
Flash Is Dead, Long Live Flash!
Flash Is Dead, Long Live Flash!Flash Is Dead, Long Live Flash!
Flash Is Dead, Long Live Flash!Rye Corradini
 
zsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminarzsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminarhama7230
 
Augeas
AugeasAugeas
Augeaslutter
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with phpElizabeth Smith
 

What's hot (20)

Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containers
 
Tools used for debugging
Tools used for debuggingTools used for debugging
Tools used for debugging
 
Django Toolbox
Django ToolboxDjango Toolbox
Django Toolbox
 
Introduction To Programming in GNU-LINUX
Introduction To Programming in GNU-LINUXIntroduction To Programming in GNU-LINUX
Introduction To Programming in GNU-LINUX
 
PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12PHPerのためのPerl入門@ Kansai.pm#12
PHPerのためのPerl入門@ Kansai.pm#12
 
TDD, a starting point...
TDD, a starting point...TDD, a starting point...
TDD, a starting point...
 
A Sip of Python
A Sip of PythonA Sip of Python
A Sip of Python
 
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feedsmusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
 
Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friend
 
Characterset
CharactersetCharacterset
Characterset
 
Php performance
Php performancePhp performance
Php performance
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Intro to the command line
Intro to the command lineIntro to the command line
Intro to the command line
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
 
Flash Is Dead, Long Live Flash!
Flash Is Dead, Long Live Flash!Flash Is Dead, Long Live Flash!
Flash Is Dead, Long Live Flash!
 
Bash 4
Bash 4Bash 4
Bash 4
 
zsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminarzsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminar
 
Augeas
AugeasAugeas
Augeas
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with php
 

Viewers also liked

Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsMarian Marinov
 
Artificial Inteligence in the System Administration
Artificial Inteligence in the System AdministrationArtificial Inteligence in the System Administration
Artificial Inteligence in the System AdministrationMarian Marinov
 
Dynamic code generation in Perl
Dynamic code generation in PerlDynamic code generation in Perl
Dynamic code generation in PerlMarian Marinov
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control GroupsMarian Marinov
 
Wifi the good bad and ugly
Wifi the good bad and uglyWifi the good bad and ugly
Wifi the good bad and uglyMarian Marinov
 
LSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxLSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxMarian Marinov
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMMarian Marinov
 
Clusters with GlusterFS
Clusters with GlusterFSClusters with GlusterFS
Clusters with GlusterFSMarian Marinov
 
Ha systems-with-heartbeatv2
Ha systems-with-heartbeatv2Ha systems-with-heartbeatv2
Ha systems-with-heartbeatv2Marian Marinov
 
Unatended installations
Unatended installationsUnatended installations
Unatended installationsMarian Marinov
 
Home and Car automation DORS/CLUC 2013
Home and Car automation DORS/CLUC 2013Home and Car automation DORS/CLUC 2013
Home and Car automation DORS/CLUC 2013Marian Marinov
 
Is the Sky the Limit to Educational Improvement: Secondary Educational Reform
Is the Sky the Limit to Educational Improvement:Secondary Educational ReformIs the Sky the Limit to Educational Improvement:Secondary Educational Reform
Is the Sky the Limit to Educational Improvement: Secondary Educational ReformEduSkills OECD
 
Presentazione ontario camera di commercio milano
Presentazione ontario camera di commercio milanoPresentazione ontario camera di commercio milano
Presentazione ontario camera di commercio milanoRossella De Benedictis
 

Viewers also liked (20)

Monitoring costs
Monitoring costsMonitoring costs
Monitoring costs
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
 
Artificial Inteligence in the System Administration
Artificial Inteligence in the System AdministrationArtificial Inteligence in the System Administration
Artificial Inteligence in the System Administration
 
Dynamic code generation in Perl
Dynamic code generation in PerlDynamic code generation in Perl
Dynamic code generation in Perl
 
Perl containers
Perl containersPerl containers
Perl containers
 
LSA2 - 02 chrooting
LSA2 - 02 chrootingLSA2 - 02 chrooting
LSA2 - 02 chrooting
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
Home car-automation
Home car-automationHome car-automation
Home car-automation
 
1. hardware basics
1. hardware basics1. hardware basics
1. hardware basics
 
Wifi the good bad and ugly
Wifi the good bad and uglyWifi the good bad and ugly
Wifi the good bad and ugly
 
LSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxLSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginx
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVM
 
Clusters with GlusterFS
Clusters with GlusterFSClusters with GlusterFS
Clusters with GlusterFS
 
Ha systems-with-heartbeatv2
Ha systems-with-heartbeatv2Ha systems-with-heartbeatv2
Ha systems-with-heartbeatv2
 
Unatended installations
Unatended installationsUnatended installations
Unatended installations
 
Home and Car automation DORS/CLUC 2013
Home and Car automation DORS/CLUC 2013Home and Car automation DORS/CLUC 2013
Home and Car automation DORS/CLUC 2013
 
Is the Sky the Limit to Educational Improvement: Secondary Educational Reform
Is the Sky the Limit to Educational Improvement:Secondary Educational ReformIs the Sky the Limit to Educational Improvement:Secondary Educational Reform
Is the Sky the Limit to Educational Improvement: Secondary Educational Reform
 
Gender presentation
Gender presentationGender presentation
Gender presentation
 
National NGO Success Story
National NGO Success Story National NGO Success Story
National NGO Success Story
 
Presentazione ontario camera di commercio milano
Presentazione ontario camera di commercio milanoPresentazione ontario camera di commercio milano
Presentazione ontario camera di commercio milano
 

Similar to Bash Scripting Gabrovo

PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationAnkush Jain
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With PhpJeremy Coates
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to youguestdd9d06
 
Php Training
Php TrainingPhp Training
Php Trainingadfa
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To LampAmzad Hossain
 
Schenker - DSL for quickly creating web applications in Perl
Schenker - DSL for quickly creating web applications in PerlSchenker - DSL for quickly creating web applications in Perl
Schenker - DSL for quickly creating web applications in PerlJiro Nishiguchi
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsRafael García
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsAbhay Sapru
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Getting groovy (ODP)
Getting groovy (ODP)Getting groovy (ODP)
Getting groovy (ODP)Nick Dixon
 
Itty bittypresentation lrug
Itty bittypresentation lrugItty bittypresentation lrug
Itty bittypresentation lrugTom Crinson
 
Itty bittypresentation lrug
Itty bittypresentation lrugItty bittypresentation lrug
Itty bittypresentation lrugSkills Matter
 
Gwt_Wouter1
Gwt_Wouter1Gwt_Wouter1
Gwt_Wouter1Wouter
 
Gwt wouter
Gwt wouterGwt wouter
Gwt wouterWouter
 

Similar to Bash Scripting Gabrovo (20)

PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Bash Geekcamp
Bash GeekcampBash Geekcamp
Bash Geekcamp
 
Php 3 1
Php 3 1Php 3 1
Php 3 1
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to you
 
Php Training
Php TrainingPhp Training
Php Training
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
Schenker - DSL for quickly creating web applications in Perl
Schenker - DSL for quickly creating web applications in PerlSchenker - DSL for quickly creating web applications in Perl
Schenker - DSL for quickly creating web applications in Perl
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Getting groovy (ODP)
Getting groovy (ODP)Getting groovy (ODP)
Getting groovy (ODP)
 
Itty bittypresentation lrug
Itty bittypresentation lrugItty bittypresentation lrug
Itty bittypresentation lrug
 
Itty bittypresentation lrug
Itty bittypresentation lrugItty bittypresentation lrug
Itty bittypresentation lrug
 
Gwt_Wouter1
Gwt_Wouter1Gwt_Wouter1
Gwt_Wouter1
 
Gwt wouter
Gwt wouterGwt wouter
Gwt wouter
 

More from Marian Marinov

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsMarian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDBMarian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMarian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfMarian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home eraMarian Marinov
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefsMarian Marinov
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL serverMarian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKMarian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networksMarian Marinov
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automationMarian Marinov
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingMarian Marinov
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of serversMarian Marinov
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failuresMarian Marinov
 

More from Marian Marinov (20)

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failures
 

Recently uploaded

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Bash Scripting Gabrovo

  • 1. Bash scripting OpenFest Gabrovo 2010 Marian Marinov System Architect at Siteground.com
  • 2. 1. What will save time if cmd; then echo OK; fi vs if ( cmd ) then echo OK; fi if [ "$(cmd)" == 'result' ]; then echo OK; fi vs if [ $(cmd) == 'result' ]; then echo OK; fi if [ -f PATH ]; then echo OK; fi vs if test -f PATH; then echo OK; fi
  • 3. 2. Environment HISTSIZE="1000" HOME="/home/hackman" HOSTNAME="gamelon.azilian.net" LOGNAME="hackman" OLDPWD="/home/hackman" PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin" PWD="/tmp" SHELL="/bin/bash" SHLVL="3" TERM="xterm" USER="hackman" USERNAME="hackman"
  • 4. 2. Environment SSH_AGENT_PID="2131" SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass" SSH_AUTH_SOCK="/tmp/ssh-rHvhmB2112/agent.2112" SSH_CLIENT="87.118.135.1 58431 18765" SSH_CONNECTION="87.118.135.1 58431 72.18.172.13 18765" SSH_TTY="/dev/pts/0"
  • 5. 3. Locality m=''; l=''; cat file | while read a; do if [ "$a" == 'XXX' ]; then m=$a; fi if [ "$a" == 'YYY' ]; then n=$a; fi done m & n are still ''
  • 6. 4. Arrays l=(a b c) $ echo ${l[0]} a $ echo ${l[1]} ips=($(ip a l eth0|awk '/inet /{gsub(/.*/,"",$2);print $2}'))
  • 7. 5. Commands ls cp mv rm echo cat cut wc seq tail head sort uniq date stat grep find sed awk