Adobe Scan 28 Oct 2022
Adobe Scan 28 Oct 2022
Cat7 frle.tat
another fPle
Cat -Faleltat 77ftlea.tat
Date Cofnand
Comnand to display Cument date ad time
date
LST
$date -
UTC
Moo 06 Dec 2022 Ol:1822 p
date optto
$ date date o6|12|a0a2
Am 1ST
IST
2:00:00
Oudput: Sat l& Tun 2022
Man Command
man commAND NAMEJ
man prfott
9) man SECTIONNumJfCommAND NAME
man 2
CYP COLrc
Page No.
lbrartes
Statc 19brary
gedt ad doun.
10t addoum Ctnt a, 19t )
Tetu at
gedrt Suboum. G
Tetuno -Y
gedrt uM.b
Matn fundto)
gedrt addsub-c
rndadecstdto.h 7
90-t mai0 ()
9nt a20,b-5
addnum (a, 6));
prvot+ (Ad detto0: l- d
1o",
Co mmands
C
c c Wall -O addnum.c
Subnum.
a y ay CVOy myleb-a 0
lad4sub
Addrttoo: 25
Subtrattun: IS
Page No.
Shased brary
gedrt even.c
Votd even (nt a)
94 (a-a-= 0)
gedt odd.
Votd add Cot a)
(ael.-0
prietf ("odd number 1-d) a)
gedt header h
Vord eNen(ot a)
Votd odd (ot
a)
qedt evenodd.c
+ndude stdro.h7
ftndudeheader.h
90t madOC)
CVR COLLEGE OF
ENGINEERING
Vastunagar, Mangalpalli (V) lbrahimpatan (M), R.R. Dist. Ph - 501 510
Vastunagar, Mangalpalli (V) lbrahimpatan
(M), R.R. Dist. Ph - 501 ran
Page
even (a)
odda)
Tetumo 0
Commands odd.c
ewen.c
cc -shared -o Ibcalu,so *0 y o u t
lall -0 yo
cc-K/home/ewr
cvz/shared lebrary|-
eNenodd.C-lcalau
-Tpath
e
Ihome |Cv7
-Wl,
Itbrany |
A Ihomefcvr [shared
7 ewenodd-c
-lcalcu
myouti
Output
Enter a
S
odd umber:5
P a g eN o .
utilPty
Sample proje ct busldng wtth Make
Tead 10put.C
#Hodude <stdto.h7
Hocdude <unistd-hz
ndude header.b
Vot d Sead Cnt a)
user 1s d 1)
from
PrYotf ( T6e value of 2
Khtte-0utput. c
dFrodade <stdto.hz
rodude header.h
vofd belloc)
Prfotf (I am t Otte-oudput")
ProceSs-C
rodude <stdro.h7
rodude 'header.h
Vo9d process ()
Priotf ( t am 10 process \n")
CVR COLLEGE OF
ENGINEERING
Vastunagar, Mangalpalli (V) Ibrahimpatan
(M), R.R. Dist n
Page
Maln. C
odu de rstd ?o.b7
PO dude beader.h
9t afC)
99t a
PT?otf ( Enter any numb er:")
ScanfC-1d, a )
read (a)5
bell o C)
Process C)5
retuo O
header.b
Vor d belloc)
Vord Tead C10t
Vord ProcessC)
Vastunagar,
Page No
Tead 90 put .0
9cc-C 1ead-input.
1te-Output.0
gcc-c klrtte_ output.
Process.0:
gCc - ProcesS.
Maf0.0
4CC-C Main.
dean
.0 PTOCes s
eh o
frles are Temoved
ake
process
Output
ter any Oumber lo
he value of a from usen 15 10
I am 40
Tead put
T an tO
procesS
Iam 90 kotte Output
CVR COLLEGE OF
Vastunagar, Mangalpalli (V)
vastunagar, Mangalpalli (
ENGINEERING
lbrahimpatan (M), R.R. Dist.
l Ph
PageN
SCripts
and Ank sample
tTWK Command
avq-Monks.aw b
BEGIN
Fs "H
Count-0
total- 0 student
morks of each
prttt("Avq
Det
1<NPS 1r+)
fol 1-a;
-total-manks + fi
total- marks
prmtf($
totale total + total-manks
Count- ountt
END
dass axq-total/Count
CVRCOLLEGE OF ENGINEERING
Vastunagar, Mangalpali (V)
lbranimpatan (M), R.R. Dist. Ph -501 510
PageNo.1
Marks-tt
1201 lo 20 30 4-0 SO
120 2 20 40 so 60 0
1203 20 3o 60
1204 SO 60
Ouctput
awk avq-marhs awb maksrta
Avq
tVg marks of each stud ent
1201 16-6667
1202 42.65
1203 82-S
12-04 96
Cass-awg 30a.s
CVR COurc.
Page NO
numbers uPng
usPn
Baste shell Sortpting Proqrams numbers
two
to
add
APOua shell Scspt proqa
Command lene aquments
H bro 1basb
Iene-add.sh
Command-
name
PToqram num
bers
be
to add
#shell Sorrpt proqram
Sum apr t 42
sum
ech o sum ts
outpud
1520
$sh Comm and-Ieoed- add-sh
Sum PS:35
numbers
tuwo
program
to Swap
Soript
A n u a shel
# / beolbash
proqran name Swap.sh
two numberS
to Shwap
#shell Srtpt progqram
Ouum)=l
Duma-20
501 510
PageNo.
Oum- num2
Duma- num3
echo After Swapprng
echo Numi num
echo Num2: num
Output
sh Swap.sh
Befose Swappng
Nunl: 0
Num2 20
Aftr Snapprng
Num: 90
Numa : 10
întegers nd
to Tead two
POua shell Sortptt proqam
Preot the Subtractton
#/bo/bash
pTogam name Reader.Sh
Tead num
CVR COLLEGE OF ENGINEERING
Vastunagar, Mangalpalli (V) brahimpatan (M), R.R. Dist. Ph - 501 510
Pa
Sub bratfon fs 10
CVR COLLEGE OF
Vastunagar, Mangalpalli (V) IhrahimnaENGINEERING
Page No.
tall,
Shl frtters Cut, qrep,head,
ptn9 ustng
)Cut. sh
# /brofbash
Cuct note t a t
-b 1,3,3.4t
echo
Cat 7 Dotetat
Hello
oel Come to
CNR Colleqe
Outpur
bash Cut.sh
Hllo
Nlc
CNR
9Tep.sh
#1/beo/bash
rep T 9Tep.tt
echo
9nep ft rep.tat
echo
Cat 7 9Tep.tut
head.
#+1/bvo/hash
echoHead rs
bead-3 netetzt
echo
Output
ttead s
telo
hued Cone to
CVR Clle
turl.sh
AL /ben /bash
ccho 7Tall 15:
ootertat
tasl
eho
output
Tall s
Nellome to
output
bash abc.sh
N
mor C-(90-1.)
Page System C al
C a l1ls
s
System
ustng
plemeat Commands
i9 C the followin g Untn
aCat b) Cp cwc
a Ca Command uctng Systen all
todude <stdro.h7
10dude sys/types h
rndude <sysl stat.h7
t fndude <funtl .h7
indude <untstd.h7
7Dt mato (10tt argc char targ vl3J) i
10t fd1,
chor bufla]
td- opeo (argvli], 0-RDONLy,0777)
t (td- -angc)?
else
ohrle (C1e Tead (td. buf. )) 7o)}
prtotf (/c', butlo])
dose(td)
etun 0j
doseCF4)
doseLfda)s
Teus 0
Copy aa yoy
CVR COLLEGE OF
ENGINEERING
Vastunagar, Mangal pali (V) lbranimpatan (M), R.R. Dist. Ph -501
510
Page
8
Commang
cto 9mplement ls -L frlename
todude <stdi o.h7
todude <drrent.b7
9odude <stri0g.b7
10cude <emoo.h
ndude <std]tb.h7
90t mao (nt ar 9e, thay t
angvl )1
DIR dr
Struet drent * sd
dosederCdrr)
Tehuno 0
10sys
77my 77M0
77 tent t t lssys
77 Out 77 myoudput
cess
te a C
program to a) reate Zombre
b)To avord Zombte state ef a proceSS
Pr-getprdd)
Pritot-+Cmy process Pd 15 dlo' prd)
PTtottC About to Create chrld process|n
sete fovk )
+Cetco1{
pemorfork)
9F(Tel -c0)1
CVR COLLEGE OF
ENGINEERING
Vastunagar, Mangalpali (V) lbrahimpatan (M), R.R. Dist. Ph -501 510
Page N0.
se t(red ro)i
In, qdprd)
PrPOHC I am parant Process. Myprde 1-d
rdumed me: -1d nTa)
am parent fonk
fo (-0j<1ogj+7)
sleept0%
printtC porent J:-/d 3)
Catt (EAT -SUCCESs)
PvtotfCommoo Code);
e t (ENT SUCCESs)
CVR COLLEGE OF
Vastunagar, Mangalpalli (V) ENGINEERING
lbrahimpatan (M
b) To
avotd Zombse 6tate o Pro Cesss
#o dude <std?o.h7
9odude <stdltb.b7
todude cun1std-h7
ndude <sys) oatt.h
T0t Mato (rot arge, char tarqv 1)
staned 9ot prd
totset,1,f
Prd- get prd 0)%
Tt etorkt0%
pem or forlh )%
PF(set- =0)?
0
process, myprdo
-fpdio", gdpid
Pvotf( am thild
me t |d \o'set)
am chrld ferk Tehunned
PTrhtt (I
3
fen (f-03 1< St1+t)
9)3
Pt9t+ (hrld 1:-1d lo"
Caft (EXIT SUCCESs)
501 510
Page VU.
qdpfd))
PTot-+(I am Process, myprde d.d\o,
Panent rd)
Ta
PTPot+ (L /.4\0
Daxent foh Tetung ed
me:
am
wat (4 status)
T (WIFEXITED(Stadu s))3
PrPot+ (hild prd---4tepoated', Tet) xITS T A T U S( s t a t u s ) )
fo Cj-07 j<s]+t)}
Protf (ponent J - d\n'. f)%
Oupu
57)
W PrbCeSS 1d 9
chsld 10
CVR COLLEGE OF
Vastunag1 lli (00 ENGINEERING
dald t:
chrld 1:3
Cheld 3 Status ts 0
sttus
chyl4 14 chrlds
chrlds
erl
a579
temmated
Chrld prd-
Paxent J: 0
PanentJ1
Panent J:?
Ponent 1:3
Panent J