(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:currentVersion) op: assign_op.Equal rhs: {(DQ <1.11.1>)} spids: [7] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredClient) op: assign_op.Equal rhs: {(DQ )} spids: [12] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredPython) op: assign_op.Equal rhs: {(DQ )} spids: [16] ) ] ) (command.ShFunction name: getConfiguredClient body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<command>} {<-v>} {<curl>}] redirects: [ (redir.Redir op: <Id.Redir_AndGreat '&>'> fd: -1 arg_word: {</dev/null>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredClient) op: assign_op.Equal rhs: {(DQ <curl>)} spids: [47] ) ] ) ] spids: [31 44] ) (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<command>} {<-v>} {<wget>}] redirects: [ (redir.Redir op: <Id.Redir_AndGreat '&>'> fd: -1 arg_word: {</dev/null>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredClient) op: assign_op.Equal rhs: {(DQ <wget>)} spids: [69] ) ] ) ] spids: [53 66] ) (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<command>} {<-v>} {<fetch>}] redirects: [ (redir.Redir op: <Id.Redir_AndGreat '&>'> fd: -1 arg_word: {</dev/null>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredClient) op: assign_op.Equal rhs: {(DQ <fetch>)} spids: [91] ) ] ) ] spids: [75 88] ) ] else_action: [ (C {<echo>} {(DQ <'Error: This tool reqires either curl, wget, or fetch to be installed.'>)} ) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] ) ] ) ) (command.ShFunction name: getConfiguredPython body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<command>} {<-v>} {<python2>}] redirects: [ (redir.Redir op: <Id.Redir_AndGreat '&>'> fd: -1 arg_word: {</dev/null>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredPython) op: assign_op.Equal rhs: {(DQ <python2>)} spids: [141] ) ] ) ] spids: [125 138] ) (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<command>} {<-v>} {<python>}] redirects: [ (redir.Redir op: <Id.Redir_AndGreat '&>'> fd: -1 arg_word: {</dev/null>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuredPython) op: assign_op.Equal rhs: {(DQ <python>)} spids: [163] ) ] ) ] spids: [147 160] ) ] else_action: [ (C {<echo>} {(DQ <'Error: This tool requires python 2 to be installed.'>)}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] ) ] ) ) (command.ShFunction name: python body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$configuredPython'))} arms: [ (case_arm pat_list: [{<python2>}] action: [(C {<python2>} {(DQ ($ Id.VSub_At '$@'))})] spids: [206 207 214 -1] ) (case_arm pat_list: [{<python>}] action: [(C {<python>} {(DQ ($ Id.VSub_At '$@'))})] spids: [217 218 225 -1] ) ] ) ] ) ) (command.ShFunction name: httpGet body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$configuredClient'))} arms: [ (case_arm pat_list: [{<curl>}] action: [(C {<curl>} {<-A>} {<curl>} {<-s>} {(DQ ($ Id.VSub_At '$@'))})] spids: [252 253 266 -1] ) (case_arm pat_list: [{<wget>}] action: [(C {<wget>} {<-qO->} {(DQ ($ Id.VSub_At '$@'))})] spids: [269 270 279 -1] ) (case_arm pat_list: [{<fetch>}] action: [(C {<fetch>} {<-o>} {(DQ <...>)})] spids: [282 283 292 -1] ) ] ) ] ) ) (command.ShFunction name: checkInternet body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {<echo>} {<-e>} { (DQ <'GET http://google.com HTTP/1.0'> <Id.Lit_Other '\\'> <n> <Id.Lit_Other '\\'> <n> ) } ) (command.Simple words: [{<nc>} {<google.com>} {<80>}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op:<Id.Redir_GreatAnd '2>&'> fd:2 arg_word:{<1>}) ] ) ] negated: F ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})] spids: [338 351] ) ] else_action: [ (command.Simple words: [{<echo>} {(DQ <'Error: no active internet connection'>)}] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] ) ] ) ) (command.ShFunction name: getStockInformation body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:stockInfo) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<httpGet>} { (DQ < 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=' > ($ Id.VSub_Number '$1') <'&apikey=KPCCCRJVMOGN9L6T'> ) } ) ] ) ) } spids: [401] ) ] redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{</dev/null>})] ) (C {<export>} {<Id.Lit_VarLike 'PYTHONIOENCODING='> <utf8>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (command.Simple words: [ {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['02. Exchange Name']" > ) } ] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op: <Id.Redir_GreatAnd '2>&'> fd: 2 arg_word: {<1>} ) ] ) ] negated: F ) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} {(DQ <'Not a valid stock symbol'>)}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) terminator: <Id.Op_Semi _> ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:exchangeName) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['02. Exchange Name']" > ) } ) ] negated: F ) ] ) ) } spids: [477] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:latestPrice) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['03. Latest Price']" > ) } ) ] negated: F ) ] ) ) } spids: [495] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:open) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['04. Open (Current Trading Day)']" > ) } ) ] negated: F ) ] ) ) } spids: [513] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:high) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['05. High (Current Trading Day)']" > ) } ) ] negated: F ) ] ) ) } spids: [531] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:low) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['06. Low (Current Trading Day)']" > ) } ) ] negated: F ) ] ) ) } spids: [549] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:close) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['07. Close (Previous Trading Day)']" > ) } ) ] negated: F ) ] ) ) } spids: [567] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:priceChange) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['08. Price Change']" > ) } ) ] negated: F ) ] ) ) } spids: [585] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:priceChangePercentage) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['09. Price Change Percentage']" > ) } ) ] negated: F ) ] ) ) } spids: [603] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:volume) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['10. Volume (Current Trading Day)']" > ) } ) ] negated: F ) ] ) ) } spids: [621] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lastUpdated) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$stockInfo')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['Realtime Global Securities Quote']['11. Last Updated']" > ) } ) ] negated: F ) ] ) ) } spids: [639] ) ] ) (C {<unset>} {<stockInfo>}) ] ) ) (command.ShFunction name: printStockInformation body: (command.BraceGroup children: [ (C {<echo>}) (C {<echo>} {($ Id.VSub_DollarName '$symbol')} {<stock>} {<info>}) (C {<echo>} {(DQ <'============================================='>)}) (C {<echo>} {(DQ <'| Exchange Name: '> ($ Id.VSub_DollarName '$exchangeName'))}) (C {<echo>} {(DQ <'| Latest Price: '> ($ Id.VSub_DollarName '$latestPrice'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$open')} right: {(DQ <-->)} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {(DQ <'| Open (Current Trading Day): '> ($ Id.VSub_DollarName '$open'))} ) terminator: <Id.Op_Semi _> ) ] spids: [715 729] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$high')} right: {(DQ <-->)} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {(DQ <'| High (Current Trading Day): '> ($ Id.VSub_DollarName '$high'))} ) terminator: <Id.Op_Semi _> ) ] spids: [745 759] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$low')} right: {(DQ <-->)} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {(DQ <'| Low (Current Trading Day): '> ($ Id.VSub_DollarName '$low'))} ) terminator: <Id.Op_Semi _> ) ] spids: [775 789] ) ] ) (C {<echo>} {(DQ <'| Close (Previous Trading Day): '> ($ Id.VSub_DollarName '$close'))}) (C {<echo>} {(DQ <'| Price Change: '> ($ Id.VSub_DollarName '$priceChange'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$priceChangePercentage')} right: {(DQ <'%'>)} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} { (DQ <'| Price Change Percentage: '> ($ Id.VSub_DollarName '$priceChangePercentage') ) } ) terminator: <Id.Op_Semi _> ) ] spids: [821 835] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$volume')} right: {(DQ <-->)} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {(DQ <'| Volume (Current Trading Day): '> ($ Id.VSub_DollarName '$volume'))} ) terminator: <Id.Op_Semi _> ) ] spids: [851 865] ) ] ) (C {<echo>} {(DQ <'| Last Updated: '> ($ Id.VSub_DollarName '$lastUpdated'))}) (C {<echo>} {(DQ <'============================================='>)}) (C {<echo>}) ] ) ) (command.ShFunction name: getTicker body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:response) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<httpGet>} { (DQ <'http://d.yimg.com/autoc.finance.yahoo.com/autoc?query='> ($ Id.VSub_Number '$1') <'+'> ($ Id.VSub_Number '$2') <'+'> ($ Id.VSub_Number '$3') <'+'> ($ Id.VSub_Number '$4') <'+'> ($ Id.VSub_Number '$5') <'+'> ($ Id.VSub_Number '$6') <'+'> ($ Id.VSub_Number '$7') <'+'> ($ Id.VSub_Number '$8') <'+'> ($ Id.VSub_Number '$9') <'®ion=1&lang=en%22'> ) } ) ] ) ) } spids: [917] ) ] redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{</dev/null>})] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:symbol) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$response')}) (C {<python>} {<-c>} { (DQ < "import sys, json; print json.load(sys.stdin)['ResultSet']['Result'][0]['symbol']" > ) } ) ] negated: F ) ] ) ) } spids: [949] ) ] ) (C {<unset>} {<response>}) ] ) ) (command.ShFunction name: update body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:repositoryName) op: assign_op.Equal rhs: {(DQ <Bash-Snippets>)} spids: [999] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:githubUserName) op: assign_op.Equal rhs: {(DQ <alexanderepstein>)} spids: [1008] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nameOfInstallFile) op: assign_op.Equal rhs: {(DQ <install.sh>)} spids: [1017] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:latestVersion) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<httpGet>} {<https> <Id.Lit_Other ':'> <//api.github.com/repos/> ($ Id.VSub_DollarName '$githubUserName') </> ($ Id.VSub_DollarName '$repositoryName') </tags> } ) (C {<grep>} {<-Eo>} {(SQ <'"name":.*?[^\\\\]",'>)}) (C {<head>} {<-1>}) (C {<grep>} {<-Eo>} {(DQ <'[0-9.]+'>)}) ] negated: F ) ] ) ) } spids: [1026] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$currentVersion')} right: {(DQ )} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$repositoryName')} right: {(DQ )} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$githubUserName')} right: {(DQ )} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$nameOfInstallFile')} right: {(DQ )} ) ) ) ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [ {<echo>} {(DQ <'Error: update utility has not been configured correctly.'>)} ] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [1070 1110] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$latestVersion')} right: {(DQ )} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [{<echo>} {(DQ <'Error: no active internet connection'>)}] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [1128 1141] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$latestVersion'))} right: {(DQ ($ Id.VSub_DollarName '$currentVersion'))} ) ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<echo>} {(DQ <'Version '> ($ Id.VSub_DollarName '$latestVersion') <' available'>)} ) (C {<echo>} {<-n>} { (DQ <'Do you wish to update '> ($ Id.VSub_DollarName '$repositoryName') <' [Y/n]: '> ) } ) (C {<read>} {<-r>} {<answer>}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$answer'))} right: {(DQ <Y>)} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$answer'))} right: {(DQ <y>)} ) ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<cd>} {(word_part.TildeSub token:<Id.Lit_TildeLike '~'>)}) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} {(SQ <'Update Failed'>)}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) terminator: <Id.Op_Semi _> ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_d child: {<Id.Lit_TildeLike '~'> </> ($ Id.VSub_DollarName '$repositoryName') } ) ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<rm>} {<-r>} {<-f>} {($ Id.VSub_DollarName '$repositoryName')} ) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} { (DQ < 'Permissions Error: try running the update as sudo' > ) } ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) terminator: <Id.Op_Semi _> ) ] ) ] ) terminator: <Id.Op_Semi _> ) ] spids: [1266 1279] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<git>} {<clone>} { (DQ <'https://github.com/'> ($ Id.VSub_DollarName '$githubUserName') </> ($ Id.VSub_DollarName '$repositoryName') ) } ) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} {(DQ <"Couldn't download latest version">)}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) terminator: <Id.Op_Semi _> ) ] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<cd>} {($ Id.VSub_DollarName '$repositoryName')}) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} {(SQ <'Update Failed'>)}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) terminator: <Id.Op_Semi _> ) ] ) ] ) (command.AndOr ops: [Id.Op_DPipe Id.Op_DPipe] children: [ (command.Simple words: [ {<git>} {<checkout>} {(DQ <v> ($ Id.VSub_DollarName '$latestVersion'))} ] redirects: [ (redir.Redir op: <Id.Redir_Great '2>'> fd: 2 arg_word: {</dev/null>} ) ] ) (command.Simple words: [ {<git>} {<checkout>} {(DQ ($ Id.VSub_DollarName '$latestVersion'))} ] redirects: [ (redir.Redir op: <Id.Redir_Great '2>'> fd: 2 arg_word: {</dev/null>} ) ] ) (C {<echo>} { (DQ < "Couldn't git checkout to stable release, updating to latest commit." > ) } ) ] ) (C {<chmod>} {<a> <Id.Lit_Other '+'> <x>} {<install.sh>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<./> ($ Id.VSub_DollarName '$nameOfInstallFile')} {(DQ <update>)} ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] ) (C {<cd>} {<..>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<rm>} {<-r>} {<-f>} {($ Id.VSub_DollarName '$repositoryName')}) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} { (DQ < 'Permissions Error: update succesfull but cannot delete temp files located at ~/' > ($ Id.VSub_DollarName '$repositoryName') <' delete this directory with sudo'> ) } ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) terminator: <Id.Op_Semi _> ) ] ) ] ) ] spids: [1209 1238] ) ] else_action: [ (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] ) ] spids: [1162 1179] ) ] else_action: [ (C {<echo>} { (DQ ($ Id.VSub_DollarName '$repositoryName') <' is already the latest version'> ) } ) ] ) ] ) ] ) ) (command.ShFunction name: usage body: (command.BraceGroup children: [ (C {<echo>} {(DQ <Stocks>)}) (C {<echo>} {(DQ <'Description: Finds the latest information on a certain stock.'>)}) (C {<echo>} {(DQ <'Usage: stocks [flag] or stocks [company/ticker]'>)}) (C {<echo>} {(DQ <' -u Update Bash-Snippet Tools'>)}) (C {<echo>} {(DQ <' -h Show the help'>)}) (C {<echo>} {(DQ <' -v Get the tool version'>)}) (C {<echo>} {(DQ <'Examples:'>)}) (C {<echo>} {(DQ <' stocks AAPL'>)}) (C {<echo>} {(DQ <' stocks Tesla'>)}) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<getConfiguredPython>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<getConfiguredClient>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<checkInternet>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: [(command.Sentence child:(C {<getopts>} {(DQ <uvh>)} {<opt>}) terminator:<Id.Op_Semi _>)] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\?'>)}] action: [ (command.Simple words: [{<echo>} {(DQ <'Invalid option: -'> ($ Id.VSub_DollarName '$OPTARG'))}] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [1616 1617 1636 -1] ) (case_arm pat_list: [{<h>}] action: [ (C {<usage>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [1639 1640 1651 -1] ) (case_arm pat_list: [{<v>}] action: [ (C {<echo>} {(DQ <'Version '> ($ Id.VSub_DollarName '$currentVersion'))}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [1654 1655 1671 -1] ) (case_arm pat_list: [{<u>}] action: [ (C {<update>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [1674 1675 1686 -1] ) (case_arm pat_list: [{<Id.Lit_Other ':'>}] action: [ (command.Simple words: [ {<echo>} { (DQ <'Option -'> ($ Id.VSub_DollarName '$OPTARG') <' requires an argument.'>) } ] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [1689 1690 1710 -1] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number '$1')} right: {(DQ <update>)} ) ) terminator: <Id.Op_Semi _> ) ] action: [(C {<update>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [1719 1733] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number '$1')} right: {(DQ <help>)} ) ) terminator: <Id.Op_Semi _> ) ] action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [1743 1757] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Pound '$#')} right: {(DQ <0>)} ) ) terminator: <Id.Op_Semi _> ) ] action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [1767 1781] ) ] else_action: [ (C {<getTicker>} {(DQ ($ Id.VSub_At '$@'))}) (C {<getStockInformation>} {($ Id.VSub_DollarName '$symbol')}) (C {<printStockInformation>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) ] )