SlideShare a Scribd company logo
2
• If a sequence of commands is to be used repeatedly we
can assign them permanently in a file.
This file is called shell script.
• The shell script can be executed in two methods.
• One method using sh command.
• Another one is to grant executable permission to the file
using chmod command and then type the filename at the
prompt.
Most read
4
Shell variables
• There are two types :
• Build in shell variables
User defined shell variables
Build in shell variables:
These variables are created and maintained by the linux system.
These variables are used to define environment .
So it is called environment variables.
an environment is a area in memory where we can place
definitions of shell variables so that they are accessible from
the programs.
Some of the build in variables are
HOME,LOGNAME,PATH,MAIL,IFS,EXINIT,PS1,PS2,TERM.
Most read
6
USER DEFINED SHELL VARIABLES
These variables are created by the users with the following syntax,
<variable _name>=<value>
There must be space between either two sides of = sign.
Rules for naming shell variables:
The variables must begin with a letter or underscore character.
The remaining characters may be letters ,numbers or underscores.
No spaces are allowed on either side of the equal sign.
If the <value> contains blank spaces,t
hen it should be enclosed within double quotes.
Examples:$netpay=14000
Value 14000 is assigned to the variable netpay.
Most read
Shell variables
Build in shell variables
User defined shell variables
bhatvijetha
• If a sequence of commands is to be used repeatedly we
can assign them permanently in a file.
This file is called shell script.
• The shell script can be executed in two methods.
• One method using sh command.
• Another one is to grant executable permission to the file
using chmod command and then type the filename at the
prompt.
• General format is,
Sh [-v] <script_filename>
The –v option causes the shell to echo each
command before it is executed.
Command grouping:
General format is,
Command1;command;…
Where ; is the command seperator.
Shell variables
• There are two types :
• Build in shell variables
User defined shell variables
Build in shell variables:
These variables are created and maintained by the linux system.
These variables are used to define environment .
So it is called environment variables.
an environment is a area in memory where we can place
definitions of shell variables so that they are accessible from
the programs.
Some of the build in variables are
HOME,LOGNAME,PATH,MAIL,IFS,EXINIT,PS1,PS2,TERM.
USER DEFINED SHELL VARIABLES
These variables are created by the users with the following syntax,
<variable _name>=<value>
There must be space between either two sides of = sign.
Rules for naming shell variables:
The variables must begin with a letter or underscore character.
The remaining characters may be letters ,numbers or underscores.
No spaces are allowed on either side of the equal sign.
If the <value> contains blank spaces,t
hen it should be enclosed within double quotes.
Examples:$netpay=14000
Value 14000 is assigned to the variable netpay.
USER DEFINED SHELL VARIABLES
These variables are created by the users with the following syntax,
<variable _name>=<value>
There must be space between either two sides of = sign.
Rules for naming shell variables:
The variables must begin with a letter or underscore character.
The remaining characters may be letters ,numbers or underscores.
No spaces are allowed on either side of the equal sign.
If the <value> contains blank spaces,t
hen it should be enclosed within double quotes.
Examples:$netpay=14000
Value 14000 is assigned to the variable netpay.

More Related Content

What's hot (20)

Shell programming in ubuntu
Shell programming in ubuntuShell programming in ubuntu
Shell programming in ubuntu
baabtra.com - No. 1 supplier of quality freshers
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell script
root_fibo
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
jinal thakrar
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
Mohamed Abubakar Sittik A
 
Shell programming
Shell programmingShell programming
Shell programming
Moayad Moawiah
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
root_fibo
 
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
GauravRaikar3
 
Linux commands part -2
Linux commands part -2Linux commands part -2
Linux commands part -2
bhatvijetha
 
Bash shell
Bash shellBash shell
Bash shell
xylas121
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Unix shell scripting tutorial
Unix shell scripting tutorialUnix shell scripting tutorial
Unix shell scripting tutorial
Prof. Dr. K. Adisesha
 
Declaration merging | Typescript
Declaration merging | TypescriptDeclaration merging | Typescript
Declaration merging | Typescript
pcnmtutorials
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
Belal Arfa
 
BASH Guide Summary
BASH Guide SummaryBASH Guide Summary
BASH Guide Summary
Ohgyun Ahn
 
Unix - Filters/Editors
Unix - Filters/EditorsUnix - Filters/Editors
Unix - Filters/Editors
ananthimurugesan
 
Lecture1 3 shells
Lecture1 3 shellsLecture1 3 shells
Lecture1 3 shells
nghoanganh
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
root_fibo
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
Chandan Kumar Rana
 
Licão 09 variables and arrays v2
Licão 09 variables and arrays v2Licão 09 variables and arrays v2
Licão 09 variables and arrays v2
Acácio Oliveira
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell script
root_fibo
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
root_fibo
 
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
GauravRaikar3
 
Linux commands part -2
Linux commands part -2Linux commands part -2
Linux commands part -2
bhatvijetha
 
Bash shell
Bash shellBash shell
Bash shell
xylas121
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Declaration merging | Typescript
Declaration merging | TypescriptDeclaration merging | Typescript
Declaration merging | Typescript
pcnmtutorials
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
Belal Arfa
 
BASH Guide Summary
BASH Guide SummaryBASH Guide Summary
BASH Guide Summary
Ohgyun Ahn
 
Lecture1 3 shells
Lecture1 3 shellsLecture1 3 shells
Lecture1 3 shells
nghoanganh
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
root_fibo
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
Licão 09 variables and arrays v2
Licão 09 variables and arrays v2Licão 09 variables and arrays v2
Licão 09 variables and arrays v2
Acácio Oliveira
 

Similar to Shellvariables in Linux (20)

Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
primeteacher32
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bash
Shay Cohen
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
primeteacher32
 
Course 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment VariablesCourse 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment Variables
Ahmed El-Arabawy
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
Gaurav Shinde
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell Script
Amit Ghosh
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
Amit Ghosh
 
Introduction to shell scripting ____.ppt
Introduction to shell scripting ____.pptIntroduction to shell scripting ____.ppt
Introduction to shell scripting ____.ppt
nalinisamineni
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
Nihar Ranjan Paital
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.ppt
mugeshmsd5
 
Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)
Chitrakshi Jaiswal
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
Open Gurukul
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
Shell scripting1232232312312312312312312
Shell scripting1232232312312312312312312Shell scripting1232232312312312312312312
Shell scripting1232232312312312312312312
adnansalam11
 
Shell-Scripting-1.pdf
Shell-Scripting-1.pdfShell-Scripting-1.pdf
Shell-Scripting-1.pdf
aznabi
 
Licão 02 shell basics bash intro
Licão 02 shell basics bash introLicão 02 shell basics bash intro
Licão 02 shell basics bash intro
Acácio Oliveira
 
Spsl by sasidhar 3 unit
Spsl by sasidhar  3 unitSpsl by sasidhar  3 unit
Spsl by sasidhar 3 unit
Sasidhar Kothuru
 
Unixscripting
UnixscriptingUnixscripting
Unixscripting
Cesar Adolfo Balderas Guzman
 
(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial
jayaramprabhu
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
primeteacher32
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bash
Shay Cohen
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
primeteacher32
 
Course 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment VariablesCourse 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment Variables
Ahmed El-Arabawy
 
Shell & Shell Script
Shell & Shell ScriptShell & Shell Script
Shell & Shell Script
Amit Ghosh
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
Amit Ghosh
 
Introduction to shell scripting ____.ppt
Introduction to shell scripting ____.pptIntroduction to shell scripting ____.ppt
Introduction to shell scripting ____.ppt
nalinisamineni
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
Nihar Ranjan Paital
 
390aLecture05_12sp.ppt
390aLecture05_12sp.ppt390aLecture05_12sp.ppt
390aLecture05_12sp.ppt
mugeshmsd5
 
Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)Shell scripting - Basic (PART -1)
Shell scripting - Basic (PART -1)
Chitrakshi Jaiswal
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
Open Gurukul
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
Shell scripting1232232312312312312312312
Shell scripting1232232312312312312312312Shell scripting1232232312312312312312312
Shell scripting1232232312312312312312312
adnansalam11
 
Shell-Scripting-1.pdf
Shell-Scripting-1.pdfShell-Scripting-1.pdf
Shell-Scripting-1.pdf
aznabi
 
Licão 02 shell basics bash intro
Licão 02 shell basics bash introLicão 02 shell basics bash intro
Licão 02 shell basics bash intro
Acácio Oliveira
 
