Progra

Mathematics7.27 KB

q linux prmita obtnr in pantaya, mdiantl ls, 1st list contnido dl dl dirctorio / root / examn,

where d ls nombrs arxiv notif qdn co +

ls-q-m / root / examn

linux list prmita q to2 ls dl dirctorio actuals subdirctorios

ls-l | grp ^ drwxr-x

linux spcificarl acr q ql c prmita sal sy sy x dfcto xal root.

xs-s / bin / cs

/ bin / bas
clar
if tst-f $ 1
tn
if tst-d $ 2
tn
ls $ 2 | grp-w $ 1
if tst $? -eq 0
tn
exo-e $ 1 exist enl arxiv dirctorio $ 2 \ n
els
cp $ 1 $ 2
fi
els
exo-and dirctorio not valid \ n
exit
fi
els
exo-and arxiv not valid \ n
exit
fi

+ corxal preferentially to

awk program, yamado listado_imc prmita ache and gnrarl list arxiv prsnas.Dat d prsnas with imc

xa valors 24.99l notif 18.5 and s considrado normal.L imc imc imc cm = s estimated pso / (stature) 2.


bgin (fs = #; ofs = \ t;
imc print list d normal;
Print Name imc)
(
imc = $ 2 / ($ 3 * $ 3)
if (BMI> = 18.5 & & imc <= 24.99)
printf%-s \ t% 2.2f \ n, $ 1, imc
Ejcuta) s listado_imc prsnas.Dat awk-f

/ usr / local / bin: / bin: / usr / bin:.if tngo 1 command yamado current list dirctorio enl

another the same way yamado enl d dirctorio / usr / bin "which srial slccionado to prompt ejcutar enl simplmnt list?

s ejcutarial dl dirctorio list command / usr / bin, pusl dirctorio current (.) dspus aparc q / usr / bin enl pat

q 1 s script riting prmita rcibir cm 2 arxiv argumntos, l ls q validate db script xamtros rcibi2 ql san and Primroses ralmnt arxiv arxiv (arXiv d entry) since no sta argumnto cm vacuum, then save enl dbra another arxiv (arXiv d output) , ls globulins ltra cualkier begin with q (lowercase or uppercase) dl d arxiv entry.

/ bin / bas
clar
if tst-s $ 1
tn
if tst-f $ 2
tn
grp ^ [a-zA-Z] $ 1>> $ 2
els
exo-e $ 1: arXiv not valid \ n
exit
fi
els
exo-and arxiv $ 1 does not exist or empty sta \ n
exit
fi

q prmita linux find and delete without confirmation, to2 ls arxiv rgulars empty, which begin with the ltra nombrs to find yqs enl dirctorio / root / examn.

find / root / a * examn-nam-siz 0-typ f-exec rm-f () \;

1 CRARA arXiv, palabras.Txt, q the 1st word other than x contnga each lina. Q linux spcificarl whip extract prmita arxivwords.Txt all words ls q trminn with empiecn and vowel (lowercase or uppercase).

s db CRARA palabras.Txt with cualkier editor
grp ^ [aeiouaeiou] palabras.Txt | grp [aeiouaeiou] $> words.Txt

linux spcificarl q q prmita crarl alias list prmita clean pantaya, ponr fxa and pray the day in Linas sxadas dl, and list prmisos d to2 ls ls dl dirctorio arxiv.

alias list = clar; dat +% d% n% t; ls-al

using piping, q linux prmita scribal quantity d arxiv obtnr regular (or arxiv rgulars) q dl existn dntro current d dirctorio work.

ls-l | grp ^ - | wc-l







yamado notas_curso arxiv where q ls fields are each rgistro sn: name, student-student apyido, Primroses-note sgunda-note-note trcra. caractr l has at arxiv, cm dlimitador d field, so x ejmplo, l arxivls TNR could notas_curso data:

juan, prz, 3.5,4.7,5.3
Pauline fabrs, 2.5,4.7,3.4

Scribe 1 awk program, yamado listado_aproba2, q 1 listing in prmita show pantaya students aproba2 d ls (q promdio greater than or equal 4.0). L dbra tnrl list format:

d aproba2 listing
apyidonombrpromdio

bgin (fs =,; ofs = \ t;
d aproba2 print list;
print) apyido notic promdio
(
promdio = ($ 3 + $ 4 + $ 5) / 3
if (avg> = 4.0)
printf%-s \ t%-s \ t% 1.1f \ n, $ 2, $ 1, avg
)

ejcucion dbria the sr: awk-f listado_aproba2 notas_curso

linux ls q coman2 to fix ls prmitan ambient ADCU variabls d d d Istor so ql coman2 and now includes fxa ejcucion d d coman2 ls and ls Istor dl sliminn duplicate entries in arxiv todol Istor d dl coman2, rspctivamnt.

ls simply change variabls isttimformat and enl istcontrol arXiv. Bas_profil users d ls, x ejmplo:

exxt isttimformat =% f% t
exxt istcontrol = erasdups

scriba 1 s script, yamado mostrar_linas, q prmita, mdiantl use d wil, Linas ls not show all empty, along with the zoom lina numro d, d 1 arxiv cualkiera dsd tclado lido.

/ bin / bas
clar
exo-and arXiv: \ c
rad arxiv
i = 1
rad wil lin
do
if tst! $ lin =
tn
exo-e $ i \ t $ lin
i = $ (exo $ i +1 | bc)
fi
don <$ arxiv

considr the 1st emprsa, incorporated and headquartered x 3 sucursals. Dbi2 to the conxion probl + ls dsd sa parent sucursals to DCID constantmnt tstar dirccions ip d ls dixas sucursals.
scriba 1 s script, yamado tstip, Q 1 arxiv prmitalaborar evidence log with ls dsd d conctividad parent all sucursals ls. Ls d conctividad s ised tests every 5 minutes day ls and 24 ls dl pray rsulta2 dbran guardars enl tstip_sucursals.Log arxiv, along with the fxa and pray d d conctividad ised test. Ls d ls dirccions ip sucursals dbran provrs the script in 1 s arxiv named sra said last cm argumnto a script and format of which the 1st dirccion s simplmnt ip (the qs will tstar) in each dl lina arXiv.

/ bin / bas
clar
wil true
do
for ip in $ (cat $ 1)
do
exo-and +--------------------------------+>> tstip_sucursals.Log
dat +% d% t% t>> tstip_sucursals.Log
ping-c 3 $ ip>> tstip_sucursals.Log
Don
slp 300
Don



Download

PDF Word HTML