Sie sind auf Seite 1von 20

BASIC MO COMMANDS mom[tc] Print description of MO classes, CM/FM attrib tes, actions , en ms and str cts!

lt/ltc["#$] %oad MO tree &f ll or partial' and b ild pro() table! lc["#$]/lcc %oad MO tree &f ll or partial' and b ild pro() table! pr/lpr Print MO %DNs and pro() ids for all or part of t*e MO tree c rrentl) loaded in mos*ell! ma/lma Add MO&s' to an MO +ro p! mr/lmr ,emo-e an MO +ro p or remo-e MOs from an MO +ro p &MOs .il l NO/ be deleted, onl) t*e +ro p'! mp Print all defined MO +ro ps! +et/l+et ,ead CM/FM attrib te&s' from MO&s'! *+et[c]/l*+et[c] ,ead CM/FM attrib te&s' from MO&s', print *ori0ontall) one line per MO &instead of one line per attrib te'! 1+et/l1+et Displa) CM/FM attrib tes in e(portable printo t format! fro/lfro[m] ,ead MAO data of an MO and/or froid of t*e MO! Data read f rom s2l table modata3r4 instead of -ia MO ser-ice! st/lst Print state of MOs &operationalState and administrati-eSta te .*en applicable'! prod Print prod ctData of MO&s'! l1/ll1 5ie. all MO6s lin1ed to an MO, and t*eir states &admState and opState'! l1o/ll1o /*e old l1! Messier t*an l1 b t s pports a .ider ran+e of MO classes! set[m]/lset[m] Set an attrib te -al e on one or se-eral MO6s! rset/lrset Set attrib te -al e on a restricted attrib te or c*an+e t* OFF%IN78 bl[s]/lbl[s] %oc1 or soft#loc1 MO&s'! deb/ldeb 9nloc1 MO&s'! acl/lacl %ists a-ailable MO actions! acc/lacc 7(ec te an MO action! cr Create an MO! del/ldel Delete MO&s'! rdel/lrdel Delete MO&s' to+et*er .it* c*ildren and reser-in+ MOs! :[s]/ #/ ;/ < =andlin+ of ndo mode &for ndo of del/rdel/set commands'! Can be sed for +eneration of MO scripts as .ell! r n , n a command file in mos*ell format! tr n[i] , n a command file in 7MAS/Mo/ester format! ctrl#0 Abort an MO command or a >for> loop! /)pe >to c* /tmp/?f+> to res me t*e mos*ell session! pol[s] Poll t*e node ntil t*e CM ser-ice is p! re[i] Disconnect and reconnect to t*e CM ser-ice &mobro.ser' and /or t*e PM ser-ice &pmtester'! +etmom C*ec1 t*e MOM -ersion c rrentl) stored on t*e node! parsemom Parse an (ml MOM file! flt/fltc %oad pro()s for an MO t)pe t*at is not defined in t*e MOM! &>Force> lt/ltc'! ld %oad one MO from t*e tree and add to t*e pro() table! f+et/lf+et ,ead attrib tes t*at are not described in t*e MOM &>Force> +et'!

s+et/ls+et +et'! fset/lfset &>Force> set'! facc/lfacc &>Force> a ction'! O/=7, MO COMMANDS

,ead CM/FM attrib tes from MO&s', one b) one &>Slo.> Set an attrib te t*at is not described in t*e MOM Perform actions t*at are not defined in t*e MOM

c-ls/c-m1/c-ms/c-set/c-rm/c-c /c-ls" Confi+ ration5ersion &C5' *andlin+! in-[*r] Complete =@/S@ in-entor)! Incl des information abo t ,P9s, licensin+, A5M, de-ices, BPs, etc! cab[sl(rad+tm] Displa) of miscellaneo s CO%I printo ts relatin+ to *., s. , restarts, leds, cp load, errors, dis1/ram sa+e stc[p][r] Displa) state and confi+ ration of AtmCrossConnections! std Displa) state and confi+ ration of de-ices &,NC and MC@ on l)'! st-[b][r] Displa) state, ser, and band.idt* sa+e for A/M ports and c*annels! stt[r] Displa) state and ser of P*)sical Ports and DsDB ndles! *c , n a +eneral *ealt*c*ec1 on t*e node! diff/ldiff Parameter a ditin+ or MO d mp comparisons! str["4ft] Print stat s of t*e I b%in1s/Abis%in1s and t*eir associate d Cells and C*annels &,NC/BSC onl)'! l1i ,eso rce sa+e and confi+ ration of I b%in1s &,NC onl)'! remod[ ][4] ,emod le an I b%in1 &,NC onl)'! t+[r][c][d] Print ,eso rce ObEect information for all MOs in %mCell &, NC onl)'! er Print 97 conte(t data for all acti-e calls &,NC onl)'! al[at1] Print t*e list of acti-e alarms! l+[ae-smircd) ol*] Fetc*in+ and processin+ of lo+s &alarm, e-ent, a-ailabilit ), s)stem, etc' O/=7, COMMANDS Print or c*an+e mos*ell confi+ ration settin+s &also calle d > ser -ariables>'! pPrint scriptin+ -ariables! </l 7(ec te a ni( command on t*e PC/.or1station! l:[m][m][s][o]/l#/l; Open/close mos*ell lo+files! ose/coli command Send a CO%I command to t*e node6s OS7 s*ell! /)pe >* ose> for s)nta( *elp and >;> to -ie. a-ailable commands! bo[r]/ba[s.dp]/br[.d]/bp Mana+e board +ro ps t*at can be sed for r nnin+ CO%I commands on m ltiple boards! l* , n CO%I commands on all boards of a board +ro p! mon/mon:/mon#/mon; Start/stop/c*ec1 t*e tar+et monitor ser-er on t*e node and /or start t*e monitor client for one or more board Cro p&s'! s2l:/s2l#/s2l; Start/stop/c*ec1 t*e SF% client on t*e node

&CBC"G4HIDJ'! p+ [c][f] %Ms! ftree to >ls #l,> in ni('! ft+et[c]/ftp t[c] ftp!

Pro+ram 9p+rade! For S/P

se onl), e+, to load blac1

,ec rsi-e listin+ on t*e node6s file s)stem &e2 i-alent /ransfer files or directories to/from t*e node, sin+

*t+et /ransfer files from t*e node sin+ *ttp! edit 7dit a file on t*e node! fclean[fKffKdKe] ,emo-al of obsolete loadmod les O, rec rsi-e remo-al of a director) on t*e node! *i Print *istor) of mos*ell commands entered d rin+ t*e c rre nt session! lmid[c] Print translation of loadmod le prod ct n mber or /L7 erro r codes! p/./p./b C*an+e mos*ell prompt and/or .indo. title! pro( /o++le displa) of pro() identities in printo t of +et command! col /o++le displa) of colors! l /o++le displa) of serlabel in st/lst and p+et/lp+et print o t! conf[bld] /o++le confirmation on -ario s MO commands! +s/+s+ /o++le displa) of old/ne. attrib te -al e in set/bl/deb co mmands! ip4d/d4ip Con-ert an IP address into t*e format sed in t*e f,O &s2l database' or -ice#-ersa! *4d/d4* Con-ert an inte+er to *e(adecimal or -ice-ersa! *4b/b4* Con-ert a binar) to *e(adecimal or -ice-ersa! .ait Specif) a dela) in *rs, mins, secs, or rops! Similar to t* e ni( >sleep> command &scriptin+'! ret rn 7(it from a command file .it*o t e(itin+ from mos*ell &scr iptin+'! print Print a line or -ariable &scriptin+'! alias/ nalias Print or define command aliases! 2/b)/e(it/2 it 7(it mos*ell! PM COMMANDS pmom[ac]/lmom[c] Print description of PM co nters &pmom' or lo+ attrib tes &lmom, CDMA onl)'! p+et/lp+et ,ead PM attrib te&s' from MO&s'! *p+et[c]/l*p+et[c] ,ead PM attrib te&s' from MO&s', print *ori0ontall) one li ne per MO &instead of one line per attrib te'! pdiff/lpdiff Print incrementation of PM attrib tes! pm([*fdn] Displa) co nter -al es, e(tracted from t*e statistics ,OP files! pmr[a+] Prod ce PM MPI reports, based on co nter -al es in statist ics ,OP files and form las in CPI doc mentation! pme[fd][c+ ] Fetc*/decode e-ent ,OP files &,NC/,BS onl)'! pst %ist all PM scanners and t*eir state! p+ets[n] Print scanner contents! pcr[cfd]/lpcr[cfd] Create a statistics scanner!

pbl pdeb pdel emom e-ent#ba sed scanner! pset[d] onl)'! =7%P C=AP/7,S D " 4 G N H I O J $ /)peP # * # *

S spend a scanner! ,es me a scanner! Delete a scanner! Displa) list of e-ents a-ailable for eac* 1ind of Set t*e contents of an e-ent#based scanner &,NC/,BS

Installation, sec rit), and ser settin+s ,e-ision =istor) / torial Command s)nta(, re+ lar e(pressions Command descriptions %a0) Scriptin+ 9tilities Ser-er Maintenance Offline Mode to -ie. command description, e!+P * p+et to -ie. a c*apter, e!+P * G

Command s)nta(, re+ lar e(pressions

G!"# =o. MOs are identified # ,DN &,elati-e Distin+ is*ed Name' /*is is sed to identif) an MO in relation to its nearest parent in t*e MO tree! /*e ,DN contains MO Class &also called MO /)pe', t*e e2 al si+n, and MO identit)! 7(ampleP AtmPortQMS#4N#" QQQ8 >AtmPort> is t*e MO Class, >MS#4N#"> is t*e identit) # %DN &%ocal Distin+ ised Name' /*is is sed to ni2 el) identif) an MO .it*in a node! /*e %DN s*o.s t*e *ierarc*) abo-e t*e MO, .it*in t*e Mana+ed 7lement6s MO tree! 7(ampleP Mana+ed7lementQ",/ransportNet.or1Q",AtmPortQMS#4N#" # FDN &F ll Distin+ is*ed Name' /*is is sed to ni2 el) identif) an MO .it*in a net.or1 & sed b) ,ANOS/CNOSS'! 7(ampleP S bNet.or1QA9S,S bNet.or1Q=4,C3D4D",MeConte(tQSt3%eonards3Station34DIHD"D,Man a+ed7lementQ",/ransportNet.or1Q",AtmPortQMS#4N#" G!4# =o. to address t*e MOs in MO#related commands /*e first ar+ ment in t*e MO#related commands is s all) sed to specif) t*e MOs t*at s*o ld be affected b) t*e command! Si( .a)s can be sed to specif) t*e MO&s'P "' all QQQ8 all MOs in t*e pro() table .ill be affected 7(ampleP +et all serlabel QQQQ8 +et attrib te >9ser%abel> on all MOs NoteP instead of >all>, it is also possible a .ildcard s c* as >!> or >R>! /*is *as t*e same effect! 4' pro() id&s'

QQQ8 MO&s' .it* t*e +i-en pro() id&s' .ill be affected! /o specif) se-eral MO pro(ies, t*ere are t.o .a)sP # Specif) eac* pro() id .it* a space in bet.een 7(ampleP pr D 4 H QQQ8 print MO pro(ies D, 4, and H # Ci-e a ran+e 7(ampleP pr N#"D QQQ8 print MO pro(ies from N to "D pr "D#N QQQ8 print MO pro(ies from "D to N &re-erse order, deletin+ MOs' acc "D#4D restart QQQQ8 restart MOs .it* pro() "D to 4D G' lin1 *andler &for pl +in nit and spm MOs onl)' 7(ampleP acc DD"NDD restart QQQQ8 to restart t*e MO S brac1QMS,SlotQ"N,Pl +In9nitQ" bl DD"$DD/spD!ln* QQQQ8 to loc1 t*e spm S brac1QMS,SlotQ"$,Pl +In9nitQ",Sp Q",SpmQ"

sef l for

N' mo +ro p QQQ8 MO&s' belon+in+ to t*e +i-en MO +ro p .ill be operated pon! MO +ro ps can be created sin+ t*e commands ma/lma and mr/lmr, as .ell as *+et/l*+et, l1/ll1, st/lst! See command description for t*ese commands! NoteP In ,NC, r nnin+ t*e >bo> command .ill a tomaticall) create a n mber of MO +ro ps containin+ t*e cc/dc/pdr de-ice MOs for eac* mod le! H' board +ro p QQQ8 MOs &Pl +In9nit or Spm' mapped onto t*e boards belon+in+ to t*e +i-en board +ro p .ill be operated pon! 7(ample"P ba. sccp sccp QQQQ8 all boards .it* t*e s.allocation matc*in+ >sccp> .ill +o into t*e board +ro p >sccp> bl sccp QQQQ8 all Pl +In9nit or Spm MOs connected to boards of t*is board +ro p .ill be loc1ed 7(ample4PIn ,NC, sin+ t*e defa lt board +ro ps created after r nnin+ t*e bo commandP acc mod"D restart pr dc"D acc dc"D restart &t*e board +ro p dc"D is mapped onto t*e Spm MOs' bl dc"Dde&in t*is case .e are sin+ t*e MO +ro p containin+ t*e De-ice MOs, see para+rap* N! abo-e' I' mo#filter QQQ8 MO&s' .*ose %DN/,DN matc* t*e pattern .ill be operated pon! If t*e command starts .it* >l> t*en t*e pattern .ill matc* a+ains t*e %DN! If t*e command doesn6t start .it* >l>, t*en t*e pattern .ill matc* a+ainst t*e ,DN! 7(ampleP Q8Q8 pr ms#4N#" ret rnsP /ransportNet.or1Q",AtmPortQMS#4N#" Q8Q8 lpr ms#4N#" ret rnsP /ransportNet.or1Q",AtmPortQMS#4N#" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cG4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGG /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGGO /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGG4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGN /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGH /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cND /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cIN @*en sin+ t*e mo#filter, it is a +ood idea to test t*e pattern .it* >pr/lpr> command before iss in+ a +et/set/acc/cr/del command, in order to see .*ic* MOs .ill be matc*ed b) t*e pattern!

Sometimes, a second or t*ird ar+ ment can be +i-en, .*ic* is s all) a strin+ matc*in+ t*e attrib te or attrib te -al e t*at )o .ant to displa)! /*e searc* strin+ t*at is sed in t*e filters is a 9ni( ,e+ lar 7(pression &li1e t*e patterns sed in +rep command'! /*erefore, special meta#c*aracters s c* as ! R [ ] S T can be sed! S*ort description of some meta#c*aractersP >!> QQQ8 an) sin+le c*aracter >R> QQQ8 D or more occ rences of t*e pre-io s c*aracter [] QQQ8 matc*es a c*aracter or ran+e of c*aracters inside t*e brac1ets [S] QQQ8 NO/ matc*in+ a c*aracter or ran+e of c*aracters inside t*e brac1ets K QQQ8 O, S QQQ8 be+innin+ of strin+ T QQQ8 end of strin+ < QQQ8 ne+ation U QQQ8 re-erse order 7!+P >aR> means a or aa or aaa, etc! >!R> is li1e a .ildcard as it matc*es D or more occ rences of an) c*aracter >[a#0]> matc*es all letters from a to 0 >[abe]> matc*es letters a,b, and e >[SG]> matc*es an) c*aracter b t not G GKHKI matc*es G or H or I Sa!RNT matc*es a strin+ be+innin+ .it* a and finis*in+ .it* N, .it* an) c*aracter in t*e middle ,e+ lar e(pressions can be +ro ped sin+ brac1ets, e!+P >cell&""K4GKNH' matc*es cell"" or cell4G or cellNH <<<< NoteP MOS=7%% pattern matc*in+ is NO/ case sensiti-e <<<<< 7(amples of sin+ re+ lar e(pressions in t*e filtersP

lpr ms#4N#"!R-p4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGN /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGH /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cND /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cIN lpr Ums#4N#"!R-p4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cIN /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cND /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGH /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGN /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4 lpr <loadmod leKpro+ram QQQ8 all MOs e(cept t*ose matc*in+ >loadmod le> or >pro+ram> .ill be printed! lpr 4D!Ros 72 ipmentQ",S brac1Q",SlotQ4D,Pl +In9nitQ",7tmNQ",Os"HHP*)sPat*/ermQ" 72 ipmentQ",S brac1Q",SlotQ4D,Pl +In9nitQ",7tmNQ",Os"HHP*)sPat*/ermQ4 pr cc["#N] /ransportNet.or1Q",AtmCrossConnectionQAtmCC" /ransportNet.or1Q",AtmCrossConnectionQAtmCC4 /ransportNet.or1Q",AtmCrossConnectionQAtmCCG /ransportNet.or1Q",AtmCrossConnectionQAtmCCN pr cc["GH]

/ransportNet.or1Q",AtmCrossConnectionQAtmCC" /ransportNet.or1Q",AtmCrossConnectionQAtmCCG /ransportNet.or1Q",AtmCrossConnectionQAtmCCH lpr QI!Rpro+!RQ" 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S 72 ipmentQ",S brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl brac1Q",SlotQI,Pl +In9nitQ",Pro+ramQ"H +In9nitQ",Pro+ramQ" +In9nitQ",Pro+ramQ"N +In9nitQ",Pro+ramQ"G +In9nitQ",Pro+ramQ"4 +In9nitQ",Pro+ramQ"" +In9nitQ",Pro+ramQ"D +In9nitQ",Pro+ramQ"$ +In9nitQ",Pro+ramQ"J +In9nitQ",Pro+ramQ"O +In9nitQ",Pro+ramQ"I

lpr QI!Rpro+!RQ"T 72 ipmentQ",S brac1Q",SlotQI,Pl +In9nitQ",Pro+ramQ" lpr ms#4N#" /ransportNet.or1Q",AtmPortQMS#4N#" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cG4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGG /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGGO /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p",5pc/pQ",5cl/pQ-cGG4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4 /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ" /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGN /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cGH /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cND /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cIN lpr ms#4N#"!RQ-c[SG] /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cND /ransportNet.or1Q",AtmPortQMS#4N#",5pl/pQ-p4,5pc/pQ",5cl/pQ-cIN G!G# =o. to specif) attrib te -al es in set/cr/acc commands a' For attrib tes of t)pe Str ct, se t*e follo.in+ s)nta(P attr"Q-al"[,attr4Q-al4[,attrGQ-alG]]]!!! It is not necessar) to specif) all t*e str ct members, onl) t*ose t*at are re2 ired to c*an+e can be specified! 7(ampleP QQQ8 set sid sib"" sib""repperiodQ"4J QQQ8 set mtpGbspit sppriorit) priosltQ4 QQQ8 set mtpGbspit sppriorit) priosltQ4,priocoQ4 b' For attrib tes of t)pe Mo,ef, E st t)pe t*e MO %DN &.it*o t >Mana+ed7lementQ">'! 7+P QQQ8 lset AtmPortQ"44",5pl/pQ-p" atm/rafficDescriptor transportnet.or1Q",atmtrafficdescriptorQC"PNHDD It is also possible to s1ip t*e first parent &e+ transportnet.or1, s.mana+ement, etc'! 7+P QQQ8 cr rncf nctionQ", trancellQGDNH", tranrelationQGDNH"toGDH4" Attrib te " of ", trancellref &mo,efP9tranCell'P trancellQGDH4" t*is case .e don6t *a-e to specif) rncf nctionQ"

