(CommandList children: [ (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} {(DQ ('usage: ') ($ VSub_Number '$0') (' <directory of files to execute>'))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[44])] ) (SimpleCommand words: [ {(echo)} {(DQ ('or ') ($ VSub_Number '$0') (' { daily | weekly | monthly | security }'))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[56])] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [33] ) spids: [28 32] ) (FuncDef name: output_pipe body: (BraceGroup children: [ (C {(eval)} {(Lit_VarLike 'output=') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{('*') (Lit_Slash /)}) spids: [82 87] ) (_output) } ) (Case to_match: {(DQ ($ VSub_Name '$output'))} arms: [ (case_arm pat_list: [{(/) (Lit_Other '*')}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pipe) op: Equal rhs: {(DQ ('cat >>') ($ VSub_Name '$output'))} spids: [104] ) ] spids: [104] ) ] spids: [100 102 109 16777215] ) (case_arm pat_list: [{(DQ )}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pipe) op:Equal rhs:{(cat)} spids:[116])] spids: [116] ) ] spids: [16777215 114 118 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pipe) op: Equal rhs: { (DQ ("mail -E -s '") ($ VSub_Name '$host') (' ') (${ VSub_Number 2) (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonPlus arg_word:{(' ')}) spids: [132 136] ) (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) spids: [137 142] ) (" run output' ") ($ VSub_Name '$output') ) } spids: [124] ) ] spids: [124] ) ] spids: [121 122 146 16777215] ) ] spids: [91 97 149] ) (C {(eval)} {($ VSub_Name '$pipe')}) ] spids: [71] ) spids: [67 70] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-lt)} {(1)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [16777215 173] ) ] spids: [16777215 178] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-r)} {(/etc/defaults/periodic.conf)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(.)} {(/etc/defaults/periodic.conf)}) (C {(source_periodic_confs)})] spids: [16777215 198] ) ] spids: [16777215 208] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:host) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(hostname)})]) left_token: <Left_Backtick '`'> spids: [212 214] ) } spids: [211] ) ] spids: [211] ) (C {(export)} {(host)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Number '$1')} {(KW_Bang '!') (Lit_Other '=')} {(DQ (LOCKED))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ret) op:Equal rhs:{(0)} spids:[255])] spids: [255] ) (ForEach iter_name: arg do_arg_iter: T body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:lockfile) op: Equal rhs: {(/var/run/periodic.) (BracedVarSub token: <VSub_Name arg> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) spids: [269 274] ) (.lock) } spids: [267] ) ] spids: [267] ) (C {(lockf)} {(-t)} {(0)} {(DQ (${ VSub_Name lockfile))} {(/bin/sh)} {($ VSub_Number '$0')} {(LOCKED)} {(DQ ($ VSub_Name '$arg'))} ) (Case to_match: {($ VSub_QMark '$?')} arms: [ (case_arm pat_list: [{(0)}] spids: [308 309 311 16777215] ) (case_arm pat_list: [{(73)}] action: [ (Pipeline children: [ (C {(echo)} {(DQ ("can't create ") (${ VSub_Name lockfile))}) (C {(output_pipe)} {($ VSub_Name '$arg')} {(DQ ($ VSub_Name '$PERIODIC'))} ) ] negated: F ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(1)} spids: [343] ) ] spids: [343] ) ] spids: [314 315 347 16777215] ) (case_arm pat_list: [{(75)}] action: [ (Pipeline children: [ (C {(echo)} { (DQ ($ VSub_Name '$host') (' ') (BracedVarSub token: <VSub_Name arg> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) spids: [362 367] ) (' prior run still in progress') ) } ) (C {(output_pipe)} {($ VSub_Name '$arg')} {(DQ ($ VSub_Name '$PERIODIC'))} ) ] negated: F ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(1)} spids: [384] ) ] spids: [384] ) ] spids: [350 351 388 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(1)} spids: [395] ) ] spids: [395] ) ] spids: [391 392 399 16777215] ) ] spids: [301 305 402] ) ] spids: [264 405] ) spids: [16777215 16777215] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_Name '$ret')}) ] spids: [16777215 252] ) ] spids: [16777215 412] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [16777215 428] ) ] spids: [16777215 433] ) (C {(shift)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arg) op:Equal rhs:{($ VSub_Number '$1')} spids:[437])] spids: [437] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$PERIODIC_ANTICONGESTION_FILE'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(export)} {(Lit_VarLike 'PERIODIC_ANTICONGESTION_FILE=') (CommandSubPart command_list: (CommandList children: [ (C {(mktemp)} { (BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (tmp)} ) spids: [464 469] ) (/periodic.anticongestion.XXXXXXXXXX) } ) ] ) left_token: <Left_Backtick '`'> spids: [461 471] ) } ) ] spids: [16777215 455] ) ] spids: [16777215 473] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(tty)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [479] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[483]) ] ) terminator: <Op_Semi ';'> ) ] action: [(C {(export)} {(Lit_VarLike 'PERIODIC_IS_INTERACTIVE=') (1)})] spids: [16777215 487] ) ] spids: [16777215 495] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tmp_output) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(mktemp)} { (BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (tmp)} ) spids: [501 506] ) (/periodic.XXXXXXXXXX) } ) ] ) left_token: <Left_Backtick '`'> spids: [498 508] ) } spids: [497] ) ] spids: [497] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:context) op: Equal rhs: {(DQ ($ VSub_Name '$PERIODIC'))} spids: [510] ) ] spids: [510] ) (C {(export)} {(Lit_VarLike 'PERIODIC=') (DQ ($ VSub_Name '$arg') (BracedVarSub token: <VSub_Name PERIODIC> suffix_op: (StringUnary op_id:VTest_ColonPlus arg_word:{(' ')}) spids: [520 524] ) (${ VSub_Name PERIODIC) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(LhsName name:success) op:Equal rhs:{(YES)} spids:[541]) (assign_pair lhs:(LhsName name:info) op:Equal rhs:{(YES)} spids:[544]) (assign_pair lhs:(LhsName name:badconfig) op:Equal rhs:{(NO)} spids:[547]) (assign_pair lhs:(LhsName name:empty_output) op:Equal rhs:{(YES)} spids:[550]) ] spids: [541] ) (ForEach iter_name: var iter_words: [{(success)} {(info)} {(badconfig)} {(empty_output)}] do_arg_iter: F body: (DoGroup children: [ (Case to_match: { (CommandSubPart command_list: (CommandList children: [ (C {(eval)} {(echo)} { (DQ (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (BracedVarSub token: <VSub_Name arg> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) spids: [583 588] ) (_show_) ($ VSub_Name '$var') ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [576 592] ) } arms: [ (case_arm pat_list: [ {(Lit_Other '[') (Yy) (Lit_Other ']') (Lit_Other '[') (Ee) (Lit_Other ']') (Lit_Other '[') (Ss) (Lit_Other ']') } ] action: [(C {(eval)} {($ VSub_Name '$var') (Lit_Other '=') (YES)})] spids: [597 606 613 16777215] ) (case_arm pat_list: [ {(Lit_Other '[') (Nn) (Lit_Other ']') (Lit_Other '[') (Oo) (Lit_Other ']')} ] action: [(C {(eval)} {($ VSub_Name '$var') (Lit_Other '=') (NO)})] spids: [616 622 629 16777215] ) ] spids: [574 594 632] ) ] spids: [571 634] ) spids: [561 569] ) (Case to_match: {($ VSub_Name '$arg')} arms: [ (case_arm pat_list: [{(/) (Lit_Other '*')}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-d)} {(DQ ($ VSub_Name '$arg'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dirlist) op: Equal rhs: {(DQ ($ VSub_Name '$arg'))} spids: [663] ) ] spids: [663] ) ] spids: [16777215 660] ) ] else_action: [ (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Number '$0') (': ') ($ VSub_Name '$arg') (' not found'))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[681])] ) (ControlFlow token:<ControlFlow_Continue continue>) ] spids: [669 688] ) ] spids: [643 645 691 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:dirlist) op:Equal rhs:{(EmptyPart)} spids:[696])] spids: [696] ) (ForEach iter_name: top iter_words: [{(/etc/periodic)} {(${ VSub_Name local_periodic)}] do_arg_iter: F body: (DoGroup children: [ (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(-d)} {($ VSub_Name '$top') (/) ($ VSub_Name '$arg')} {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dirlist) op: Equal rhs: { (DQ ($ VSub_Name '$dirlist') (' ') ($ VSub_Name '$top') (/) ($ VSub_Name '$arg') ) } spids: [727] ) ] spids: [727] ) ] ) ] spids: [712 737] ) spids: [704 710] ) ] spids: [693 694 740 16777215] ) ] spids: [637 641 742] ) (Pipeline children: [ (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:empty) op:Equal rhs:{(TRUE)} spids:[748])] spids: [748] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:processed) op:Equal rhs:{(0)} spids:[752])] spids: [752] ) (ForEach iter_name: dir iter_words: [{($ VSub_Name '$dirlist')}] do_arg_iter: F body: (DoGroup children: [ (ForEach iter_name: file iter_words: [{($ VSub_Name '$dir') (/) (Lit_Other '*')}] do_arg_iter: F body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-x)} {($ VSub_Name '$file')} {(-a)} {(KW_Bang '!')} {(-d)} {($ VSub_Name '$file')} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(TRUE)} spids: [804] ) ] spids: [804] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:processed) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$processed')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [809 816] ) } spids: [808] ) ] spids: [808] ) (SimpleCommand words: [{($ VSub_Name '$file')}] redirects: [ (Redir op_id: Redir_Less fd: 16777215 arg_word: {(/dev/null)} spids: [821] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {($ VSub_Name '$tmp_output')} spids: [824] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [827] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rc) op: Equal rhs: {($ VSub_QMark '$?')} spids: [831] ) ] spids: [831] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-s)} {($ VSub_Name '$tmp_output')} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Case to_match: {($ VSub_Name '$rc')} arms: [ (case_arm pat_list: [{(0)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$success')} {(Lit_Other '=')} {(NO)} {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(FALSE)} spids: [871] ) ] spids: [871] ) ] ) ] spids: [856 857 873 16777215] ) (case_arm pat_list: [{(1)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$info')} {(Lit_Other '=')} {(NO)} {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(FALSE)} spids: [891] ) ] spids: [891] ) ] ) ] spids: [876 877 893 16777215] ) (case_arm pat_list: [{(2)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$badconfig')} {(Lit_Other '=')} {(NO)} {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(FALSE)} spids: [911] ) ] spids: [911] ) ] ) ] spids: [896 897 913 16777215] ) ] spids: [849 853 916] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$output')} {(Lit_Other '=')} {(TRUE)} {(Lit_Other ']')} ) (BraceGroup children: [ (Sentence child: (C {(cat)} {($ VSub_Name '$tmp_output')}) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:empty) op: Equal rhs: {(FALSE)} spids: [938] ) ] spids: [938] ) terminator: <Op_Semi ';'> ) ] spids: [931] ) ] ) ] spids: [16777215 846] ) ] spids: [16777215 945] ) (C {(cp)} {(/dev/null)} {($ VSub_Name '$tmp_output')}) ] spids: [16777215 801] ) ] spids: [16777215 955] ) ] spids: [779 958] ) spids: [773 777] ) ] spids: [765 961] ) spids: [761 763] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$empty')} {(Lit_Other '=')} {(TRUE)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$empty_output')} {(Lit_Other '=')} {(TRUE)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$processed')} {(Lit_Other '=')} {(1)} {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plural) op: Equal rhs: {(EmptyPart)} spids: [1008] ) ] spids: [1008] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plural) op: Equal rhs: {(s)} spids: [1012] ) ] spids: [1012] ) ] ) (C {(echo)} { (DQ ('No output from the ') ($ VSub_Name '$processed') (' file') ($ VSub_Name '$plural') (' processed') ) } ) ] spids: [16777215 993] ) ] spids: [16777215 1027] ) ] spids: [16777215 977] ) ] else_action: [ (C {(echo)} {(DQ )}) (C {(echo)} {(DQ ('-- End of ') ($ VSub_Name '$arg') (' output --'))}) ] spids: [1030 1048] ) ] spids: [745] ) (C {(output_pipe)} {($ VSub_Name '$arg')} {(DQ ($ VSub_Name '$context'))}) ] negated: F ) (C {(rm)} {(-f)} {($ VSub_Name '$tmp_output')}) (C {(rm)} {(-f)} {($ VSub_Name '$PERIODIC_ANTICONGESTION_FILE')}) ] )