(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:titleurl) op: assign_op.Equal rhs: {(DQ ('http://www.imdb.com/title/tt'))} spids: [13] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:imdburl) op: assign_op.Equal rhs: {(DQ ('http://www.imdb.com/find?s=tt&exact=true&ref_=fn_tt_ex&q='))} spids: [18] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tempout) op: assign_op.Equal rhs: {(DQ (/tmp/moviedata.) ($ Id.VSub_Dollar '$$'))} spids: [23] ) ] ) (command.ShFunction name: summarize_film body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(grep)} {(DQ ('<title>'))} {($ Id.VSub_DollarName '$tempout')}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/<[^>]*>//g;s/(more)//' span_id:55))}) ] negated: F ) (command.Pipeline children: [ (C {(grep)} {(--color) (Id.Lit_Equals '=') (never)} {(-A2)} {(SQ (Token id:Id.Lit_Chars val:'<h5>Plot:' span_id:69))} {($ Id.VSub_DollarName '$tempout')} ) (C {(tail)} {(-1)}) (C {(cut)} {(-d) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\<' span_id:87) ) } {(-f1)} ) (C {(fmt)}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/^/ /' span_id:100))}) ] negated: F ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:105) arg_word: {(0)} ) ] ) ) (C {(trap)} {(DQ ('rm -f ') ($ Id.VSub_DollarName '$tempout'))} {(0)} {(1)} {(15)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:138) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Usage: ') ($ Id.VSub_Number '$0') (' {movie title | movie ID}'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:151) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:155) arg_word: {(1)} ) ] spids: [126 140] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nodigits) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:171) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_Number '$1')}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/[[:digit:]]*//g' span_id:181))} ) ] negated: F ) ] ) ) ) } spids: [169] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(1)} {(-a)} {(-z)} {(DQ ($ Id.VSub_DollarName '$nodigits'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:207) ) ] action: [ (command.Simple words: [ {(lynx)} {(-source)} {(DQ ($ Id.VSub_DollarName '$titleurl') ($ Id.VSub_Number '$1') (/combined))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:222) fd: -1 arg_word: {($ Id.VSub_DollarName '$tempout')} ) ] ) (C {(summarize_film)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:230) arg_word: {(0)} ) ] spids: [187 209] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fixedname) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:246) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_At '$@')}) (C {(tr)} {(SQ (Token id:Id.Lit_Chars val:' ' span_id:256))} {(SQ (Token id:Id.Lit_Chars val:'+' span_id:260))} ) ] negated: F ) ] ) ) ) } spids: [244] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:url) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$imdburl') ($ Id.VSub_DollarName '$fixedname'))} spids: [269] ) ] ) (command.Simple words: [ {(lynx)} {(-source)} {($ Id.VSub_DollarName '$imdburl') ($ Id.VSub_DollarName '$fixedname')} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:283) fd: -1 arg_word: {($ Id.VSub_DollarName '$tempout')} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fail) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:294) command_list: (command.CommandList children: [ (C {(grep)} {(--color) (Id.Lit_Equals '=') (never)} {(SQ (Token id:Id.Lit_Chars val:'<h1 class="findHeader">No ' span_id:302))} {($ Id.VSub_DollarName '$tempout')} ) ] ) ) ) } spids: [292] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} {(DQ ($ Id.VSub_DollarName '$fail'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:328) ) ] action: [ (C {(echo)} {(DQ ('Failed: no results found for ') ($ Id.VSub_Number '$1'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:341) arg_word: {(1)} ) ] spids: [314 330] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:354) command_list: (command.CommandList children: [ (C {(grep)} { (SQ (Token id: Id.Lit_Chars val: '<h1 class="findHeader">Displaying' span_id: 358 ) ) } {($ Id.VSub_DollarName '$tempout')} ) ] ) ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:367) ) ] action: [ (command.Pipeline children: [ (C {(grep)} {(--color) (Id.Lit_Equals '=') (never)} {(SQ (Token id:Id.Lit_Chars val:/title/tt span_id:379))} {($ Id.VSub_DollarName '$tempout')} ) (C {(sed)} { (SQ (Token id:Id.Lit_Chars val:'s/</\\\n' span_id:391) (Token id:Id.Lit_Chars val:'</g' span_id:392) ) } ) (C {(grep)} {(-vE)} {(SQ (Token id:Id.Lit_Chars val:'(.png|.jpg|>[ ]*$)' span_id:404))}) (C {(grep)} {(-A)} {(1)} {(DQ ('a href='))}) (C {(grep)} {(-v)} {(SQ (Token id:Id.Lit_Chars val:'^--$' span_id:430))}) (C {(sed)} { (SQ (Token id: Id.Lit_Chars val: 's/<a href="\\/title\\/tt//g;s/<\\/a> //' span_id: 440 ) ) } ) (C {(awk)} { (SQ (Token id: Id.Lit_Chars val: '(NR % 2 == 1) { title=$0 } (NR % 2 == 0) { print title " " $0 }' span_id: 450 ) ) } ) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/\\/.*>/: /' span_id:460))}) (C {(sort)}) ] negated: F ) ] spids: [345 369] ) ] ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:473) arg_word:{(0)}) ] )