Vin

c' For attrib tes of t)pe arra) of Mo,efs, separate eac* element of t*e arra) .it* spaces! 7+P QQQ8 set E-m admclasspat* loadmod leQoms loadmod leQ-bEorb

loadmod leQasms3s*arp loadmod leQiai1 loadmod leQcma loadmod leQroam QQQ8 acc aal4pat*distrib tion nitQ" addPat* Parameter " of ", aal4Pat*5cc/pId &se2 ence#mo,ef#Aal4Pat*5cc/p'P aal4pat*-cctpQcsa aal4pat*-cctpQcsb d' For attrib tes of t)pe arra) of Str ct, separate eac* element of t*e arra) .it* semicolons! 7+P QQQ8 set rncf nction aliasPlmnIdentities mccQGDD,mncQ4G,mnclen+t*Q4?mccQGNH,mncQG4,mnclen+t*Q4?mccQ4DJ,mncQ"4G,mnclen+ t*QG e' For attrib tes of t)pe arra) of inte+er/lon+/float/strin+/boolean, separate eac* element of t*e arra) .it* commas! 7+P QQQ8 set antfeedercableQI latten ation "D,"D,"D,"D,"D,"D,"D,"D,"D QQQ8 set E-m options #BmsIHDDD1,#D*ttp!rootQ/c/p blic3*tml,# Dse!ericsson!sec rit)!Propert)File%ocationQ/c/Ea-a/Sec rit)Mana+ement!prp QQQ8 set cellQGDN" Acti-eO-erlaidCDMAC*annel%ist tr e,tr e,false,tr e QQQ8 acc mana+edelementdata addD*cpSer-erAddress Parameter " of ", ipAddressArra) &se2 ence#strin+'P "D!"!"!G,"D!"!"!N f' /o inp t an empt) -al eP R in set command, E st lea-e t*e -al e field blan1! 7+P QQQ8 set D serlabel &V attrib te t)pe is strin+' QQQ8 set reliablepro+ram niter admpassi-eslot &Vattrib te t)pe is Mo,ef' R in cr command, t)pe >n ll> if it6s an Mo,ef or >d> for ot*er attrib tes! /*is is onl) s pported for non#mandator) &restricted' attrib tes, beca se mandator) attrib tes m st *a-e a -al e R in acc command, t)pe >n ll>! /*is is onl) s pported for parameters of t)pe Mo,ef or Strin+!

G!N# Mos*ell command line /*e command line ses t*e ,eadline librar) from bas*! =ere are some of t*e s pported f nction 1e)sP # ri+*t arro. or Ctrl#f P mo-e for.ard one c*aracter # left arro. or Ctrl#b P mo-e bac1.ard one c*aracter # p arro. P pre-io s command in *istor) b ffer # do.n arro. P ne(t command in *istor) b ffer # bac1space P delete one c*aracter bac1.ard # Ctrl#d or >del> P delete one c*aracter for.ard # Ctrl#a or >*ome> P +o to be+innin+ of line # Ctrl#e or >end> P +o to end of line # Ctrl# P erase all c*aracters bac1.ard # Ctrl#1 P erase all c*aracters for.ard # Alt#f P mo-e for.ard one .ord # Alt#b P mo-e bac1.ard one .ord # select or select : ctrl# P cop) to clipboard # or s*ift# P paste from clipboard Note abo t command *istor)P if )o t)pe t*e be+innin+ of a command and t*en se t*e p/do.n arro. 1e), )o .ill see all pre-io s commands startin+ .it* t*is strin+ G!H# Pipin+ Some commands s pport pipin+, e+P OS7 s*ell commands, l*, t+, str, etc! /*is is s all) indicated in t*e men and t*e *elp for t*at command! 7(amplesP QQQ8 te lo+ read K +rep 7,,O, QQQ8 l* mp te lo+ read K +rep 7,,O, QQQ8 str K +rep cellQGDNHI For ot*er commands t*at don6t s pport pipin+ &li1e MO commands', t*e

.or1aro nd is to sa-e t*e o tp t to a lo+file t*en r n t*e ni( command on t*at lo+file b) sin+ t*e >l> or ><> command! 7(ampleP QQQ8 l: Vopen t*e lo+file, an arbitrar) name .ill be +i-en QQQ8 prod loadmod le Vr n t*e command QQQ8 l# Vclose t*e lo+file QQQ8 l sort Tlo+file Vr n t*e ni( command on t*e lo+file! Tlo+file is a defa lt -ariable t*at stores t*e name of t*e latest lo+ created QQQ8 l +rep #i basic Tlo+file Mos*ell s pports t*e se of -ariables and lo+ical constr cts! /*ese can be sed directl) from t*e command line or .it*in mos*ell command files! RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!D# Preset 5ariables RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e follo.in+ -ariables are set immediatel) after mos*ell start pP Tmos*elldir QQQQW pat* to t*e mos*ell director) T+a.1 QQQQW pat* to +a.1 Tipaddress QQQQW IP address to t*e node t*at mos*ell is connected to Tmos*ell3-ersion QQQQW t*e mos*ell -ersion Tlo+dir QQQQW pat* to t*e mos*ell3lo+files/lo+s3mos*ell director) Ttempdir QQQQW pat* to t*e director) containin+ all temporar) files for t*is mos*ell session! Cets deleted at t*e end of t*e session! T name QQQQW o tp t from t*e > name> command, s*o.in+ t*e operatin+ s)stem of t*e .or1station r nnin+ mos*ell! /*e follo.in+ -ariables are set after t*e MOM *as been parsedP Tmom-ersion QQQQW t*e MOM -ersion of t*e node &e+P ,NC3NOD73MOD7%373H3G, MC@3NOD73MOD7%3,G3$3D' Tcellomom-ersion QQQQW t*e Cello MOM -ersion &e+P G!G, N!G, H!", etc' of t*e node Tmomdocn mber and Tmomdocre-ision QQQW t*e doc ment n mber and re-ision of t*e MOM &e+P "HHHN#ABD"DHDG/" , re-P X"' /*ese -ariables can be *and) to *a-e .*en a script needs to 1no. .*at S@ re-ision is r nnin+ in t*e node or .*at 1ind of node it is! /*e follo.in+ -ariables are set after r nnin+ certain MO commandsP Tnr3of3mos QQQW t*e n mber of MOs t*at .ere printed on screen b) t*e last r n of t*e pr/st/+et/prod/fro/set/del/acc commands! Tnr3of3mos3o1 QQQW t*e n mber of MOs t*at .ere s ccessf ll) operated pon b) t*e last r n of t*e set/del/acc commands! Tcommand3res lt QQQW set after t*e cr/pcr/pset/tr n commands! Possible -al esP D for s ccess, " for fail re! Tnr3of3alarms QQQW t*e n mber of acti-e alarms on t*e node! Set after t*e last r n of t*e >al> command! Tnr3of3c-s QQQW t*e n mber of C5Ps t*at e(ist on t*e node, is set after t*e last r n of t*e >c-ls> command! Tnr3of3scanners QQQW t*e n mber of scanners printed b) t*e last r n of t*e pst/p+ets/pdel/pbl/pdeb commands! Tnr3of3co nter3instances QQQW t*e n mber of co nter instances printed b) t*e last r n of t*e p+etsn command! Tmoncommand QQQW t*e command to start t*e monitor client after *a-in+ r n t*e >mon> command! Tbac1+ro nd3pid QQQW t*e process id of a process started into bac1+ro nd from mos*ell command line, e+P l Tmoncommand QW Tlo+file L /*e follo.in+ -ariables are set after r nnin+ one of t*e l:/ :/ # commands! Tlo+file QQQQW t*e lo+file t*at is c rrentl) open! Set immediatel) after e(ec tin+ t*e >l:> command, sta)s set e-en after >l#> and .ill onl) be reset t*e ne(t time a ne. lo+file is open .it* >l:> T ndolo+file QQQQW t*e lo+file sed b) t*e ndo command! Set immediatel) after e(ec tin+ t*e > :/ :s> command, sta)s set e-en after > #> and .ill onl) be reset t*e ne(t time a ne. ndo mode is started .it* > :/ :s>!

T ndocommandfile QQQW t*e command file t*at can be sed to ndo t*e commands t*at .ere r n bet.een > :/ :s> and > #>! Set immediatel) after e(ec tin+ t*e > #> command! T ndodelcommandfile QQQW t*e file containin+ t*e delete commands! Onl) applicable to sim lated ndo mode > :s>! /*e follo.in+ -ariable is set after *a-in+ lo++ed on to t*e node -ia telnet/ss* or ftp/sftp! Tpass.ord /*e contents of t*e -ariable can not be printed, it .ill onl) s*o. if it6s empt) or not! B) settin+ t*is -ariable to empt) &b) doin+P Tpass.ord Q ', t*is .ill force mos*ell to c*ec1 t*e pass.ord a+ain! 9sef l in case t*e pass.ord *as c*an+ed on t*e node d rin+ t*e mos*ell session! /*e follo.in+ -ariable is set after r nnin+ t*e >p-> command! Tnr3of3-ars /*is -ariable indicates t*e n mber of scriptin+ -ariables t*at .ere printed in t*e last >p-> printo t! B) sin+ >p-> to+et*er .it* a filterin+ pattern &e+P p- Ttable', it is possible to find o t t*e n mber of -ariables t*at *ad matc*ed t*e pattern, for instance t*e n mber of elements in a *as*table! /*e follo.in+ -ariable is set after sin+ t*e f nctions >readfile> or >testfile>! Tnr3of3lines After sin+ t*e f nction >testfile>, t*is -ariable is set to D if t*e file does not e(ist and to " if t*e file e(ists! After sin+ t*e f nction >readfile>, t*is -ariable is set to D if t*e file does not e(ist and to t*e n mber of liens in t*e file if t*e file e(ists! /*e difference bet.een testfile and readfile is t*at testfile .on6t act all) read t*e file, it .ill E st c*ec1 if t*e file e(ists .*ereas readfile .ill test t*e file, t*en read it! 7(ample"P TlineContent Q testfile&/pat*/to/m)file' if Tnr3of3lines Q D l ec*o >File not fo nd<> ret rn fi 7(ample4P TlineContent Q readfile&/pat*/to/m)file' if Tnr3of3lines Q D l ec*o >File ot fo nd<> ret rn fi for TlineN mber Q " to Tnr3of3lines if TlineContent[TlineN mber] Y t*ispattern print @e fo nd it< /*e line is TlineN mber! ret rn fi done 7(ampleP list all scriptin+ -ariables c rrentl) set QWQW pTlo+dir Q /*ome/ean0ma+n/mos*ell3lo+files/lo+s3mos*ell Tmom-ersion Q ,NC3NOD73MOD7%373H3G Tmos*elldir Q /*ome/ean0ma+n/tools/mos*ell Tcellomom-ersion Q N!G!" T+a.1 Q /*ome/ean0ma+n/tools/mos*ell/+a.1 Tipdaddress Q "D!"!"4J!"O Tmos*ell3-ersion Q I!" Tnr3of3mos Q " Tpass.ord Q RRRRRRR RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

I!"# 5ariable assi+nment RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR A -ariable -al e can be assi+ned in si( .a)s, see belo.! A -ariable can also be nassi+ned, sin+ t*e > nset> command! B) sin+ t*e command > nset small>, all -ariables are nset, e(ceptP # t*e >s)stem> -ariables &T+a.1, Tipaddress, Tpass.ord, Tmos*ell3-ersion, Tmos*elldir, Tlo+dir, Tmom-ersion, Tcellomom-ersion' # t*e >+lobal> -ariable&s' &ieP assi+ned .it* t*e >PQ> si+n, instead of >Q>'! B) sin+ t*e command > nset all>, all -ariables are nset e(cept t*e >s)stem> -ariables! NO/7 <<< It is al.a)s +ood practice to nset a -ariable as soon as it is not needed an)more since *a-in+ too man) -ariables defined slo.s do.n t*e processin+ of t*e command line! It is also +ood to do > nset all> at t*e be+innin+ and end of a command file &and before doin+ t*e >ret rn> command' in order to a-oid interference from n#needed -ariables! See t*e script e(amples in mos*ell/commonEars/scripts! /o print all c rrentl) assi+ned -ariables, se t*e command >p-> & sed to be called >print-ars>'! /o E st print one -ariable, t)peP QWQW p- ZpatternW &.*ere t*e pattern matc*es t*e -ariable&s' to print' OrP QWQW print T-ariable a' from t*e command line /*e -ariable to be assi+ned is on t*e left side of t*e e2 al si+n and t*e -al e is on t*e ri+*t side! 7ac* element m st be separated b) spaces! 7(ampleP QWQW Ti Q G QWQW Tnode Q ,NC QWQW Tpass.ord Q &set t*e pass.ord to an empt) -al e, .ill force mos*ell to c*ec1 t*e pass.ord a+ain'! b' at mos*ell start p, sin+ t*e >#-> option In t*is case, t*e >T> si+n s*o ld be omitted &ot*er.ise it +ets interpreted b) t*e ni( s*ell' 7(ampleP QWQW mos*ell #pmoQCBP$D""DDJ3,"ADG,ftpser-Q"D!"!D!"I,sec re3s*ellQ",sec re3ftpQ" rncGN In t*is case, .e can see t*at scriptin+ -ariables &T pmo and Tftpser-' and ser -ariables &sec re3s*ell and sec re3ftp' *a-e been mi(ed in t*e same statement! /*is is o1 beca se an) -ariable t*at is not reco+nised as a ser -ariable .ill be treated as a scriptin+ -ariable! b' from t*e follo.in+ commandsP +et, fro, ip4d/d4ip, *4d/d4*, -! /*e mo#filter and attrib te#filter m st be specified, t*en comes t*e redirection si+n &>QW>', t*en t*e -ariable name! If se-eral attrib tes are printed, onl) t*e last attrib te -al e +ets assi+ned into t*e -ariable! 7(amplesP QWQW +et D prod ctName QW Tnode/)pe &res ltP Tnode/)pe Q ,BSG4D4' QWQW +et et*ernetlin1 ipaddress QW Tipaddress &res ltP Tipaddress Q "D!"!"4J!"O' QWQW +et confi+ ration-ersion c rrent p+rade QW Tc rrent9p &res ltP Tc rrent9p Q 9p+radePac1a+eQCBP$D"""4G3,"4F' QWQW +et Tc rrent9p administrati-edata QW Ts.,e&res ltP Ts.,e- Q Str ctZHWQQQWQW "!prod ctN mber Q CBP$D"""4G QWQWQW 4!prod ct,e-ision Q ,"4F etc!' QWQW lfro s brac1Qms,slotQ",pl +in nitQ"T Sr QW Tfroid &res ltP Tfroid Q D' QWQW d4ip #N"4O"4$DJH QW Tip3addr &res ltP Tip3addr Q "D!"!4!G' QWQW *4d D(a QW Tres &res ltP Tres Q "D'

QWQW - Scredential QW Tcredential /*ome/ericsson/mos*ell/commonEars/*ost!p"4'

&res ltP

c' sin+ an arit*metic operation /*e follo.in+ n meric operations are s pportedP : addition # s bstraction R m liplication / di-ision U mod lo &ret rns t*e remainder of an inte+er di-ision operation' 7(amplesP QWQW Ti Q " &res ltP TiQ"' QWQW Ti Q Ti : " &res ltP TiQ4' QWQW TE Q Ti R G &res ltP TEQI' QWQW T1 Q Ti R TE &res ltP T1Q"4' QWQW Tl Q Ti / TE &res ltP TlQD!GGG' QWQW Tm Q T1 U H &res ltP TmQ4' NoteP Onl) one operation per line is allo.ed! A space m st e(ist bet.een eac* element of t*e operation! /*ere cannot be more t*an t.o members in t*e operation &ieP Ti Q TE : T1 QQQW OM! B t Ti Q TE : T1 : Tl QQQQW NO/OM' d' sin+ o tp t from a ni( commandP /*e ni( command m st be s rro nded b) bac1#2 otes &['! 5ariables can be sed .it*in t*e ni( command! 7(ample"P QWQW Tdate Q [date :U)UmUd#U=UM[ &res ltP Tdate Q DND$GD# "ONH' QWQW +et et*ernetlin1 ipaddress QW Tipaddress &res ltP Tipaddress Q "D!"!"4J!"O' QWQW Tlo+file Q Tipaddress3Tdate!lo+ &res ltP Tlo+file Q "D!"!"4J!"O3DND$GD#"ONH!lo+' QWQW l:m Tlo+file &open a lo+file, don6t displa) an)t*in+ on t*e screen' QWQW te lo+ read QWQW l# &close lo+file' QWQW Terrors Q [+rep #c 7,,O, Tlo+file[ &res ltP Terrors Q t*e n mber of 7,,O,s fo nd in t*e lo+file' QWQW l rm Tlo+file &remo-e t*e lo+file' 7(ample4P ma1in+ a c- t*at *as t*e same name as t*e c rrent startable c- b t t*e last di+it is incremented b) " QWQW lt confi+ ration-ersion QWQW +et confi+ ration startable QW Tstartable &res ltP Tstartable Q ,BSGDNH3P4!"!H3C9G3A3D"' QWQW Tc-name Q [T+a.1 #- c-nameQTstartable 6B7CIN Z print +ens b&/!! T/,>>,",c-name' sprintf&>UD4s>,s bstr&c-name,len+t*&c-name'#"':"' W6[ QWQW c-ms Tc-name &res ltP Tc-name Q ,BSGDNH3P4!"!H3C9G3A3D4' e' sin+ strin+ manip lation /*e follo.in+ strin+ operations are s pportedP concatenation and s bstit tion/replacement! /*e concatenation is performed b) E (taposin+ t*e strin+s! S)nta( for concatenationP T-ar Q strin+"strin+4strin+G &t*e strin+s are concatenated .it*o t space in bet.een' or T-ar Q strin+" strin+4 strin+G &t*e strin+s are concatenated .it* spaces in bet.een' /*e s bstit tion/replacement is performed sin+ t*e >#s> s.itc* to specif) t*e strin+ to s bstit te and t*e >#r> s.itc* to specif) t*e strin+ it s*o ld be replaced .it*! If t*e >#r> s.itc* is not sed, t*en t*e strin+ .ill be replaced b) not*in+! If t*e >#+> s.itc* is specified, t*en all instances of t*e strin+ to s bstit ted, ot*er.ise, onl) t*e first instance! S)nta( for s bstit tion/replacementP T-ar Q ori+inalStrin+ #s strin+/oS bstit te [#r strin+/o,eplaceIt@it* [#+ ] ] ,e+ lar e(pressions can be sed in t*e strin+ manip lations!

7(amplesP QWQW T-ar Q abc3defabc +*i QWQW T-ar" Q T-ar #s abc &res ltP T-ar" Q 3defabc +*i , onl) first instance of >abc> .as replaced' QWQW T-ar4 Q T-ar #s \(D4D &res ltP T-ar4 Q abc3defabc+*i , t*e space si+n .as remo-ed' QWQW T-arG Q T-ar #s abc #+ &res ltP T-arG Q 3def +*i , all instances of >abc> .ere replaced' QWQW T-arN Q T-ar #s abc #r ()0 &res ltP T-arN Q ()03defabc +*i , first instance of >abc> .as replaced .it* >()0>' QWQW T-arH Q T-ar #s abc #r ()0 #+ &res ltP T-arH Q ()03def()0 +*i , all instances of >abc> .ere replaced .it* >()0>' QWQW T-arI Q T-ar #s a!Rc #r ()0 &res ltP T-arI Q ()0 +*i , t*e re+ lar e(pression >a!Rc> .as replaced .it* >()0>' QWQW T-arO Q T-arABCT-arI &res ltP T-arO Q abc3defabc +*iABC()0 +*i , t*e t*ree strin+s >T-ar>, >ABC> and >T-arI> *a-e been concatenated' QWQW T-arJ Q T-ar ABC T-arI &res ltP T-arJ Q abc3defabc +*i ABC ()0 +*i , t*ere are spaces in bet.een t*e t*ree strin+s' NoteP if more ad-anced strin+ manip lation is needed, it is al.a)s possible to se an e(ternal pro+ram s c* as +a.1 to do t*e strin+ manip lation! See e(ample 4 in para+rap* d' abo-e! f' sin+ o tp t from a predefined f nction C rrentl), t*e follo.in+ f nctions e(istP R fdn&pro()' QQQQW inp t is t*e pro() id, o tp t is t*e FDN R ldn&pro()' QQQQW inp t is t*e pro() id, o tp t is t*e %DN R rdn&pro()' QQQQW inp t is t*e pro() id, o tp t is t*e ,DN R mot)pe&pro()' QQQQW inp t is t*e pro() id, o tp t is t*e MO t)pe R pro()&strin+' QQQQW inp t is t*e %DN or FDN &NO/ ,DN<', o tp t is t*e pro() id R readinp t&srin+' QQQQW inp t is a prompt t*at s*o ld appear on t*e screen, so t*at t*e ser can inp t an ans.er .*ic* .ill t*en be assi+ned to t*e -ariable! R readfile&file' QQQQW inp t is a filename! 7ac* line of t*e file is assi+ned into an element of t*e *as*table into .*ic* .e *a-e assi+ned t*e res lt of t*e f nction! If t*e file is not fo nd, t*e -ariable Tnr3of3lines is set to D, ot*er.ise it is set to t*e n mber of lines in t*e file! Note, t*is s*o ld not be sed on lar+e files as it .ill slo. do.n t*in+s -er) m c*! R testfile&file' QQQQW inp t is a filename! If t*e file is not fo nd, t*e -ariable Tnr3of3lines is set to D, ot*er.ise it is set to "! R split&strin+' QQQW /*e strin+ is split into t*e arra) specified on t*e left side of t*e e2 al si+n &see e(ample belo.'! /*e separator sed to split t*e strin+ can be specified in t*e -ariable >Tsplit3separator>! B) defa lt it is a space! If t*e Tsplit3separator *as been c*an+ed and needs to be reset to t*e defa lt -al e, E st r n t*e command > nset Tsplit3separator>! /*e n mber of elements in t*e arra) is stored in t*e -ariable Tsplit3last 7(ample"P QWQW lt i blin1 QWQW ma i b i b QWQW for Tmo in i b Tmordn Q rdn&Tmo' if Tmordn Y "D4G lcc Tmordn lbl Tmordn, fi done 7(ample4P QWQW T-ar Q readinp t&Please confirm [)/n]P ' QWQW if T-ar <Y S) ret rn fi

7(ampleGP QWQW Ttable Q readfile&/pat*/to/m)file' QWQW for TlineN mber Q " to Tnr3of3lines print Ttable[TlineN mber] T.ord Q split&Ttable[TlineN mber]' if T.ord["] Y SV Tnr3of3comments Q Tnr3of3comments : " fi nset T.ord nset Ttable[TlineN mber] done &NoteP b) nsettin+ t*e entr) .e6-e E st read # pro-ided .e don6t need it an)more # .ill ma1e t*in+s faster' +' 7(ample /*e p rpose of t*e little mos*ell script belo. is to ma1e a c stomi0ed C5 name li1eP date3node/)pe3s.,eQWQW c-ls QWQW Tdate Q [date :U)UmUd[ &res ltP Tdate Q DND$GD' QWQW +et D prod ctName QW Tnode/)pe &res ltP Tnode/)pe Q ,BSG4D4' QWQW Tnode/)pe Q Tnode/)pe #s ,BS &res ltP Tnode/)pe Q G4D4' QWQW +et confi+ ration-ersion c rrent p+rade QW Tc rrent9p &res ltP Tc rrent9p Q 9p+radePac1a+eQCBP$D"$"GU43,"4N' QWQW +et Tc rrent9p administrati-edata QW Ts.,e&res ltP Ts.,e- Q Str ctZHWQQQWQW "!prod ctN mber Q CBP$D"$"G/4 QWQWQW 4!prod ct,e-ision Q ,"4N QQQWQW G!prod ctName Q CBP$D"$"GU43,"4N !!!!' QWQW Ts.,e- Q [+a.1 #- c rrents.Q>Ts.,e-> 6B7CINZ s.re-Q+ens b&/\rK\n/,>>,>+>,c rrents.' ? print +ens b&/S!R,e-ision Q KQQQWQW G!prod ct!RT/,>>,>+>,s.re-' W6[ &res ltP Ts.,e- Q ,"4N' QWQW c-ms Tdate3Tnode/)pe3Ts.,e&res ltP c-ms DND$GD3G4D43,"4N ' RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!4# =as*tables &arra)s' RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e inde( and t*e -al e of t*e *as*table can be a -ariable, a constant, or a mi( of bot*! All -ariable assi+nment met*ods described in c*apter I!" appl) for assi+nin+ -al es into *as*tables as .ell! /o print a *as*table, doP p- ZtableW 7(amplesP Assi+nin+ constants into a *as*table QQQW Ttable["] Q *ello QQQW Ttable[4] Q *eE QQQW Ttable[*o*o] Q H QQQW p- tab &res lt printo tP' Ttable[*o*o] Q H Ttable["] Q *ello Ttable[4] Q *eE Assi+nin+ -ariables into a *as*table QQQW Tmo Q AtmPortQMS#I#" QQQW Tpro() Q pro()&Tmo' QQQW Tpro()list[Tmo] Q Tpro() QQQW Tmo Q AtmPortQMS#I#4 QQQW Tpro() Q pro()&Tmo' QQQW Tpro()list[Tmo] Q Tpro() QQQW p- pro()list &res lt printo tP' Tpro()list[AtmPortQMS#I#"] Q "DG Tpro()list[AtmPortQMS#I#4] Q ""4 More e(amples on *o. to se *as*tables are described in I!N!

RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!G# If/7lse constr cts RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e if statement m st be follo.ed b) a condition! /*e comparison operator of t*e condition m st be s rro nded b) spaces! Xero or more >else if> statements can be sed after t*e >if> statement! Xero or one >else> statements can be after t*e >if> or >else if> statements! /*e end of t*e if/else str ct re m st be specified .it* a >fi> statement! 7ac* statement m st be on its o.n line and can be follo.ed b) one or more commands! Se-eral conditions can be combined, sin+ t*e lo+ical AND &LL', or t*e lo+ical O, &KK'! An) n mber of AND/O, can be p t on a line b t NO/ BO/= on t*e same line! Cro pin+ conditions .it* brac1ets is NO/ s pported! /*e >ret rn> command can be sed to e(it from t*e command file in case a certain condition is met! /)pe >* ret rn> for more information on *o. to se t*is command! S)nta( e(amplesP a' if ZconditionW command" command4 fi b' if Zcondition"W KK Zcondition4W command" command4 else commandG fi c' if ZconditionW LL Zcondition4W LL ZconditionGW command" else if ZconditionNW command4 else commandG fi A condition can se t*e follo.in+ comparison operatorsP Q e2 als Y matc*es <Q is not e2 al to <Y does not matc* QW +reater t*an Z less t*an QWQ +reater or e2 al t*an ZQ less or e2 al t*an /*e .ords aro nd t*e operator can be eit*er a -ariable or a sin+le .ord b t NO/ a strin+ containin+ spaces or a concatenation of a -ariable and strin+! Follo.in+ conditions are s)nta(icall) correctP if T-ar" Q T-ar4 if m)strin+ Y T-ar if "D QW G if Ti Z 4 Follo.in+ conditions are NO/ s)nta(icall) correct and .ill ret rn ne(pected res ltsP if m)strin+3T-ar" Y T-ar4 if m)strin+ is t*is Y )o r strin+ A condition can also E st contain one -ariable, in .*ic* case it .ill c*ec1 if t*e -ariables e(ists! 7(amplesP

