0% found this document useful (0 votes)
3 views8 pages

Essential Shell Programming Concepts

The document provides an overview of UNIX shell programming, covering essential concepts such as shell types, variables, control structures, input/output, and functions. It emphasizes the importance of modular scripts, error handling, and best practices in shell scripting. Additionally, it discusses ASCII character encoding and variable types, including local and global variables.

Uploaded by

ak07.abhi80
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Essential Shell Programming Concepts

The document provides an overview of UNIX shell programming, covering essential concepts such as shell types, variables, control structures, input/output, and functions. It emphasizes the importance of modular scripts, error handling, and best practices in shell scripting. Additionally, it discusses ASCII character encoding and variable types, including local and global variables.

Uploaded by

ak07.abhi80
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

V:bhre Shama

BCA M Yer
-8 em - 132
UNIX
Aignmut-4
Sll Pngrammig
lautomatk Aaki?, handl syaten adhinistaho
and create Custon tools Hefe an in- depth
Jok at eah esential Conept in Bhellprgmmy
2Shell Baics
"Shell Types Camnn typeo inla Peng
torung Shell lch),
Cshelch, Kon hell Lkehland Baune
Ayan Shel (bash ).

Comma
Lin intoae cotee
brecution -Shel suips ane bhin tet les ath
(emnYnda. hey Can be Dexeated ?ciety in

2 Variahles
VAR--NAME Value,
Vbriables: Vse be<ore the vaniable nae t
Qces it eg VAR-NAME
6nviement VS. oal Variable 2- Envionmut yariakley
(ike PATH, HOME)
glatay avlable to al kenitng, whik loal Vaniahle
speaf. t he cunzent shell Benien.
baporting aniable To make a aniable an.
eNiemment yaniable,lae cxpnt
Command Sub stiian i-Cagtue the outpt ommànde
NaniabAea, uaing aynk ie

3ontrs! Struetue
.onditonal Statomeati l a , cle syeistanut
Lgicl operatars - Uket,ne, -at,-,
Compausng
hile, lasp-Kepeat ao lony
"for lopp Ttnat bver a list iten

4 Tnpt and Outot


Stondard In put (Stdin), dpt stlotond bnor lse
Jtdiectiom
fipesi Uoe |to pus the output one lomand inp
to onohn. Camend 1|Conmand
Hoe Domerta i- uo qor mult Aine input edin ton
5Functing
Dining Funtions: Fundiam allo rouping
"Ci Funtiensi all a funeton by iti e
Manipudstior Fik 9
text. palintenn ferseanh toUocd gre-p
irdng,nd ~anhiy or
editor stem Aed-A "
tut ered daryagpzgvamming data andaukrA
A
Utilites Poeding Text 8
code. eit Cuslorn
wiath ipt aext toexit Use Codes Custemxit
t he&ucen Command
.fila$?-o1;
then heWeity Use Codes
to- "heking
Eit
nitans Codestvery,
e;D faiwneexit meansnon-2exo >ndsuues,lom means Fut
an
dlig Hon ErTor and Statuy 1Eat
lt anauemeht ang
umh Numben $#: Vataklel; Special
eplesenti uipt. a topoed
-sl.$2
et Panametens Positien
Aguenent 6Command
Line al
$12te' uith
Cat,eche,and >or» to creat Xwite ty ile
Fle Testt -Usef,d, e , , w,x tut

brable Deb4giny Aiptnam


i Kun Sauipts aith bosh
[Link] or add ketx at y.
Ertr Hahdling with trnp : Use tap to Cagtoa sign
lke Sl6 INI •nd S1GTERM'

NShell Scriphing Best Raties


Use emment - se t* to explain cede legic
Modular Seripts -Break dan scrtts into ftin' e Yeuwalih

Ialetation keadaiiyMuntainy Conlitnt indentatin


Jarmuttiy
wht AS CI) Vales in UNIX
In UNZ ofhot Eytms,ASCIl Anuión Stande
or Inemolirm Titeahange)vabu sepxescnt chea ten
as nuheial codes. ASCIL aEfines 128
chanaen Whiqe Codea ar
indading
Ctrl Chanaeteo-3|&I2) Nenintable
chara tens uaed dor cotod
ike NULL BELbel),LF CJinu e)t
2. Rintale Choastons (32- 1261dtXs
,dyita, pund
For instance, in AscII
The tten A, hes ASCI vabe 65,
Qn
"The etter 'a' hah n ASCIl value y 37.
he cligit 0' has dn ASCI| Vabe
the
echoe Commnd in UNIX to
yie
BA,hanalen's AScn val oy lanvent

AsÇ Rang%
OStardod Ascil
32: Spae o-3|:ntra Chaatey Non Pritale
33-47: Special chaMatory (eg",# te)
-57: Numenjc diqita C0-92
58-61: More Speio Chantesleg ?
65-90; Ppen Cane Engish lettns LA-Z
31-36 Spual Chaoters( cg E1,2, te)
97-122 :
23-126: own
SpecialCoe Engish, Lethng (a3,
hanatenl
T3)
laed în ouy enoding systerns to xeprexnt additol
chuactes indading OActnted letes
9
OMath emshtal Symbob
Graphic Chona ea.
Q3 what do yoy men by Vaniabl, hamaieg&,heh,
chanactens, alphanumerie ,77namenic , Contoto,acal
Vaniables

Nariluadle daedig
name' Cilehie). "Kodagn",ye "20
ndme

2) Chooc Chanoterd aeSingle ymbeo


Stered asvalugASCEo nivode
y5), ' Specid
rinmin
rprnaéntatioy
repruántatin chanactoy
:AAScll
ACAscIlvalue 45) chanauten). thande

3) Neta Choractona Mota Chanateng ane_primany nd in


ngulan expresins r piten mtehig.
don't Teatsent Uhamaeles but aclf ad Cammpnd.
Mabhes ony chanaten exteçt o neuline).
NMathu He stort g sing
9 AlefarumeNi - Alghanumesie chaacter conbine htnyk
gr Kuchiz3,bc8tn cxclude Bpeual chanattos

5Numeric Numeic Teluy strictly to nun bers . 3t can


incade Qnter iteg u, decimab in som
lContent, ncgafive numbur or ient1fc netahien.
eg numl=42, um2 -3.1+
)Censtonts - Constont ane vauables whese yaues de nat
ocal YriableiHu decared inside a unhan
ist ony witin Hhe unchan' ape and
Connot be accened outside the ehtin
2Global Vaable < It in dedaned ataide
ntion or blacks and con be aueneA
and madifud anyuhne in te fragram

You might also like