(command.CommandList children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} { (DQ <'Usage: '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.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:<Id.Lit_EscapedChar '\\"'>) (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) <' list'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' for the full list of supported currencies'> ) } ) ] spids: [18 31] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<uname>}))} {<Id.Lit_Equals '='>} {(DQ <Darwin>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LANG) op: assign_op.Equal rhs: {<C>} spids: [92] ) ] ) ] spids: [72 89] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:url) op: assign_op.Equal rhs: {(DQ <'https://www.google.com/finance/converter'>)} spids: [101] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tempfile) op: assign_op.Equal rhs: {(DQ <'/tmp/converter.'> ($ Id.VSub_Dollar '$$'))} spids: [106] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lynx) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<which>} {<lynx>}))} spids: [113] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:currencies) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {($ Id.VSub_DollarName '$lynx')} {<-source>} {(DQ ($ Id.VSub_DollarName '$url'))} ) (C {<grep>} {(DQ <'option value='>)}) (C {<cut>} {<-d> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)} {<-f2->} ) (C {<sed>} {(SQ <'s/">/ /'>)}) (C {<cut>} {<-d> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)} {<-f1>} ) (C {<sort>}) (C {<uniq>}) ] negated: F ) ) } spids: [125] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-ne>} {<4>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <list>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <'List of supported currencies:'>)}) (C {<echo>} {(DQ ($ Id.VSub_DollarName '$currencies'))}) ] spids: [202 220] ) ] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] spids: [185 199] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$3')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <to>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} { (DQ <'Usage: '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) <' value currency TO currency'> ) } ) (C {<echo>} { (DQ <'(use '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) <' list'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' to get a list of all currency values)'> ) } ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] spids: [255 272] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:amount) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [311] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:basecurrency) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_Number '$2')}) (C {<tr>} {(SQ <'[:lower:]'>)} {(SQ <'[:upper:]'>)}) ] negated: F ) ) ) } spids: [314] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:targetcurrency) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_Number '$4')}) (C {<tr>} {(SQ <'[:lower:]'>)} {(SQ <'[:upper:]'>)}) ] negated: F ) ) ) } spids: [335] ) ] ) (command.Pipeline children: [ (C {($ Id.VSub_DollarName '$lynx')} {<-source>} { (DQ ($ Id.VSub_DollarName '$url') <'?a='> ($ Id.VSub_DollarName '$amount') <'&from='> ($ Id.VSub_DollarName '$basecurrency') <'&to='> ($ Id.VSub_DollarName '$targetcurrency') ) } ) (C {<grep>} {(SQ <'id=currency_converter_result'>)}) (C {<sed>} {(SQ <'s/<[^>]*>//g'>)}) ] negated: F ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )