(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_Pound '$#')} {(-eq)} {(0)} {(Lit_RBracket ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Usage: ') (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) ) (' amount currency to currency') ) } ) (C {(echo)} {(DQ ('Most common currencies are CAD, CNY, EUR, USD, INR, JPY, and MXN'))}) (C {(echo)} { (DQ ('Use ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) ) (' list') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' for the full list of supported currencies') ) } ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(uname)})]) ) } {(Lit_Equals '=')} {(DQ (Darwin))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:LANG) op:Equal rhs:{(C)})] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:url) op: Equal rhs: {(DQ ('https://www.google.com/finance/converter'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tempfile) op: Equal rhs: {(DQ (/tmp/converter.) ($ VSub_Dollar '$$'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lynx) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(which)} {(lynx)})]) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:currencies) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {($ VSub_DollarName '$lynx')} {(-source)} {(DQ ($ VSub_DollarName '$url'))}) (C {(grep)} {(DQ ('option value='))}) (C {(cut)} {(-d) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>)} {(-f2-)} ) (C {(sed)} {(SQ <'s/">/ /'>)}) (C {(cut)} {(-d) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\('>)} {(-f1)} ) (C {(sort)}) (C {(uniq)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_Pound '$#')} {(-ne)} {(4)} {(Lit_RBracket ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (list))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('List of supported currencies:'))}) (C {(echo)} {(DQ ($ VSub_DollarName '$currencies'))}) ] ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_Number '$3')} {(KW_Bang '!') (Lit_Equals '=')} {(DQ (to))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Usage: ') (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) ) (' value currency TO currency') ) } ) (C {(echo)} { (DQ ('(use ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) ) (' list') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' to get a list of all currency values)') ) } ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:amount) op:Equal rhs:{($ VSub_Number '$1')})] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:basecurrency) op: Equal rhs: { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ VSub_Number '$2')}) (C {(tr)} {(SQ <'[:lower:]'>)} {(SQ <'[:upper:]'>)}) ] negated: F ) ] ) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:targetcurrency) op: Equal rhs: { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ VSub_Number '$4')}) (C {(tr)} {(SQ <'[:lower:]'>)} {(SQ <'[:upper:]'>)}) ] negated: F ) ] ) ) ) } ) ] ) (command.Pipeline children: [ (C {($ VSub_DollarName '$lynx')} {(-source)} { (DQ ($ VSub_DollarName '$url') ('?a=') ($ VSub_DollarName '$amount') ('&from=') ($ VSub_DollarName '$basecurrency') ('&to=') ($ VSub_DollarName '$targetcurrency') ) } ) (C {(grep)} {(SQ <'id=currency_converter_result'>)}) (C {(sed)} {(SQ <'s/<[^>]*>//g'>)}) ] negated: F ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )