(CommandList children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:listall) op:Equal rhs:{(0)} spids:[20])] spids: [20] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:errors) op:Equal rhs:{(0)} spids:[24])] spids: [24] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:checked) op:Equal rhs:{(0)} spids:[28])] spids: [28] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (-a))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:listall) op:Equal rhs:{(1)} spids:[53])] spids: [53] ) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [16777215 50] ) ] spids: [16777215 59] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (SimpleCommand words: [ {(echo)} { (DQ ('Usage: ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [83 87] ) (' [-a] URL') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[91])] ) terminator: <Op_Semi ';'> ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 76] ) ] spids: [16777215 100] ) (C {(trap)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(which)} {(rm)})]) left_token: <Left_Backtick '`'> spids: [106 110] ) (' -f traverse*.errors reject*.dat traverse*.dat') ) } {(0)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:outfile) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Number '$1'))}) (C {(cut)} {(-d/)} {(-f3)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [119 133] ) (.errors.ext) ) } spids: [117] ) ] spids: [117] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:URLlist) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Number '$1')}) (C {(cut)} {(-d/)} {(-f3)}) (C {(sed)} {(SQ <'s/www\\.//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [139 159] ) (.rejects) ) } spids: [137] ) ] spids: [137] ) (C {(rm)} {(-f)} {($ VSub_Name '$outfile')}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(DQ ($ VSub_Name '$URLlist'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (SimpleCommand words: [ {(echo)} { (DQ ('File ') ($ VSub_Name '$URLlist') (' not found. Please run checklinks first.') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[201])] ) terminator: <Op_Semi ';'> ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 190] ) ] spids: [16777215 209] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-s)} {(DQ ($ VSub_Name '$URLlist'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("There don't appear to be any external links (") ($ VSub_Name '$URLlist') (' is empty)') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[239])] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 228] ) ] spids: [16777215 247] ) (ForEach iter_name: URL iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(cat)} {($ VSub_Name '$URLlist')}) (C {(sort)}) (C {(uniq)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [260 272] ) } ] do_arg_iter: F body: (DoGroup children: [ (Sentence child: (SimpleCommand words: [{(curl)} {(-s)} {(DQ ($ VSub_Name '$URL'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [285] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[289]) ] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:return) op: Equal rhs: {($ VSub_QMark '$?')} spids: [293] ) ] spids: [293] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$return')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$listall')} {(-eq)} {(1)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(echo)} {(DQ ($ VSub_Name '$URL') (' is fine.'))})] spids: [16777215 328] ) ] spids: [16777215 339] ) ] spids: [16777215 311] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_Name '$URL') (' fails with error code ') ($ VSub_Name '$return'))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:errors) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$errors')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [355 364] ) } spids: [354] ) ] spids: [354] ) ] spids: [342 367] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:checked) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$checked')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [371 380] ) } spids: [370] ) ] spids: [370] ) ] spids: [274 382] ) spids: [259 16777215] ) (C {(echo)} {(DQ )}) (C {(echo)} { (DQ ('Done. Checked ') ($ VSub_Name '$checked') (' URLs and found ') ($ VSub_Name '$errors') (' errors.') ) } ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )