(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sendmail) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(which)} {(sendmail)})]) left_token: <Left_CommandSub '$('> spids: [12 16] ) } spids: [11] ) ] spids: [11] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sitearchive) op: Equal rhs: {(DQ (/tmp/changetrack))} spids: [19] ) ] spids: [19] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tmpchanges) op: Equal rhs: {(DQ ($ VSub_Name '$sitearchive') (/changes.) ($ VSub_Dollar '$$'))} spids: [24] ) ] spids: [24] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:fromaddr) op: Equal rhs: {(DQ ('webscraper@intuitive.com'))} spids: [34] ) ] spids: [34] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:dirperm) op:Equal rhs:{(755)} spids:[39])] spids: [39] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:fileperm) op:Equal rhs:{(644)} spids:[45])] spids: [45] ) (C {(trap)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(which)} {(rm)})]) left_token: <Left_CommandSub '$('> spids: [55 59] ) (' -f ') ($ VSub_Name '$tmpchanges') ) } {(0)} {(1)} {(15)} ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ('Usage: ') (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [95 99] ) (' url email') ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (SimpleCommand words: [{(echo)} {(DQ (" tip: to have changes displayed on screen, use email addr '-'"))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 88] ) ] spids: [16777215 121] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-d)} {($ VSub_Name '$sitearchive')} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [(C {(mkdir)} {($ VSub_Name '$sitearchive')})] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [157 161] ) (" failed: couldn't create ") ($ VSub_Name '$sitearchive') (.) ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 151] ) ] spids: [16777215 176] ) (C {(chmod)} {($ VSub_Name '$dirperm')} {($ VSub_Name '$sitearchive')}) ] spids: [16777215 138] ) ] spids: [16777215 185] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(echo)} {($ VSub_Number '$1')}) (C {(cut)} {(-c1-5)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [193 203] ) ) } {(KW_Bang '!') (Lit_Other '=')} {(DQ ('http:'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Please use fully qualified URLs (e.g. start with 'http://')"))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 217] ) ] spids: [16777215 234] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:fname) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Number '$1')}) (C {(sed)} {(SQ <'s/http:\\/\\///g'>)}) (C {(tr)} {(SQ <'/?&'>)} {(SQ <...>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [239 263] ) ) } spids: [237] ) ] spids: [237] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:baseurl) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(echo)} {($ VSub_Number '$1')}) (C {(cut)} {(-d/)} {(-f1-3)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [268 280] ) (/) ) } spids: [266] ) ] spids: [266] ) (Pipeline children: [ (C {(lynx)} {(-dump)} {(DQ ($ VSub_Number '$1'))}) (SimpleCommand words: [{(uniq)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)} ) ] ) ] negated: F ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(diff)} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')} {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)} ] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$tmpchanges')} ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-s)} {($ VSub_Name '$tmpchanges')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Status: Site ') ($ VSub_Number '$1') (' has changed since our last check.') ) } ) ] spids: [16777215 370] ) ] else_action: [ (C {(echo)} {(DQ ('Status: No changes for site ') ($ VSub_Number '$1') (' since last check'))} ) (C {(rm)} {(-f)} {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [382 417] ) ] spids: [16777215 333] ) ] else_action: [ (C {(echo)} { (DQ ('Status: first visit to ') ($ VSub_Number '$1') ('. Copy archived for future analysis.') ) } ) (C {(mv)} {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')} ) (C {(chmod)} {($ VSub_Name '$fileperm')} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')} ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [419 458] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$2'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (-))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Pipeline children: [ (Subshell child: (CommandList children: [ (C {(echo)} {(DQ ('Content-type: text/html'))}) (C {(echo)} {(DQ ('From: ') ($ VSub_Name '$fromaddr') (' (Web Site Change Tracker)'))} ) (C {(echo)} {(DQ ('Subject: Web Site ') ($ VSub_Number '$1') (' Has Changed'))}) (C {(echo)} {(DQ ('To: ') ($ VSub_Number '$2'))}) (C {(echo)} {(DQ )}) (Pipeline children: [ (C {(curl)} {(-s)} {(-dump)} {($ VSub_Number '$1')}) (C {(sed)} {(-e)} { (DQ ('s|src=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('|SRC=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$baseurl') ('|gi') ) } {(-e)} { (DQ ('s|href=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('|HREF=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$baseurl') ('|gi') ) } {(-e)} {(DQ ('s|') ($ VSub_Name '$baseurl') (Lit_Other '\\') ('/http:|http:|g'))} ) ] negated: F ) ] ) spids: [493 584] ) (C {($ VSub_Name '$sendmail')} {(-t)}) ] negated: F ) ] spids: [16777215 490] ) ] else_action: [ (C {(diff)} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')} {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)} ) ] spids: [593 614] ) (C {(mv)} {($ VSub_Name '$sitearchive') (/) (${ VSub_Name fname) (.new)} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')} ) (C {(chmod)} {(755)} {($ VSub_Name '$sitearchive') (/) ($ VSub_Name '$fname')}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )