mom[tc] Print description of MO classes, CM/FM attribtes,
actions , enms and strcts! lt/ltc["#$] %oad MO tree &fll or partial' and bild pro() table! lc["#$]/lcc %oad MO tree &fll or partial' and bild pro() table! pr/lpr Print MO %DNs and pro() ids for all or part of t*e MO tree crrentl) loaded in mos*ell! ma/lma Add MO&s' to an MO +rop! mr/lmr ,emo-e an MO +rop or remo-e MOs from an MO +rop &MOs .il l NO/ be deleted, onl) t*e +rop'! mp Print all defined MO +rops! +et/l+et ,ead CM/FM attribte&s' from MO&s'! *+et[c]/l*+et[c] ,ead CM/FM attribte&s' from MO&s', print *ori0ontall) one line per MO &instead of one line per attribte'! 1+et/l1+et Displa) CM/FM attribtes in e(portable printot 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 prodctData 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 bt spports a .ider ran+e of MO classes! set[m]/lset[m] Set an attribte -ale on one or se-eral MO6s! rset/lrset Set attribte -ale on a restricted attribte 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(ecte 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! rn ,n a command file in mos*ell format! trn[i] ,n a command file in 7MAS/Mo/ester format! ctrl#0 Abort an MO command or a >for> loop! /)pe >toc* /tmp/?f+> to resme 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 crrentl) 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 attribtes t*at are not described in t*e MOM &>Force> +et'! s+et/ls+et ,ead CM/FM attribtes from MO&s', one b) one &>Slo.> +et'! fset/lfset Set an attribte t*at is not described in t*e MOM &>Force> set'! facc/lfacc Perform actions t*at are not defined in t*e MOM &>Force> a ction'! O/=7, MO COMMANDS c-ls/c-m1/c-ms/c-set/c-rm/c-c/c-ls" Confi+ration5ersion &C5' *andlin+! in-[*r] Complete =@/S@ in-entor)! Incldes information abot ,P9s, licensin+, A5M, de-ices, BPs, etc! cab[sl(rad+tm] Displa) of miscellaneos CO%I printots 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 DsDBndles! *c ,n a +eneral *ealt*c*ec1 on t*e node! diff/ldiff Parameter aditin+ or MO dmp comparisons! str["4ft] Print stats of t*e Ib%in1s/Abis%in1s and t*eir associate d Cells and C*annels &,NC/BSC onl)'! l1i ,esorce sa+e and confi+ration of Ib%in1s &,NC onl)'! remod[][4] ,emodle an Ib%in1 &,NC onl)'! t+[r][c][d] Print ,esorce 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>'! p- Print scriptin+ -ariables! </l 7(ecte 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 +rops t*at can be sed for rnnin+ CO%I commands on mltiple boards! l* ,n CO%I commands on all boards of a board +rop! 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 Crop&s'! s2l:/s2l#/s2l; Start/stop/c*ec1 t*e SF% client on t*e node &CBC"G4HIDJ'! p+[c][f] Pro+ram 9p+rade! For S/P se onl), e+, to load blac1 %Ms! ftree ,ecrsi-e listin+ on t*e node6s file s)stem &e2i-alent to >ls #l,> in ni('! ft+et[c]/ftpt[c] /ransfer files or directories to/from t*e node, sin+ ftp! *t+et /ransfer files from t*e node sin+ *ttp! edit 7dit a file on t*e node! fclean[fKffKdKe] ,emo-al of obsolete loadmodles O, recrsi-e remo-al of a director) on t*e node! *i Print *istor) of mos*ell commands entered drin+ t*e crre nt session! lmid[c] Print translation of loadmodle prodct nmber 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 printot of +et command! col /o++le displa) of colors! l /o++le displa) of serlabel in st/lst and p+et/lp+et print ot! conf[bld] /o++le confirmation on -arios MO commands! +s/+s+ /o++le displa) of old/ne. attribte -ale 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+'! retrn 7(it from a command file .it*ot 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/2it 7(it mos*ell! PM COMMANDS pmom[ac]/lmom[c] Print description of PM conters &pmom' or lo+ attribtes &lmom, CDMA onl)'! p+et/lp+et ,ead PM attribte&s' from MO&s'! *p+et[c]/l*p+et[c] ,ead PM attribte&s' from MO&s', print *ori0ontall) one li ne per MO &instead of one line per attribte'! pdiff/lpdiff Print incrementation of PM attribtes! pm([*fdn] Displa) conter -ales, e(tracted from t*e statistics ,OP files! pmr[a+] Prodce PM MPI reports, based on conter -ales in statist ics ,OP files and formlas in CPI docmentation! 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 Sspend a scanner! pdeb ,esme a scanner! pdel Delete a scanner! emom Displa) list of e-ents a-ailable for eac* 1ind of e-ent#ba sed scanner! pset[d] Set t*e contents of an e-ent#based scanner &,NC/,BS onl)'! =7%P C=AP/7,S D Installation, secrit), and ser settin+s " ,e-ision =istor) 4 /torial G Command s)nta(, re+lar e(pressions N Command descriptions H %a0) I Scriptin+ O 9tilities J Ser-er Maintenance $ Offline Mode /)peP # * 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 e2al 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 ni2el) 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 &Fll Distin+is*ed Name' /*is is sed to ni2el) identif) an MO .it*in a net.or1 &sed b) ,ANOS/CNOSS'! 7(ampleP SbNet.or1QA9S,SbNet.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 sall) sed to specif) t*e MOs t*at s*old 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 attribte >9ser%abel> on all MOs NoteP instead of >all>, it is also possible a .ildcard sc* 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, sefl for deletin+ MOs' acc "D#4D restart QQQQ8 restart MOs .it* pro() "D to 4D G' lin1 *andler &for pl+innit and spm MOs onl)' 7(ampleP acc DD"NDD restart QQQQ8 to restart t*e MO Sbrac1QMS,SlotQ"N,Pl+In9nitQ" bl DD"$DD/spD!ln* QQQQ8 to loc1 t*e spm Sbrac1QMS,SlotQ"$,Pl+In9nitQ",SpQ",SpmQ" N' mo +rop QQQ8 MO&s' belon+in+ to t*e +i-en MO +rop .ill be operated pon! MO +rops 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, rnnin+ t*e >bo> command .ill atomaticall) create a nmber of MO +rops containin+ t*e cc/dc/pdr de-ice MOs for eac* modle! H' board +rop QQQ8 MOs &Pl+In9nit or Spm' mapped onto t*e boards belon+in+ to t*e +i-en board +rop .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 +rop >sccp> bl sccp QQQQ8 all Pl+In9nit or Spm MOs connected to boards of t*is board +rop .ill be loc1ed 7(ample4PIn ,NC, sin+ t*e defalt board +rops created after rnnin+ t*e bo commandP acc mod"D restart pr dc"D acc dc"D restart &t*e board +rop dc"D is mapped onto t*e Spm MOs' bl dc"Dde- &in t*is case .e are sin+ t*e MO +rop 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#" retrnsP /ransportNet.or1Q",AtmPortQMS#4N#" Q8Q8 lpr ms#4N#" retrnsP /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 issin+ 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 sall) a strin+ matc*in+ t*e attribte or attribte -ale 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 sc* 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 occrences of t*e pre-ios 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 occrences 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 bt 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 +roped 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 <loadmodleKpro+ram QQQ8 all MOs e(cept t*ose matc*in+ >loadmodle> or >pro+ram> .ill be printed! lpr 4D!Ros 72ipmentQ",Sbrac1Q",SlotQ4D,Pl+In9nitQ",7tmNQ",Os"HHP*)sPat*/ermQ" 72ipmentQ",Sbrac1Q",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" 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"H 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ" 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"N 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"G 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"4 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"" 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"D 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"$ 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"J 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"O 72ipmentQ",Sbrac1Q",SlotQI,Pl+In9nitQ",Pro+ramQ"I lpr QI!Rpro+!RQ"T 72ipmentQ",Sbrac1Q",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) attribte -ales in set/cr/acc commands a' For attribtes of t)pe Strct, se t*e follo.in+ s)nta(P attr"Q-al"[,attr4Q-al4[,attrGQ-alG]]]!!! It is not necessar) to specif) all t*e strct members, onl) t*ose t*at are re2ired 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 attribtes of t)pe Mo,ef, Est t)pe t*e MO %DN &.it*ot >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 rncfnctionQ",trancellQGDNH",tranrelationQGDNH"toGDH4" Attribte " of ", trancellref &mo,efP9tranCell'P trancellQGDH4" Vin t*is case .e don6t *a-e to specif) rncfnctionQ" c' For attribtes of t)pe arra) of Mo,efs, separate eac* element of t*e arra) .it* spaces! 7+P QQQ8 set E-m admclasspat* loadmodleQoms loadmodleQ-bEorb loadmodleQasms3s*arp loadmodleQiai1 loadmodleQcma loadmodleQroam QQQ8 acc aal4pat*distribtionnitQ" addPat* Parameter " of ", aal4Pat*5cc/pId &se2ence#mo,ef#Aal4Pat*5cc/p'P aal4pat*-cctpQcsa aal4pat*-cctpQcsb d' For attribtes of t)pe arra) of Strct, separate eac* element of t*e arra) .it* semicolons! 7+P QQQ8 set rncfnction aliasPlmnIdentities mccQGDD,mncQ4G,mnclen+t*Q4?mccQGNH,mncQG4,mnclen+t*Q4?mccQ4DJ,mncQ"4G,mnclen+ t*QG e' For attribtes 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 lattenation "D,"D,"D,"D,"D,"D,"D,"D,"D QQQ8 set E-m options #BmsIHDDD1,#D*ttp!rootQ/c/pblic3*tml,# Dse!ericsson!secrit)!Propert)File%ocationQ/c/Ea-a/Secrit)Mana+ement!prp QQQ8 set cellQGDN" Acti-eO-erlaidCDMAC*annel%ist tre,tre,false,tre QQQ8 acc mana+edelementdata addD*cpSer-erAddress Parameter " of ", ipAddressArra) &se2ence#strin+'P "D!"!"!G,"D!"!"!N f' /o inpt an empt) -aleP R in set command, Est lea-e t*e -ale field blan1! 7+P QQQ8 set D serlabel &V attribte t)pe is strin+' QQQ8 set reliablepro+ramniter admpassi-eslot &Vattribte t)pe is Mo,ef' R in cr command, t)pe >nll> if it6s an Mo,ef or >d> for ot*er attribtes! /*is is onl) spported for non#mandator) &restricted' attribtes, becase mandator) attribtes mst *a-e a -ale R in acc command, t)pe >nll>! /*is is onl) spported 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 spported fnction 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-ios command in *istor) bffer # do.n arro. P ne(t command in *istor) bffer # 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 abot 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-ios commands startin+ .it* t*is strin+ G!H# Pipin+ Some commands spport pipin+, e+P OS7 s*ell commands, l*, t+, str, etc! /*is is sall) 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 spport pipin+ &li1e MO commands', t*e .or1arond is to sa-e t*e otpt to a lo+file t*en rn 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 loadmodle Vrn t*e command QQQ8 l# Vclose t*e lo+file QQQ8 l sort Tlo+file Vrn t*e ni( command on t*e lo+file! Tlo+file is a defalt -ariable t*at stores t*e name of t*e latest lo+ created QQQ8 l +rep #i basic Tlo+file Mos*ell spports t*e se of -ariables and lo+ical constrcts! /*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 startpP 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! Tname QQQQW otpt from t*e >name> command, s*o.in+ t*e operatin+ s)stem of t*e .or1station rnnin+ 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 Tmomdocnmber and Tmomdocre-ision QQQW t*e docment nmber 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 rnnin+ in t*e node or .*at 1ind of node it is! /*e follo.in+ -ariables are set after rnnin+ certain MO commandsP Tnr3of3mos QQQW t*e nmber of MOs t*at .ere printed on screen b) t*e last rn of t*e pr/st/+et/prod/fro/set/del/acc commands! Tnr3of3mos3o1 QQQW t*e nmber of MOs t*at .ere sccessfll) operated pon b) t*e last rn of t*e set/del/acc commands! Tcommand3reslt QQQW set after t*e cr/pcr/pset/trn commands! Possible -alesP D for sccess, " for failre! Tnr3of3alarms QQQW t*e nmber of acti-e alarms on t*e node! Set after t*e last rn of t*e >al> command! Tnr3of3c-s QQQW t*e nmber of C5Ps t*at e(ist on t*e node, is set after t*e last rn of t*e >c-ls> command! Tnr3of3scanners QQQW t*e nmber of scanners printed b) t*e last rn of t*e pst/p+ets/pdel/pbl/pdeb commands! Tnr3of3conter3instances QQQW t*e nmber of conter instances printed b) t*e last rn of t*e p+etsn command! Tmoncommand QQQW t*e command to start t*e monitor client after *a-in+ rn t*e >mon> command! Tbac1+rond3pid QQQW t*e process id of a process started into bac1+rond from mos*ell command line, e+P l Tmoncommand QW Tlo+file L /*e follo.in+ -ariables are set after rnnin+ one of t*e l:/:/# commands! Tlo+file QQQQW t*e lo+file t*at is crrentl) open! Set immediatel) after e(ectin+ 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:> Tndolo+file QQQQW t*e lo+file sed b) t*e ndo command! Set immediatel) after e(ectin+ 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>! Tndocommandfile QQQW t*e command file t*at can be sed to ndo t*e commands t*at .ere rn bet.een >:/:s> and >#>! Set immediatel) after e(ectin+ t*e >#> command! Tndodelcommandfile QQQW t*e file containin+ t*e delete commands! Onl) applicable to simlated 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! 9sefl in case t*e pass.ord *as c*an+ed on t*e node drin+ t*e mos*ell session! /*e follo.in+ -ariable is set after rnnin+ t*e >p-> command! Tnr3of3-ars /*is -ariable indicates t*e nmber of scriptin+ -ariables t*at .ere printed in t*e last >p-> printot! B) sin+ >p-> to+et*er .it* a filterin+ pattern &e+P p- Ttable', it is possible to find ot t*e nmber of -ariables t*at *ad matc*ed t*e pattern, for instance t*e nmber of elements in a *as*table! /*e follo.in+ -ariable is set after sin+ t*e fnctions >readfile> or >testfile>! Tnr3of3lines After sin+ t*e fnction >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 fnction >readfile>, t*is -ariable is set to D if t*e file does not e(ist and to t*e nmber of liens in t*e file if t*e file e(ists! /*e difference bet.een testfile and readfile is t*at testfile .on6t actall) read t*e file, it .ill Est 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 fond<> retrn fi 7(ample4P TlineContent Q readfile&/pat*/to/m)file' if Tnr3of3lines Q D l ec*o >File ot fond<> retrn fi for TlineNmber Q " to Tnr3of3lines if TlineContent[TlineNmber] Y t*ispattern print @e fond it< /*e line is TlineNmber! retrn fi done 7(ampleP list all scriptin+ -ariables crrentl) set QWQW p- Tlo+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 -ale 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 >retrn> 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 crrentl) assi+ned -ariables, se t*e command >p-> &sed to be called >print-ars>'! /o Est 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 e2al si+n and t*e -ale is on t*e ri+*t side! 7ac* element mst 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) -ale, .ill force mos*ell to c*ec1 t*e pass.ord a+ain'! b' at mos*ell startp, sin+ t*e >#-> option In t*is case, t*e >T> si+n s*old 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,secre3s*ellQ",secre3ftpQ" rncGN In t*is case, .e can see t*at scriptin+ -ariables &Tpmo and Tftpser-' and ser -ariables &secre3s*ell and secre3ftp' *a-e been mi(ed in t*e same statement! /*is is o1 becase 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 attribte#filter mst be specified, t*en comes t*e redirection si+n &>QW>', t*en t*e -ariable name! If se-eral attribtes are printed, onl) t*e last attribte -ale +ets assi+ned into t*e -ariable! 7(amplesP QWQW +et D prodctName QW Tnode/)pe &resltP Tnode/)pe Q ,BSG4D4' QWQW +et et*ernetlin1 ipaddress QW Tipaddress &resltP Tipaddress Q "D!"!"4J!"O' QWQW +et confi+ration-ersion crrentp+rade QW Tcrrent9p &resltP Tcrrent9p Q 9p+radePac1a+eQCBP$D"""4G3,"4F' QWQW +et Tcrrent9p administrati-edata QW Ts.,e- &resltP Ts.,e- Q StrctZHWQQQWQW "!prodctNmber Q CBP$D"""4G QWQWQW 4!prodct,e-ision Q ,"4F etc!' QWQW lfro sbrac1Qms,slotQ",pl+innitQ"T Sr QW Tfroid &resltP Tfroid Q D' QWQW d4ip #N"4O"4$DJH QW Tip3addr &resltP Tip3addr Q "D!"!4!G' QWQW *4d D(a QW Tres &resltP Tres Q "D' QWQW - Scredential QW Tcredential &resltP /*ome/ericsson/mos*ell/commonEars/*ost!p"4' c' sin+ an arit*metic operation /*e follo.in+ nmeric operations are spportedP : addition # sbstraction R mliplication / di-ision U modlo &retrns t*e remainder of an inte+er di-ision operation' 7(amplesP QWQW Ti Q " &resltP TiQ"' QWQW Ti Q Ti : " &resltP TiQ4' QWQW TE Q Ti R G &resltP TEQI' QWQW T1 Q Ti R TE &resltP T1Q"4' QWQW Tl Q Ti / TE &resltP TlQD!GGG' QWQW Tm Q T1 U H &resltP TmQ4' NoteP Onl) one operation per line is allo.ed! A space mst 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! Bt Ti Q TE : T1 : Tl QQQQW NO/OM' d' sin+ otpt from a ni( commandP /*e ni( command mst be srronded b) bac1#2otes &['! 5ariables can be sed .it*in t*e ni( command! 7(ample"P QWQW Tdate Q [date :U)UmUd#U=UM[ &resltP Tdate Q DND$GD# "ONH' QWQW +et et*ernetlin1 ipaddress QW Tipaddress &resltP Tipaddress Q "D!"!"4J!"O' QWQW Tlo+file Q Tipaddress3Tdate!lo+ &resltP 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[ &resltP Terrors Q t*e nmber of 7,,O,s fond 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 crrent startable c- bt t*e last di+it is incremented b) " QWQW lt confi+ration-ersion QWQW +et confi+ration startable QW Tstartable &resltP Tstartable Q ,BSGDNH3P4!"!H3C9G3A3D"' QWQW Tc-name Q [T+a.1 #- c-nameQTstartable 6B7CIN Z print +ensb&/!! T/,>>,",c-name' sprintf&>UD4s>,sbstr&c-name,len+t*&c-name'#"':"' W6[ QWQW c-ms Tc-name &resltP Tc-name Q ,BSGDNH3P4!"!H3C9G3A3D4' e' sin+ strin+ maniplation /*e follo.in+ strin+ operations are spportedP concatenation and sbstittion/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*ot 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 sbstittion/replacement is performed sin+ t*e >#s> s.itc* to specif) t*e strin+ to sbstitte and t*e >#r> s.itc* to specif) t*e strin+ it s*old 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 sbstitted, ot*er.ise, onl) t*e first instance! S)nta( for sbstittion/replacementP T-ar Q ori+inalStrin+ #s strin+/oSbstitte [#r strin+/o,eplaceIt@it* [#+ ] ] ,e+lar e(pressions can be sed in t*e strin+ maniplations! 7(amplesP QWQW T-ar Q abc3defabc +*i QWQW T-ar" Q T-ar #s abc &resltP T-ar" Q 3defabc +*i , onl) first instance of >abc> .as replaced' QWQW T-ar4 Q T-ar #s \(D4D &resltP T-ar4 Q abc3defabc+*i , t*e space si+n .as remo-ed' QWQW T-arG Q T-ar #s abc #+ &resltP T-arG Q 3def +*i , all instances of >abc> .ere replaced' QWQW T-arN Q T-ar #s abc #r ()0 &resltP T-arN Q ()03defabc +*i , first instance of >abc> .as replaced .it* >()0>' QWQW T-arH Q T-ar #s abc #r ()0 #+ &resltP 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 &resltP T-arI Q ()0 +*i , t*e re+lar e(pression >a!Rc> .as replaced .it* >()0>' QWQW T-arO Q T-arABCT-arI &resltP 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 &resltP 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+ maniplation is needed, it is al.a)s possible to se an e(ternal pro+ram sc* as +a.1 to do t*e strin+ maniplation! See e(ample 4 in para+rap* d' abo-e! f' sin+ otpt from a predefined fnction Crrentl), t*e follo.in+ fnctions e(istP R fdn&pro()' QQQQW inpt is t*e pro() id, otpt is t*e FDN R ldn&pro()' QQQQW inpt is t*e pro() id, otpt is t*e %DN R rdn&pro()' QQQQW inpt is t*e pro() id, otpt is t*e ,DN R mot)pe&pro()' QQQQW inpt is t*e pro() id, otpt is t*e MO t)pe R pro()&strin+' QQQQW inpt is t*e %DN or FDN &NO/ ,DN<', otpt is t*e pro() id R readinpt&srin+' QQQQW inpt is a prompt t*at s*old appear on t*e screen, so t*at t*e ser can inpt an ans.er .*ic* .ill t*en be assi+ned to t*e -ariable! R readfile&file' QQQQW inpt 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 reslt of t*e fnction! If t*e file is not fond, t*e -ariable Tnr3of3lines is set to D, ot*er.ise it is set to t*e nmber of lines in t*e file! Note, t*is s*old not be sed on lar+e files as it .ill slo. do.n t*in+s -er) mc*! R testfile&file' QQQQW inpt is a filename! If t*e file is not fond, 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 e2al si+n &see e(ample belo.'! /*e separator sed to split t*e strin+ can be specified in t*e -ariable >Tsplit3separator>! B) defalt it is a space! If t*e Tsplit3separator *as been c*an+ed and needs to be reset to t*e defalt -ale, Est rn t*e command >nset Tsplit3separator>! /*e nmber of elements in t*e arra) is stored in t*e -ariable Tsplit3last 7(ample"P QWQW lt iblin1 QWQW ma ib ib QWQW for Tmo in ib Tmordn Q rdn&Tmo' if Tmordn Y "D4G lcc Tmordn lbl Tmordn, fi done 7(ample4P QWQW T-ar Q readinpt&Please confirm [)/n]P ' QWQW if T-ar <Y S) retrn fi 7(ampleGP QWQW Ttable Q readfile&/pat*/to/m)file' QWQW for TlineNmber Q " to Tnr3of3lines print Ttable[TlineNmber] T.ord Q split&Ttable[TlineNmber]' if T.ord["] Y SV Tnr3of3comments Q Tnr3of3comments : " fi nset T.ord nset Ttable[TlineNmber] done &NoteP b) nsettin+ t*e entr) .e6-e Est read # pro-ided .e don6t need it an)more # .ill ma1e t*in+s faster' +' 7(ample /*e prpose of t*e little mos*ell script belo. is to ma1e a cstomi0ed C5 name li1eP date3node/)pe3s.,e- QWQW c-ls QWQW Tdate Q [date :U)UmUd[ &resltP Tdate Q DND$GD' QWQW +et D prodctName QW Tnode/)pe &resltP Tnode/)pe Q ,BSG4D4' QWQW Tnode/)pe Q Tnode/)pe #s ,BS &resltP Tnode/)pe Q G4D4' QWQW +et confi+ration-ersion crrentp+rade QW Tcrrent9p &resltP Tcrrent9p Q 9p+radePac1a+eQCBP$D"$"GU43,"4N' QWQW +et Tcrrent9p administrati-edata QW Ts.,e- &resltP Ts.,e- Q StrctZHWQQQWQW "!prodctNmber Q CBP$D"$"G/4 QWQWQW 4!prodct,e-ision Q ,"4N QQQWQW G!prodctName Q CBP$D"$"GU43,"4N !!!!' QWQW Ts.,e- Q [+a.1 #- crrents.Q>Ts.,e-> 6B7CINZ s.re-Q+ensb&/\rK\n/,>>,>+>,crrents.' ? print +ensb&/S!R,e-ision Q KQQQWQW G!prodct!RT/,>>,>+>,s.re-' W6[ &resltP Ts.,e- Q ,"4N' QWQW c-ms Tdate3Tnode/)pe3Ts.,e- &resltP c-ms DND$GD3G4D43,"4N ' RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!4# =as*tables &arra)s' RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e inde( and t*e -ale 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+ -ales 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 &reslt printotP' 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 &reslt printotP' 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 constrcts RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e if statement mst be follo.ed b) a condition! /*e comparison operator of t*e condition mst be srronded 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 strctre mst be specified .it* a >fi> statement! 7ac* statement mst 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) nmber of AND/O, can be pt on a line bt NO/ BO/= on t*e same line! Cropin+ conditions .it* brac1ets is NO/ spported! /*e >retrn> command can be sed to e(it from t*e command file in case a certain condition is met! /)pe >* retrn> 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 e2als Y matc*es <Q is not e2al to <Y does not matc* QW +reater t*an Z less t*an QWQ +reater or e2al t*an ZQ less or e2al t*an /*e .ords arond t*e operator can be eit*er a -ariable or a sin+le .ord bt 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 retrn ne(pected resltsP if m)strin+3T-ar" Y T-ar4 if m)strin+ is t*is Y )or strin+ A condition can also Est 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 prodctname QW Tnode/)pe QWQW if Tnode/)pe Y G4D4 KK Tnode/)pe Y G"DN +et feeder attenation set feeder attenation N else if Tnode/)pe Y G"D" +et feeder attenation set feeder attenation "I else +et feeder attenation fi RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR I!N# For constrcts RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR /*e parameter to t*e >For> constrct can beP a' >e-er> P to repeat t*e loop an infinite nmber of times b' ZnmberOfIterationsW P to repeat t*e loop a specific nmber of times c' Tmo in ZmoCropW P to rn t*e bod) of t*e loop on eac* MO of t*e specified moCrop! MO +rops are created .it* t*e >ma> command, t)pe >* ma> for info! d' Tboard in ZboardCopW P to rn t*e bod) of t*e loop on eac* board of t*e specified board +rop! Board +rops 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( -ales of t*e *as*table Ttable +' T-ar Q Tstart to Tstop P T-ar is assi+ned e-er) inte+er -ale bet.een Tstart and Tstop! Tstart and Tstop can be -ariables or constants bt mst 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> strctre mst 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, mintes, *ors, or e-en ,OP periods! &/)pe >* .ait> for info!' Do not se t*e >sleep> command as t*is .ill reslt in *an+in+ if t*e loop is aborted! /*e loop can be aborted an) time b) t)pin+ ctrl#0 , t*en >toc* ZstopfileW>, t*en >f+>! /*e ZstopfileW pat* is s*o.n in t*e .indo. title bar! /)pe >* ctrl#0> for more info abot 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 ZnmberOf/imesW command" .ait ZnmberOfSecondsW done c' for Tmo in ZmoCropW +et Tmo ZattribteW QW T-ariable T-ariable" Q !!!! set Tmo ZattribteW T-ariable" etc!!! done d' for Tboard in ZboardCropW 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 reslt is >" &INS/A%%3COMP%7/7D'>, and contine .it* p+rade action! Abort t*e command file if t*e reslt is >I &INS/A%%3NO/3COMP%7/7D'> QWQW lt p+rade QWQW acc p+radepac1a+eQ((( nonbloc1in+install QWQW for e-er Tretrn Q D .ait "D +et p+radepac1a+eQ((( state QW Tpstate if Tpstate Y S" brea1 else if Tpstate Y SI Tretrn Q " brea1 fi done if Tretrn Q " retrn fi acc p+radepac1a+eQ((( p+rade b' rn a testcase HD times QWQW for HD rn testcase3G!"!"!cmd .ait 4m done c' increase t*e primar)Cpic*Po.er b) D!" dBm on eac* 9tranCell QWQW lt Strancell QWQW ma cell Strancell 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 +rop QWQW ba spb spb QWQW for Tboard in spb acc Tboard restart D " done e' sa-e t*e fro -ales of all pro+rams into a table and t*en restart e-er) pro+ram QWQW lma pro+rams3on3slot3"$ sbrac1Qms,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 fnctions RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 9sers can define t*eir o.n fnctions, sin+ t*e fnc/endfnc constrct! If t*e fnction is called .it* ar+ments, t*ese are assi+ned to t*e -ariables T", T4, TG, etc 7(ampleP "! Define t*e fnction &t*e fnction definitions can be rn in a different command file' =ere .e are definin+ a fnction .*ic* c*ec1s t*e state of t*e mirrored dis1s and retrns once t*e dis1s are in s)nc fnc c*ec13dis13state Vif T" is ndefined or different to an inte+er -ale 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 StatsP R5alid> Ttempdir/dis1state if Tres QW D brea1 fi done endfnc fnc .aitforser Tdate Q [date >:U]#Um#Ud U=PUMPUS>[ for e-er Trepl) Q readinpt&@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]> endfnc endfnc 4! Call t*e fnction =ere .e *a-e made a small script .*ic* ma1es se of or ser#defined fnction! First .e are rnnin+ a file containin+ all t*e definitions for or ser# defined fnctions! &Note t*at t*e fnctions can also be defined .it*in t*e same script, bt b) 1eepin+ all fnctions in a separate file means t*at se-eral command files can se t*e same fnctions' @e *a-e called t*e fnction 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 fnction rn Y/m)fnctions3define!mos for e-er c*ec13dis13state H .aitforser 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! Bt it is crrentl) 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 crrent .or1arond is to pt t*e for/if constrcts into fnctions! See c*apter I!H for more info on fnctions! 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 confirmp+rade fi I!O# 7(amples 7(ample scripts can be fond 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(ectin+! # 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 conters set timeot GD set timeotacc D set ma(timeot 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 cont t*e prompts t*at *a-e been seen incr PPpromptcnt V deb+, !! pts stderr >TMOS=7%% PromptP TPrompt seen> if ZTpromptcnt ^ 4W Z V t*is mi+*t be .ron+ e(p3send #s >\r> V and contine .it* t*is call to e(pect e(p3contine W W timeot Z V e(pect +oes *ere after Ttimeot seconds V boo11eepin+ *o. lon+ )o *a-e been .aitin+ incr PPtimeotacc TPPtimeot V deb+ e-er) Ttimeot seconds pts stderr >"\tMoS*ell not respondin+< TPPtimemotacc sec> V as lon+ as )or Tma(timeot is not reac*ed resme t*e e(pect call if ZTPPtimeotacc ^ TPPma(timeotW Z V restart t*is e(pect call e(p3contine W W eof Z V if t*e spa.nded process dies )o +o *ereP pts stderr >TMOS=7%% died on me> W pts stderr >finis*ed< TPPpromptcont> brea1 W