(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial(Ebook) linux shell scripting tutorial
(Ebook) linux shell scripting tutorial
jayaramprabhu
 

More from bhatvijetha (8)

LINUX:Control statements in shell programming
LINUX:Control statements in shell programmingLINUX:Control statements in shell programming
LINUX:Control statements in shell programming
bhatvijetha
 
Vi editor
Vi editorVi editor
Vi editor
bhatvijetha
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
bhatvijetha
 
Unix vs linux
Unix vs linuxUnix vs linux
Unix vs linux
bhatvijetha
 
Linux commands part4
Linux commands part4Linux commands part4
Linux commands part4
bhatvijetha
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3
bhatvijetha
 
Linux commands
Linux commandsLinux commands
Linux commands
bhatvijetha
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
bhatvijetha
 
LINUX:Control statements in shell programming
LINUX:Control statements in shell programmingLINUX:Control statements in shell programming
LINUX:Control statements in shell programming
bhatvijetha
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
bhatvijetha
 
Linux commands part4
Linux commands part4Linux commands part4
Linux commands part4
bhatvijetha
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3
bhatvijetha
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
bhatvijetha
 

Recently uploaded (20)

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
siemaillard
 
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ..."Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
Arshad Shaikh
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-25-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-25-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-25-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-25-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly WorkshopsLDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDM & Mia eStudios
 
General Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptxGeneral Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptx
fxbktvnp8b
 
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
 
Flower Identification Class-10 by Kushal Lamichhane.pdf
Flower Identification Class-10 by Kushal Lamichhane.pdfFlower Identification Class-10 by Kushal Lamichhane.pdf
Flower Identification Class-10 by Kushal Lamichhane.pdf
kushallamichhame
 
New syllabus entomology (Lession plan 121).pdf
New syllabus entomology (Lession plan 121).pdfNew syllabus entomology (Lession plan 121).pdf
New syllabus entomology (Lession plan 121).pdf
Arshad Shaikh
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptxQuiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
SouptikUkil
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Rajdeep Bavaliya
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
siemaillard
 
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ..."Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
Arshad Shaikh
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly WorkshopsLDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDM & Mia eStudios
 
General Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptxGeneral Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptx
fxbktvnp8b
 
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
 
Flower Identification Class-10 by Kushal Lamichhane.pdf
Flower Identification Class-10 by Kushal Lamichhane.pdfFlower Identification Class-10 by Kushal Lamichhane.pdf
Flower Identification Class-10 by Kushal Lamichhane.pdf
kushallamichhame
 
New syllabus entomology (Lession plan 121).pdf
New syllabus entomology (Lession plan 121).pdfNew syllabus entomology (Lession plan 121).pdf
New syllabus entomology (Lession plan 121).pdf
Arshad Shaikh
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptxQuiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
SouptikUkil
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Paper 110A | Shadows and Light: Exploring Expressionism in ‘The Cabinet of Dr...
Rajdeep Bavaliya
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 

Shellvariables in Linux

  • 1. Shell variables Build in shell variables User defined shell variables bhatvijetha
  • 2. • If a sequence of commands is to be used repeatedly we can assign them permanently in a file. This file is called shell script. • The shell script can be executed in two methods. • One method using sh command. • Another one is to grant executable permission to the file using chmod command and then type the filename at the prompt.
  • 3. • General format is, Sh [-v] <script_filename> The –v option causes the shell to echo each command before it is executed. Command grouping: General format is, Command1;command;… Where ; is the command seperator.
  • 4. Shell variables • There are two types : • Build in shell variables User defined shell variables Build in shell variables: These variables are created and maintained by the linux system. These variables are used to define environment . So it is called environment variables. an environment is a area in memory where we can place definitions of shell variables so that they are accessible from the programs. Some of the build in variables are HOME,LOGNAME,PATH,MAIL,IFS,EXINIT,PS1,PS2,TERM.
  • 5. USER DEFINED SHELL VARIABLES These variables are created by the users with the following syntax, <variable _name>=<value> There must be space between either two sides of = sign. Rules for naming shell variables: The variables must begin with a letter or underscore character. The remaining characters may be letters ,numbers or underscores. No spaces are allowed on either side of the equal sign. If the <value> contains blank spaces,t hen it should be enclosed within double quotes. Examples:$netpay=14000 Value 14000 is assigned to the variable netpay.
  • 6. USER DEFINED SHELL VARIABLES These variables are created by the users with the following syntax, <variable _name>=<value> There must be space between either two sides of = sign. Rules for naming shell variables: The variables must begin with a letter or underscore character. The remaining characters may be letters ,numbers or underscores. No spaces are allowed on either side of the equal sign. If the <value> contains blank spaces,t hen it should be enclosed within double quotes. Examples:$netpay=14000 Value 14000 is assigned to the variable netpay.