QWQW if T-ar QQQQW c*ec1 if t*e -ariable T-ar e(ists QWQW +et D prod ctname QW Tnode/)pe QWQW if Tnode/)pe Y G4D4 KK Tnode/)pe Y G"DN +et feeder atten ation set feeder atten ation N else if Tnode/)pe Y G"D" +et feeder atten ation set feeder atten ation "I else +et feeder atten ation fi RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!N# For constr cts RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e parameter to t*e >For> constr ct can beP a' >e-er> P to repeat t*e loop an infinite n mber of times b' Zn mberOfIterationsW P to repeat t*e loop a specific n mber of times c' Tmo in ZmoCro pW P to r n t*e bod) of t*e loop on eac* MO of t*e specified moCro p! MO +ro ps are created .it* t*e >ma> command, t)pe >* ma> for info! d' Tboard in ZboardCo pW P to r n t*e bod) of t*e loop on eac* board of t*e specified board +ro p! Board +ro ps are created .it* t*e >ba> command, t)pe >* ba> for info! f' T-ar in Ttable P for eac* iteration of t*e loop, T-ar .ill c)cle t*ro +* t*e inde( -al es of t*e *as*table Ttable +' T-ar Q Tstart to Tstop P T-ar is assi+ned e-er) inte+er -al e bet.een Tstart and Tstop! Tstart and Tstop can be -ariables or constants b t m st be an inte+er! If Tstart is smaller t*an Tstop t*an t*e order .ill be ascendin+, ot*er.ise it .ill be descendin+! /*e end of t*e >for> str ct re m st be specified .it* a >done> statement! /*e >.ait> command can be sed in t*e bod) of t*e loop to specif) a dela) to .ait in bet.een eac* iteration! /*e dela) can be in seconds, min tes, *o rs, or e-en ,OP periods! &/)pe >* .ait> for info!' Do not se t*e >sleep> command as t*is .ill res lt in *an+in+ if t*e loop is aborted! /*e loop can be aborted an) time b) t)pin+ ctrl#0 , t*en >to c* ZstopfileW>, t*en >f+>! /*e ZstopfileW pat* is s*o.n in t*e .indo. title bar! /)pe >* ctrl#0> for more info abo t abortin+! /*e brea1 command can be sed .it*in t*e loop to e(it from t*e loop! S)nta( e(amplesP a' for e-er command" command4 done b' for Zn mberOf/imesW command" .ait Zn mberOfSecondsW done c' for Tmo in ZmoCro pW +et Tmo Zattrib teW QW T-ariable T-ariable" Q !!!! set Tmo Zattrib teW T-ariable" etc!!! done d' for Tboard in ZboardCro pW bl Tboard facc Tboard restart D "

.ait "D deb Tboard l*s* Tboard -ii done e' for Tpro() in Tpro()table bl Tpro() st Tpro() deb Tpro() st Tpro() +et Tpro() operational QW Topstate if Topstate <Q " brea1 fi done f' for T-ar Q Tma(pro() to Tminpro() del T-ar done for T-ar Q " to I te e traceTmin process done 7(amplesP a' c*ec1in+ t*e pro+ress of a 9P installation, e-er) "D seconds! Brea1 from t*e loop if t*e res lt is >" &INS/A%%3COMP%7/7D'>, and contin e .it* p+rade action! Abort t*e command file if t*e res lt is >I &INS/A%%3NO/3COMP%7/7D'> QWQW lt p+rade QWQW acc p+radepac1a+eQ((( nonbloc1in+install QWQW for e-er Tret rn Q D .ait "D +et p+radepac1a+eQ((( state QW T pstate if T pstate Y S" brea1 else if T pstate Y SI Tret rn Q " brea1 fi done if Tret rn Q " ret rn fi acc p+radepac1a+eQ((( p+rade b' r n a testcase HD times QWQW for HD r n testcase3G!"!"!cmd .ait 4m done c' increase t*e primar)Cpic*Po.er b) D!" dBm on eac* 9tranCell QWQW lt S trancell QWQW ma cell S trancell QWQW for Tmo in cell +et Tmo primar)cpic*po.er Tpic* Tpic* Q Tpic* : " set Tmo primar)cpic*po.er Tpic* done d' restart all boards in a board +ro p QWQW ba spb spb QWQW for Tboard in spb acc Tboard restart

D " done e' sa-e t*e fro -al es of all pro+rams into a table and t*en restart e-er) pro+ram QWQW lma pro+rams3on3slot3"$ s brac1Qms,slotQ"$,!Rpro+ram QWQW for Tpro+ in pro+rams3on3slot3"$ Ti Q Ti : " fro Tpro+ Sres QW Tfrolist[Ti] done QWQW for Tfro in Tfrolist restartObE p+m Tfro done f' restart some boards in a specific order QWQW for T-ar Q 4D to "N Tboard Q DDT-arDD facc Tboard restart D " done RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!H# 9ser#defined f nctions RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 9sers can define t*eir o.n f nctions, sin+ t*e f nc/endf nc constr ct! If t*e f nction is called .it* ar+ ments, t*ese are assi+ned to t*e -ariables T", T4, TG, etc 7(ampleP "! Define t*e f nction &t*e f nction definitions can be r n in a different command file' =ere .e are definin+ a f nction .*ic* c*ec1s t*e state of t*e mirrored dis1s and ret rns once t*e dis1s are in s)nc f nc c*ec13dis13state Vif T" is ndefined or different to an inte+er -al e t*en .e set it to "D seconds if T" Y S[D#$]:T T.ait3inter-al Q T" else T.ait3inter-al Q "D fi for e-er .ait T.ait3inter-al l:om Ttempdir/dis1state l* coremp mirror s l# Tres Q [+rep #c >Peer Dis1 Stat sP R5alid> Ttempdir/dis1state if Tres QW D brea1 fi done endf nc f nc .aitfor ser Tdate Q [date >:U]#Um#Ud U=PUMPUS>[ for e-er Trepl) Q readinp t&@aitin+ from [Tdate]! /)pe >)> .*en read)P ' if Trepl) Y S[)]] brea1 fi done Tdate Q [date >:U]#Um#Ud U=PUMPUS>[ print >Finis*ed .aitin+ at [Tdate]> endf nc endf nc

4! Call t*e f nction =ere .e *a-e made a small script .*ic* ma1es se of o r ser#defined f nction! First .e are r nnin+ a file containin+ all t*e definitions for o r ser# defined f nctions! &Note t*at t*e f nctions can also be defined .it*in t*e same script, b t b) 1eepin+ all f nctions in a separate file means t*at se-eral command files can se t*e same f nctions' @e *a-e called t*e f nction c*ec13dis13state .it* an ar+ ment >H> .*ic* in t*is case .ill be sed as t*e >T.ait3inter-al> parameter in t*e f nction r n Y/m)f nctions3define!mos for e-er c*ec13dis13state H .aitfor ser acc D restart pol done RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!I# Nestin+ RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR It is possible to nest one or more if/else statement .it*in a loop statement and -ice#-ersa! B t it is c rrentl) not possible to nest an if/else statement .it*in an if/else statement and a loop statement .it*in anot*er loop statement! /*e c rrent .or1aro nd is to p t t*e for/if constr cts into f nctions! See c*apter I!H for more info on f nctions! 7(ampleP /*e follo.in+ script starts t*e install, t*en c*ec1s t*e state of t*e install e-er) "D seconds! Once t*e p+radepac1a+e is installed, it starts t*e p+rade! /*en it c*ec1s t*e state a+ain and once t*e p+rade is in state >a.aitin+confirm>, it confirms t*e p+rade! T9P Q p+radepac1a+eQCBP$D"""4G3,"4F acc T9P nonbloc1in+install for e-er .ait "D +et T9P state QW Tstate if Tstate Y S" brea1 fi done +et T9P state QW Tstate if Tstate Y S" acc T9P p+rade fi .ait "4D for e-er .ait "D +et T9P state QW Tstate if Tstate Y SG brea1 fi done if Tstate Y SG acc T9P confirm p+rade fi I!O# 7(amples 7(ample scripts can be fo nd nder mos*ell/commonEars/scripts and mos*ell/e(amples/scriptin+/ Note t.o t)pes of comments can be sed in scriptsP

# -isible commentsP start .it* t*e >V> si+n! /*ese comments are printed on t*e screen .*ile t*e script is e(ec tin+! # in-isible commentsP start .it* t*e >//> si+n! /*ese comments are not printed on t*e screen! set Prompt >,NCR > ?V t*is a +lob pattern; set promptcnt D V prepare some co nters set timeo t GD set timeo tacc D set ma(timeo t IDD .*ile Z"W Z VV################################################################### sleep GDD ?V reall) .ant t*is V t*ere is no need to >e-al> t*is V spa.n .or1s .it* a list of ar+s spa.n #noec*o TMOS=7%% Tip3address V #+l QQ e(pect +lob pattern & i!e! ; R .ildcards ' e(pect #+l \ TPrompt Z V co nt t*e prompts t*at *a-e been seen incr PPpromptcnt V deb +, !! p ts stderr >TMOS=7%% PromptP TPrompt seen> if ZTpromptcnt ^ 4W Z V t*is mi+*t be .ron+ e(p3send #s >\r> V and contin e .it* t*is call to e(pect e(p3contin e W W timeo t Z V e(pect +oes *ere after Ttimeo t seconds V boo11eepin+ *o. lon+ )o *a-e been .aitin+ incr PPtimeo tacc TPPtimeo t V deb + e-er) Ttimeo t seconds p ts stderr >"\tMoS*ell not respondin+< TPPtimemo tacc sec> V as lon+ as )o r Tma(timeo t is not reac*ed res me t*e e(pect call if ZTPPtimeo tacc ^ TPPma(timeo tW Z V restart t*is e(pect call e(p3contin e W W eof Z V if t*e spa.nded process dies )o +o *ereP p ts stderr >TMOS=7%% died on me> W p ts stderr >finis*ed< TPPpromptco nt> brea1 W

Das könnte Ihnen auch gefallen